From b22e97b3cfd7830c51674288bf867116e7493c1a Mon Sep 17 00:00:00 2001 From: Alexander Schepp Date: Wed, 31 Oct 2012 21:30:57 +0100 Subject: [PATCH] remove all L --- .../com/earth2me/essentials/commands/Commandexp.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandexp.java b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java index 08fb61ea1..5d3658470 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandexp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java @@ -131,7 +131,7 @@ public class Commandexp extends EssentialsCommand strAmount = strAmount.toLowerCase(Locale.ENGLISH); if (strAmount.startsWith("l") || strAmount.endsWith("l")) { - strAmount = strAmount.substring(1); + strAmount = strAmount.replaceAll("l",""); int neededLevel = Integer.parseInt(strAmount); if (give) { @@ -141,7 +141,11 @@ public class Commandexp extends EssentialsCommand SetExpFix.setTotalExperience(target, 0); } else { - amount = (long)Integer.parseInt(strAmount); + amount = Long.parseLong(strAmount); + if (amount < 0 || amount > Integer.MAX_VALUE) + { + throw new NotEnoughArgumentsException(); + } } if (give) @@ -152,10 +156,6 @@ public class Commandexp extends EssentialsCommand { amount = (long)Integer.MAX_VALUE; } - if (amount < 0 || amount > Integer.MAX_VALUE) - { - throw new NotEnoughArgumentsException(); - } SetExpFix.setTotalExperience(target, amount.intValue()); sender.sendMessage(_("expSet", target.getDisplayName(), amount)); }