Fixed lingering potion of harm grief.

Doesn't damage protected entities (like claimed animals).
This commit is contained in:
ryanhamshire 2016-03-20 19:51:33 -07:00
parent 3e260ac21e
commit b51a4cbf8a

View File

@ -822,6 +822,7 @@ public class EntityEventHandler implements Listener
&& damageSource != null && damageSource != null
&& damageSource.getType() != EntityType.CREEPER && damageSource.getType() != EntityType.CREEPER
&& damageSource.getType() != EntityType.ENDER_CRYSTAL && damageSource.getType() != EntityType.ENDER_CRYSTAL
&& damageSource.getType() != EntityType.AREA_EFFECT_CLOUD
&& !(damageSource instanceof Projectile) && !(damageSource instanceof Projectile)
&& !(damageSource instanceof Explosive) && !(damageSource instanceof Explosive)
&& !(damageSource instanceof ExplosiveMinecart)) && !(damageSource instanceof ExplosiveMinecart))
@ -1049,6 +1050,7 @@ public class EntityEventHandler implements Listener
for(PotionEffect effect : effects) for(PotionEffect effect : effects)
{ {
PotionEffectType effectType = effect.getType(); PotionEffectType effectType = effect.getType();
//restrict some potions on claimed animals (griefers could use this to kill or steal animals over fences) //restrict some potions on claimed animals (griefers could use this to kill or steal animals over fences)
if(effectType.getName().equals("JUMP") || effectType.getName().equals("POISON")) if(effectType.getName().equals("JUMP") || effectType.getName().equals("POISON"))
{ {