Fix the no eat bug inside safezones

This commit is contained in:
Sam 2017-02-24 20:51:26 +00:00
parent 2090d2202c
commit 71964b7bca

View File

@ -142,8 +142,15 @@ public class SafezoneModule extends MiniPlugin
@EventHandler
public void hungerChange(FoodLevelChangeEvent event)
{
if (isInSafeZone(event.getEntity().getLocation()))
if (isInSafeZone(event.getEntity().getLocation()) && event.getEntity() instanceof Player)
{
Player player = (Player) event.getEntity();
if (player.getFoodLevel() >= event.getFoodLevel())
{
return;
}
event.setCancelled(true);
}
}