Fixed PvP immune players attacking pets.
This commit is contained in:
parent
d15da5d02c
commit
123fc4c284
|
|
@ -677,7 +677,7 @@ class EntityEventHandler implements Listener
|
||||||
if ((subEvent.getEntity() instanceof Creature && GriefPrevention.instance.config_claims_protectCreatures))
|
if ((subEvent.getEntity() instanceof Creature && GriefPrevention.instance.config_claims_protectCreatures))
|
||||||
{
|
{
|
||||||
//if entity is tameable and has an owner, apply special rules
|
//if entity is tameable and has an owner, apply special rules
|
||||||
if(subEvent.getEntity() instanceof Tameable && !GriefPrevention.instance.config_pvp_enabledWorlds.contains(subEvent.getEntity().getWorld()))
|
if(subEvent.getEntity() instanceof Tameable)
|
||||||
{
|
{
|
||||||
Tameable tameable = (Tameable)subEvent.getEntity();
|
Tameable tameable = (Tameable)subEvent.getEntity();
|
||||||
if(tameable.isTamed() && tameable.getOwner() != null)
|
if(tameable.isTamed() && tameable.getOwner() != null)
|
||||||
|
|
@ -706,6 +706,13 @@ class EntityEventHandler implements Listener
|
||||||
GriefPrevention.sendMessage(attacker, TextMode.Err, message);
|
GriefPrevention.sendMessage(attacker, TextMode.Err, message);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
//and disallow if attacker is pvp immune
|
||||||
|
else if(attackerData.pvpImmune)
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
GriefPrevention.sendMessage(attacker, TextMode.Err, Messages.CantFightWhileImmune);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user