Fixed animals and monsters trampling crops.
To avoid trampling by griefers spamming chicken eggs or baiting monsters into fields.
This commit is contained in:
parent
31aa352648
commit
b04625d861
|
|
@ -109,8 +109,8 @@ class EntityEventHandler implements Listener
|
|||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
//don't allow players to trample crops
|
||||
else if(event.getEntityType() == EntityType.PLAYER && event.getBlock().getType() == Material.SOIL)
|
||||
//don't allow crops to be trampled
|
||||
else if(event.getTo() == Material.DIRT && event.getBlock().getType() == Material.SOIL)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user