Fix the no eat bug inside safezones
This commit is contained in:
parent
2090d2202c
commit
71964b7bca
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user