diff options
-rw-r--r-- | Essentials/src/com/earth2me/essentials/InventoryWorkaround.java | 18 |
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; } } |