From 74ed8bf5b81ce794aec5cb97dcdb88ab66ab7828 Mon Sep 17 00:00:00 2001 From: mcmonkey4eva Date: Sat, 19 Oct 2013 11:52:38 -0700 Subject: [PATCH] Prevent Take command numberformat errors --- .../aufdemrand/denizen/scripts/commands/item/TakeCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/aufdemrand/denizen/scripts/commands/item/TakeCommand.java b/src/main/java/net/aufdemrand/denizen/scripts/commands/item/TakeCommand.java index dced8eb285..be0602ba43 100644 --- a/src/main/java/net/aufdemrand/denizen/scripts/commands/item/TakeCommand.java +++ b/src/main/java/net/aufdemrand/denizen/scripts/commands/item/TakeCommand.java @@ -112,7 +112,7 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException { case ITEMINHAND: int inHandAmt = scriptEntry.getPlayer().getPlayerEntity().getItemInHand().getAmount(); - int theAmount = qty.asInt(); + int theAmount = (int)qty.asDouble(); ItemStack newHandItem = new ItemStack(0); if (theAmount > inHandAmt) { dB.echoDebug("...player did not have enough of the item in hand, so Denizen just took as many as it could. To avoid this situation, use an IF ."); @@ -146,7 +146,7 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException { case ITEM: for (dItem item : items) { ItemStack is = item.getItemStack(); - is.setAmount(qty.asInt()); + is.setAmount((int)qty.asDouble()); // Remove books with a certain title even if they // are not identical to an item script, to allow