Skip to content

Commit

Permalink
Prevent Take command numberformat errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Oct 19, 2013
1 parent 84b9b63 commit 74ed8bf
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -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 <PLAYER.ITEM_IN_HAND.QTY>.");
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 74ed8bf

Please sign in to comment.