Bug fixes for animal vs splash potion protections.

This commit is contained in:
ryanhamshire 2015-02-11 19:01:41 -08:00
parent a29f18fe7a
commit da4f0fda73
2 changed files with 3 additions and 4 deletions

View File

@ -887,9 +887,8 @@ 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 == PotionEffectType.JUMP || effectType == PotionEffectType.POISON) if(effectType.getName().equals("JUMP") || effectType.getName().equals("POISON"))
{ {
for(LivingEntity effected : event.getAffectedEntities()) for(LivingEntity effected : event.getAffectedEntities())
{ {
@ -903,6 +902,7 @@ class EntityEventHandler implements Listener
if(claim.allowContainers(thrower) != null) if(claim.allowContainers(thrower) != null)
{ {
event.setCancelled(true); event.setCancelled(true);
GriefPrevention.sendMessage(thrower, TextMode.Err, Messages.NoDamageClaimedEntity, claim.getOwnerName());
return; return;
} }
} }

View File

@ -998,7 +998,6 @@ public class GriefPrevention extends JavaPlugin
} }
catch(Exception e) catch(Exception e)
{ {
e.printStackTrace();
GriefPrevention.sendMessage(player, TextMode.Instr, Messages.TransferTopLevel); GriefPrevention.sendMessage(player, TextMode.Instr, Messages.TransferTopLevel);
return true; return true;
} }