summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-11-28 17:58:06 +0100
committersnowleo <schneeleo@gmail.com>2011-11-28 17:58:26 +0100
commit7268e1965d24b443d3ec4b2eddd6cde1967250e2 (patch)
tree51097b9623f1a66f723cee3bc5c27e3d05c117a7
parent4614d6d0ddc6d53a9929d568325bd0dac7477c82 (diff)
downloadEssentials-7268e1965d24b443d3ec4b2eddd6cde1967250e2.tar
Essentials-7268e1965d24b443d3ec4b2eddd6cde1967250e2.tar.gz
Essentials-7268e1965d24b443d3ec4b2eddd6cde1967250e2.tar.lz
Essentials-7268e1965d24b443d3ec4b2eddd6cde1967250e2.tar.xz
Essentials-7268e1965d24b443d3ec4b2eddd6cde1967250e2.zip
Ignore defaultstacksize from config, just use 64
-rw-r--r--Essentials/src/com/earth2me/essentials/InventoryWorkaround.java10
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandgive.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commanditem.java2
3 files changed, 7 insertions, 7 deletions
diff --git a/Essentials/src/com/earth2me/essentials/InventoryWorkaround.java b/Essentials/src/com/earth2me/essentials/InventoryWorkaround.java
index 0b8121f89..53bb5c7f7 100644
--- a/Essentials/src/com/earth2me/essentials/InventoryWorkaround.java
+++ b/Essentials/src/com/earth2me/essentials/InventoryWorkaround.java
@@ -81,10 +81,10 @@ public final class InventoryWorkaround
public static Map<Integer, ItemStack> addItem(final Inventory cinventory, final boolean forceDurability, final ItemStack... items)
{
- return addItem(cinventory, forceDurability, false, null, items);
+ return addItem(cinventory, forceDurability, false, items);
}
- public static Map<Integer, ItemStack> addItem(final Inventory cinventory, final boolean forceDurability, final boolean dontBreakStacks, final IEssentials ess, final ItemStack... items)
+ public static Map<Integer, ItemStack> addItem(final Inventory cinventory, final boolean forceDurability, final boolean dontBreakStacks, final ItemStack... items)
{
final Map<Integer, ItemStack> leftover = new HashMap<Integer, ItemStack>();
@@ -147,10 +147,10 @@ public final class InventoryWorkaround
else
{
// More than a single stack!
- if (item.getAmount() > (dontBreakStacks ? ess.getSettings().getDefaultStackSize() : item.getType().getMaxStackSize()))
+ if (item.getAmount() > (dontBreakStacks ? 64 : item.getType().getMaxStackSize()))
{
ItemStack stack = item.clone();
- stack.setAmount(dontBreakStacks ? ess.getSettings().getDefaultStackSize() : item.getType().getMaxStackSize());
+ stack.setAmount(dontBreakStacks ? 64 : item.getType().getMaxStackSize());
if (cinventory instanceof FakeInventory)
{
cinventory.setItem(firstFree, stack);
@@ -183,7 +183,7 @@ public final class InventoryWorkaround
final int amount = item.getAmount();
final int partialAmount = partialItem.getAmount();
- final int maxAmount = dontBreakStacks ? ess.getSettings().getDefaultStackSize() : partialItem.getType().getMaxStackSize();
+ final int maxAmount = dontBreakStacks ? 64 : partialItem.getType().getMaxStackSize();
// Check if it fully fits
if (amount + partialAmount <= maxAmount)
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java
index 32b0564b7..2147392a6 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java
@@ -77,7 +77,7 @@ public class Commandgive extends EssentialsCommand
final User giveTo = getPlayer(server, args, 0);
final String itemName = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace('_', ' ');
sender.sendMessage(ChatColor.BLUE + "Giving " + stack.getAmount() + " of " + itemName + " to " + giveTo.getDisplayName() + ".");
- InventoryWorkaround.addItem(giveTo.getInventory(), true, true, ess, stack);
+ InventoryWorkaround.addItem(giveTo.getInventory(), true, true, stack);
giveTo.updateInventory();
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java
index 0d30b4e77..5f9e80ed9 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java
@@ -72,7 +72,7 @@ public class Commanditem extends EssentialsCommand
final String displayName = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace('_', ' ');
user.sendMessage(_("itemSpawn", stack.getAmount(), displayName));
- InventoryWorkaround.addItem(user.getInventory(), true, true, ess, stack);
+ InventoryWorkaround.addItem(user.getInventory(), true, true, stack);
user.updateInventory();
}
}