summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorTahg <tahgtahv@gmail.com>2011-02-05 00:02:09 -0500
committerTahg <tahgtahv@gmail.com>2011-02-05 00:02:09 -0500
commit2c798a9e9b193503f84e0d6dca12db9522a71ca0 (patch)
tree024e209f57fbf1a7c05c31685839d853d2805df9 /src/main/java
parentbe10e54235aa29d90ba52bc8fd98825081a68b13 (diff)
downloadcraftbukkit-2c798a9e9b193503f84e0d6dca12db9522a71ca0.tar
craftbukkit-2c798a9e9b193503f84e0d6dca12db9522a71ca0.tar.gz
craftbukkit-2c798a9e9b193503f84e0d6dca12db9522a71ca0.tar.lz
craftbukkit-2c798a9e9b193503f84e0d6dca12db9522a71ca0.tar.xz
craftbukkit-2c798a9e9b193503f84e0d6dca12db9522a71ca0.zip
Fix for multi-stack adds
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java2
-rw-r--r--src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
index 7ef2054c..06f485f3 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
@@ -209,7 +209,7 @@ public class CraftInventory implements org.bukkit.inventory.Inventory {
} else {
// More than a single stack!
if (item.getAmount() > getMaxItemStack()) {
- setItem( firstFree, new CraftItemStack(item.getTypeId(), getMaxItemStack()));
+ setItem( firstFree, new CraftItemStack(item.getTypeId(), getMaxItemStack(), item.getDamage()));
item.setAmount(item.getAmount() - getMaxItemStack());
} else {
// Just store it
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index cecafa94..2f242af4 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -32,19 +32,19 @@ public class CraftItemStack extends ItemStack {
this(type.getId(), amount);
}
- public CraftItemStack(final int type, final int amount, final byte damage) {
+ public CraftItemStack(final int type, final int amount, final short damage) {
this(type, amount, damage, null);
}
- public CraftItemStack(final Material type, final int amount, final byte damage) {
+ public CraftItemStack(final Material type, final int amount, final short damage) {
this(type.getId(), amount, damage);
}
- public CraftItemStack(final Material type, final int amount, final byte damage, final Byte data) {
+ public CraftItemStack(final Material type, final int amount, final short damage, final Byte data) {
this(type.getId(), amount, damage, data);
}
- public CraftItemStack(int type, int amount, byte damage, Byte data) {
+ public CraftItemStack(int type, int amount, short damage, Byte data) {
this(new net.minecraft.server.ItemStack(type, amount, data != null ? data : damage));
}