Fix a few wolf issues

This commit is contained in:
Wizjany 2013-01-31 08:23:38 -05:00
parent 5085841d9d
commit dfb6114584

View File

@ -337,13 +337,17 @@ private void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
event.setCancelled(true);
return;
}
} else if (attacker instanceof Tameable) {
}
if (attacker instanceof Tameable) {
if (((Tameable) attacker).getOwner() == null) {
if (!set.allows(DefaultFlag.MOB_DAMAGE, localPlayer)) {
event.setCancelled(true);
return;
}
}
if (!(((Tameable) attacker).getOwner() instanceof Player)) {
return;
}
Player beastMaster = (Player) ((Tameable) attacker).getOwner();
Vector pt2 = toVector(attacker.getLocation());
if (!mgr.getApplicableRegions(pt2).allows(DefaultFlag.PVP, plugin.wrapPlayer(beastMaster))) {