diff --git a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java index bfb95b9a7..5b430e798 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java @@ -85,7 +85,7 @@ public class EssentialsBlockListener extends BlockListener { if (!event.getLine(1).isEmpty()) { - String[] l1 = event.getLine(1).split("[ :-]+"); + String[] l1 = event.getLine(1).split("[ :-]+", 2); boolean m1 = l1[0].matches("\\$[0-9]+"); int q1 = Integer.parseInt(m1 ? l1[0].substring(1) : l1[0]); if (q1 < 1) throw new Exception("Quantities must be greater than 0."); @@ -126,7 +126,7 @@ public class EssentialsBlockListener extends BlockListener if (user.isAuthorized("essentials.signs.warp.create")) { if (!event.getLine(3).isEmpty()) { - String[] l1 = event.getLine(3).split("[ :-]+"); + String[] l1 = event.getLine(3).split("[ :-]+", 2); boolean m1 = l1[0].matches("\\$[0-9]+"); int q1 = Integer.parseInt(m1 ? l1[0].substring(1) : l1[0]); if (q1 < 1) throw new Exception("Quantities must be greater than 0."); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java index 717da0ca2..7dd3a488e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java @@ -25,8 +25,7 @@ public class Commandgive extends EssentialsCommand throw new NotEnoughArgumentsException(); } - String[] itemArgs = args[1].split("[^a-zA-Z0-9]"); - ItemStack stack = ItemDb.get(itemArgs[0]); + ItemStack stack = ItemDb.get(args[0]); String itemname = stack.getType().toString().toLowerCase().replace("_", ""); if (sender instanceof Player @@ -40,10 +39,6 @@ public class Commandgive extends EssentialsCommand sender.sendMessage(ChatColor.RED + "You are not allowed to spawn the item " + itemname); return; } - if (itemArgs.length > 1) - { - stack.setDurability(Short.parseShort(itemArgs[1])); - } if (args.length > 2 && Integer.parseInt(args[2]) > 0) { stack.setAmount(Integer.parseInt(args[2])); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java index e944acbca..119d0cc6b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java @@ -22,8 +22,7 @@ public class Commanditem extends EssentialsCommand { throw new NotEnoughArgumentsException(); } - String[] itemArgs = args[0].split("[^a-zA-Z0-9]"); - ItemStack stack = ItemDb.get(itemArgs[0]); + ItemStack stack = ItemDb.get(args[0]); String itemname = stack.getType().toString().toLowerCase().replace("_", ""); if (ess.getSettings().permissionBasedItemSpawn() @@ -36,10 +35,6 @@ public class Commanditem extends EssentialsCommand user.sendMessage(ChatColor.RED + "You are not allowed to spawn the item " + itemname); return; } - if (itemArgs.length > 1) - { - stack.setDurability(Short.parseShort(itemArgs[1])); - } if (args.length > 1 && Integer.parseInt(args[1]) > 0) {