From 77ae94e6e239df8eccbace527f36a2dbc77af98a Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Sun, 6 May 2018 16:57:59 +0200 Subject: DevCommandFix --- src/Java/gtPlusPlus/core/commands/CommandMath.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/Java/gtPlusPlus/core/commands') diff --git a/src/Java/gtPlusPlus/core/commands/CommandMath.java b/src/Java/gtPlusPlus/core/commands/CommandMath.java index a05bb42756..6ab0b2cbc6 100644 --- a/src/Java/gtPlusPlus/core/commands/CommandMath.java +++ b/src/Java/gtPlusPlus/core/commands/CommandMath.java @@ -55,8 +55,8 @@ public class CommandMath implements ICommand public void processCommand(final ICommandSender S, final String[] argString){ final World W = S.getEntityWorld(); final EntityPlayer P = CommandUtils.getPlayer(S); - if (!W.isRemote){ - if (P.getDisplayName().toLowerCase().equals("draknyte1") || P.getCommandSenderName().toLowerCase().equals("draknyte1")) { + if (!W.isRemote && P != null){ + if (P.getDisplayName().toLowerCase().equals("draknyte1") || P.getCommandSenderName().toLowerCase().equals("draknyte1")) { String[] prefixes = new String[] { "ingot", "plate", @@ -83,8 +83,8 @@ public class CommandMath implements ICommand "Silver", "Lead", "Aluminium" - }; - AutoMap itemEntities = new AutoMap(); + }; + AutoMap itemEntities = new AutoMap(); for (String g : prefixes) { for (String s : loots) { itemEntities.put(new EntityItem(W, P.posX, P.posY, P.posZ, ItemUtils.getItemStackOfAmountFromOreDictNoBroken(g+s, 64))); @@ -92,7 +92,7 @@ public class CommandMath implements ICommand for (EntityItem e : itemEntities.values()) { e.lifespan = 30000; } - + } } @@ -194,6 +194,9 @@ public class CommandMath implements ICommand @Override public boolean canCommandSenderUseCommand(final ICommandSender var1){ final EntityPlayer P = CommandUtils.getPlayer(var1); + if (P == null){ + return false; + } if (P.getDisplayName().toLowerCase().equals("draknyte1") || P.getCommandSenderName().toLowerCase().equals("draknyte1")) { return true; } @@ -217,5 +220,4 @@ public class CommandMath implements ICommand return true; } -} - +} \ No newline at end of file -- cgit