Bug fixes for animal vs splash potion protections.
This commit is contained in:
parent
a29f18fe7a
commit
da4f0fda73
|
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user