mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-28 00:17:11 +00:00
Fixing NPE on Entity Listener (Powertool).
This commit is contained in:
parent
8cc249c2d3
commit
30f0f78efc
1 changed files with 9 additions and 5 deletions
|
@ -37,8 +37,11 @@ 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())
|
||||||
{
|
{
|
||||||
|
for (String command : commandList)
|
||||||
|
{
|
||||||
|
|
||||||
if (command != null && !command.isEmpty())
|
if (command != null && !command.isEmpty())
|
||||||
{
|
{
|
||||||
attacker.getServer().dispatchCommand(attacker, command.replaceAll("\\{player\\}", defender.getName()));
|
attacker.getServer().dispatchCommand(attacker, command.replaceAll("\\{player\\}", defender.getName()));
|
||||||
|
@ -48,6 +51,7 @@ public class EssentialsEntityListener extends EntityListener
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (event instanceof EntityDamageEvent || event instanceof EntityDamageByBlockEvent || event instanceof EntityDamageByProjectileEvent)
|
if (event instanceof EntityDamageEvent || event instanceof EntityDamageByBlockEvent || event instanceof EntityDamageByProjectileEvent)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue