Don't use broken CB methods ...

This commit is contained in:
snowleo 2012-12-20 16:07:18 +01:00 committed by KHobbits
parent 3ac6cc11e3
commit dc13f46ff1

View File

@ -16,7 +16,7 @@ public final class InventoryWorkaround
{ {
} }
public static int firstPartial(final Inventory inventory, final ItemStack item, final int maxAmount) private static int firstPartial(final Inventory inventory, final ItemStack item, final int maxAmount)
{ {
if (item == null) if (item == null)
{ {
@ -38,9 +38,9 @@ public final class InventoryWorkaround
{ {
final Inventory fakeInventory = Bukkit.getServer().createInventory(null, inventory.getType()); final Inventory fakeInventory = Bukkit.getServer().createInventory(null, inventory.getType());
fakeInventory.setContents(inventory.getContents()); fakeInventory.setContents(inventory.getContents());
if (fakeInventory.addItem(items).isEmpty()) if (addItems(fakeInventory, items).isEmpty())
{ {
inventory.addItem(items); addItems(inventory, items);
return true; return true;
} }
return false; return false;