summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-11-27 22:36:32 +0100
committersnowleo <schneeleo@gmail.com>2011-11-27 22:36:32 +0100
commit6603d0997e9af60e80fa426e8acb40557c8b6b9d (patch)
tree34d419b06c4afafae89c744d317afedcb36b75bb
parentaceda4c680d11f456204cb42e72a4ef1940768e5 (diff)
downloadEssentials-6603d0997e9af60e80fa426e8acb40557c8b6b9d.tar
Essentials-6603d0997e9af60e80fa426e8acb40557c8b6b9d.tar.gz
Essentials-6603d0997e9af60e80fa426e8acb40557c8b6b9d.tar.lz
Essentials-6603d0997e9af60e80fa426e8acb40557c8b6b9d.tar.xz
Essentials-6603d0997e9af60e80fa426e8acb40557c8b6b9d.zip
Fix broken trade/buy signs because of a wrong cast
-rw-r--r--Essentials/src/com/earth2me/essentials/InventoryWorkaround.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/Essentials/src/com/earth2me/essentials/InventoryWorkaround.java b/Essentials/src/com/earth2me/essentials/InventoryWorkaround.java
index 4ce5cb52e..0b8121f89 100644
--- a/Essentials/src/com/earth2me/essentials/InventoryWorkaround.java
+++ b/Essentials/src/com/earth2me/essentials/InventoryWorkaround.java
@@ -151,13 +151,27 @@ public final class InventoryWorkaround
{
ItemStack stack = item.clone();
stack.setAmount(dontBreakStacks ? ess.getSettings().getDefaultStackSize() : item.getType().getMaxStackSize());
- EnchantmentFix.setItem(cinventory, firstFree, stack);
+ if (cinventory instanceof FakeInventory)
+ {
+ cinventory.setItem(firstFree, stack);
+ }
+ else
+ {
+ EnchantmentFix.setItem(cinventory, firstFree, stack);
+ }
item.setAmount(item.getAmount() - item.getType().getMaxStackSize());
}
else
{
// Just store it
- EnchantmentFix.setItem(cinventory, firstFree, item);
+ if (cinventory instanceof FakeInventory)
+ {
+ cinventory.setItem(firstFree, item);
+ }
+ else
+ {
+ EnchantmentFix.setItem(cinventory, firstFree, item);
+ }
break;
}
}