Protected death loot doesn't take damage.

Previously, griefers could destroy it with fire or lava for example.
This commit is contained in:
ryanhamshire 2016-01-28 10:19:36 -08:00
parent 096c85ba9e
commit ac68b95301

View File

@ -574,6 +574,15 @@ public class EntityEventHandler implements Listener
//horse protections can be disabled
if(event.getEntity() instanceof Horse && !GriefPrevention.instance.config_claims_protectHorses) return;
//protected death loot can't be destroyed, only picked up or despawned due to expiration
if(event.getEntityType() == EntityType.DROPPED_ITEM)
{
if(event.getEntity().hasMetadata("GP_ITEMOWNER"))
{
event.setCancelled(true);
}
}
//protect pets from environmental damage types which could be easily caused by griefers
if(event.getEntity() instanceof Tameable && !GriefPrevention.instance.pvpRulesApply(event.getEntity().getWorld()))
{