diff options
Diffstat (limited to 'src/Java/gtPlusPlus/core')
-rw-r--r-- | src/Java/gtPlusPlus/core/commands/CommandMath.java | 16 |
1 files changed, 9 insertions, 7 deletions
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<EntityItem> itemEntities = new AutoMap<EntityItem>(); + }; + AutoMap<EntityItem> itemEntities = new AutoMap<EntityItem>(); 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 |