Fixed another error.

This commit is contained in:
Matthew Miller 2018-07-24 11:55:14 +10:00
parent e94083045f
commit 3189b1ac13

View File

@ -449,7 +449,6 @@ public void onDamageEntity(DamageEntityEvent event) {
RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery();
Player playerAttacker = event.getCause().getFirstPlayer();
LocalPlayer localAttacker = WorldGuardPlugin.inst().wrapPlayer(playerAttacker);
boolean canDamage;
String what;
@ -474,6 +473,7 @@ public void onDamageEntity(DamageEntityEvent event) {
/* PVP */
} else if (pvp) {
LocalPlayer localAttacker = WorldGuardPlugin.inst().wrapPlayer(playerAttacker);
Player defender = (Player) event.getEntity();
// if defender is an NPC