summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Buonopane <techsoftadvanced@gmail.com>2012-02-23 12:46:57 -0500
committerPaul Buonopane <techsoftadvanced@gmail.com>2012-02-23 12:46:57 -0500
commitd06fc84e41eb8743754255085328a4decb920dce (patch)
treeebc3d01a72c06b1864db698239e7b5550e52f7de
parent1cbb6f1617d54fa341ca19054c8d843e5a7de774 (diff)
downloadEssentials-d06fc84e41eb8743754255085328a4decb920dce.tar
Essentials-d06fc84e41eb8743754255085328a4decb920dce.tar.gz
Essentials-d06fc84e41eb8743754255085328a4decb920dce.tar.lz
Essentials-d06fc84e41eb8743754255085328a4decb920dce.tar.xz
Essentials-d06fc84e41eb8743754255085328a4decb920dce.zip
Changed s to dropStack for verbosity, and organized imports.precomponent
Signed-off-by: Paul Buonopane <techsoftadvanced@gmail.com>
-rw-r--r--Essentials/src/com/earth2me/essentials/Trade.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java
index ed99d0218..e9dc9f78a 100644
--- a/Essentials/src/com/earth2me/essentials/Trade.java
+++ b/Essentials/src/com/earth2me/essentials/Trade.java
@@ -1,7 +1,7 @@
package com.earth2me.essentials;
-import com.earth2me.essentials.api.ChargeException;
import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.api.ChargeException;
import com.earth2me.essentials.api.IEssentials;
import com.earth2me.essentials.api.ISettings;
import com.earth2me.essentials.api.IUser;
@@ -116,21 +116,21 @@ public class Trade
{
final Map<Integer, ItemStack> leftOver = InventoryWorkaround.addItem(user.getInventory(), true, getItemStack());
final Location loc = user.getLocation();
- for (ItemStack s : leftOver.values())
+ for (ItemStack dropStack : leftOver.values())
{
- final int maxStackSize = s.getType().getMaxStackSize();
- final int stacks = s.getAmount() / maxStackSize;
- final int leftover = s.getAmount() % maxStackSize;
+ final int maxStackSize = dropStack.getType().getMaxStackSize();
+ final int stacks = dropStack.getAmount() / maxStackSize;
+ final int leftover = dropStack.getAmount() % maxStackSize;
final Item[] itemStacks = new Item[stacks + (leftover > 0 ? 1 : 0)];
for (int i = 0; i < stacks; i++)
{
- final ItemStack stack = s.clone();
+ final ItemStack stack = dropStack.clone();
stack.setAmount(maxStackSize);
itemStacks[i] = loc.getWorld().dropItem(loc, stack);
}
if (leftover > 0)
{
- final ItemStack stack = s.clone();
+ final ItemStack stack = dropStack.clone();
stack.setAmount(leftover);
itemStacks[stacks] = loc.getWorld().dropItem(loc, stack);
}