mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-13 18:14:38 +02:00
Fixing NPE on Entity Listener (Powertool).
This commit is contained in:
@@ -37,13 +37,17 @@ public class EssentialsEntityListener extends EntityListener
|
|||||||
User attacker = ess.getUser(eAttack);
|
User attacker = ess.getUser(eAttack);
|
||||||
ItemStack is = attacker.getItemInHand();
|
ItemStack is = attacker.getItemInHand();
|
||||||
List<String> commandList = attacker.getPowertool(is);
|
List<String> commandList = attacker.getPowertool(is);
|
||||||
for(String command : commandList)
|
if (commandList != null && !commandList.isEmpty())
|
||||||
{
|
{
|
||||||
if (command != null && !command.isEmpty())
|
for (String command : commandList)
|
||||||
{
|
{
|
||||||
attacker.getServer().dispatchCommand(attacker, command.replaceAll("\\{player\\}", defender.getName()));
|
|
||||||
event.setCancelled(true);
|
if (command != null && !command.isEmpty())
|
||||||
return;
|
{
|
||||||
|
attacker.getServer().dispatchCommand(attacker, command.replaceAll("\\{player\\}", defender.getName()));
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user