summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-09-22 10:47:39 +0200
committersnowleo <schneeleo@gmail.com>2011-09-22 10:47:39 +0200
commit33c6fc1f1f8d1596bbdaa442c9dc1bc7d9fe205f (patch)
treea255e7bd398af7fd0ded2361359bfed044949df1
parent91b504cc66783add6589f29648d0aa6b825a1ab9 (diff)
downloadEssentials-33c6fc1f1f8d1596bbdaa442c9dc1bc7d9fe205f.tar
Essentials-33c6fc1f1f8d1596bbdaa442c9dc1bc7d9fe205f.tar.gz
Essentials-33c6fc1f1f8d1596bbdaa442c9dc1bc7d9fe205f.tar.lz
Essentials-33c6fc1f1f8d1596bbdaa442c9dc1bc7d9fe205f.tar.xz
Essentials-33c6fc1f1f8d1596bbdaa442c9dc1bc7d9fe205f.zip
Missing file for last commit
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java
index ce97726dc..2eda73540 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java
@@ -8,6 +8,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.EntityListener;
+import org.bukkit.event.entity.FoodLevelChangeEvent;
import org.bukkit.inventory.ItemStack;
@@ -80,4 +81,13 @@ public class EssentialsEntityListener extends EntityListener
}
}
}
+
+ @Override
+ public void onFoodLevelChange(FoodLevelChangeEvent event)
+ {
+ if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isGodModeEnabled())
+ {
+ event.setFoodLevel(20);
+ }
+ }
}