mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-27 21:25:45 +01:00
Fix dangling else in the listener, and no more NPEs for setclass command.
This commit is contained in:
parent
a94370deec
commit
80018504bc
BIN
MobArena.jar
BIN
MobArena.jar
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
name: MobArena
|
||||
author: garbagemule
|
||||
main: com.garbagemule.MobArena.MobArena
|
||||
version: 0.94.4.80
|
||||
version: 0.94.4.81
|
||||
softdepend: [Spout,MultiVerse,MultiWorld,XcraftGate,Towny,Heroes,MagicSpells,Vault]
|
||||
commands:
|
||||
ma:
|
||||
|
@ -607,19 +607,22 @@ public class ArenaListener
|
||||
}
|
||||
|
||||
else if (monsters.getMonsters().contains(event.getEntity())) {
|
||||
if (event.getReason() == TargetReason.FORGOT_TARGET)
|
||||
if (event.getReason() == TargetReason.FORGOT_TARGET) {
|
||||
event.setTarget(MAUtils.getClosestPlayer(plugin, event.getEntity(), arena));
|
||||
|
||||
else if (event.getReason() == TargetReason.TARGET_DIED)
|
||||
}
|
||||
else if (event.getReason() == TargetReason.TARGET_DIED) {
|
||||
event.setTarget(MAUtils.getClosestPlayer(plugin, event.getEntity(), arena));
|
||||
|
||||
else if (event.getReason() == TargetReason.TARGET_ATTACKED_ENTITY)
|
||||
if (arena.hasPet(event.getTarget()))
|
||||
}
|
||||
else if (event.getReason() == TargetReason.TARGET_ATTACKED_ENTITY) {
|
||||
if (arena.hasPet(event.getTarget())) {
|
||||
event.setCancelled(true);
|
||||
|
||||
else if (event.getReason() == TargetReason.CLOSEST_PLAYER)
|
||||
if (!arena.inArena((Player) event.getTarget()))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
else if (event.getReason() == TargetReason.CLOSEST_PLAYER) {
|
||||
if (!arena.inArena((Player) event.getTarget())) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -390,7 +390,7 @@ public class ArenaMasterImpl implements ArenaMaster
|
||||
|
||||
// If the helmet isn't a real helmet, set it explicitly.
|
||||
ItemStack helmet = inv.getHelmet();
|
||||
if (helmet.getTypeId() != 0 && ArmorType.getType(helmet) != ArmorType.HELMET) {
|
||||
if (helmet != null && ArmorType.getType(helmet) != ArmorType.HELMET) {
|
||||
section.set("helmet", ItemParser.parseString(helmet));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user