Fixed animals and monsters trampling crops.

To avoid trampling by griefers spamming chicken eggs or baiting monsters
into fields.
This commit is contained in:
ryanhamshire 2015-02-03 18:50:54 -08:00
parent 31aa352648
commit b04625d861

View File

@ -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);
}