From 6c09066e224ac85b8a6464eaf8f53edfeb4beda4 Mon Sep 17 00:00:00 2001 From: Nate Mortensen Date: Mon, 1 Jul 2013 06:03:00 -0500 Subject: Update CraftBukkit to 1.6.1 --- src/main/java/net/minecraft/server/Container.java | 33 +++++++++++------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'src/main/java/net/minecraft/server/Container.java') diff --git a/src/main/java/net/minecraft/server/Container.java b/src/main/java/net/minecraft/server/Container.java index bb4c41aa..8092047f 100644 --- a/src/main/java/net/minecraft/server/Container.java +++ b/src/main/java/net/minecraft/server/Container.java @@ -20,10 +20,9 @@ public abstract class Container { public List b = new ArrayList(); public List c = new ArrayList(); - public int windowId = 0; - private short a = 0; + public int windowId; private int f = -1; - public int g = 0; // CraftBukkit - private -> public + public int g; // CraftBukkit - private -> public private final Set h = new HashSet(); protected List listeners = new ArrayList(); private Set i = new HashSet(); @@ -151,7 +150,7 @@ public abstract class Container { if (slot1 != null && a(slot1, playerinventory.getCarried(), true) && slot1.isAllowed(playerinventory.getCarried()) && playerinventory.getCarried().count >= this.h.size() && this.b(slot1)) { ItemStack itemstack2 = itemstack1.cloneItemStack(); - int j1 = slot1.d() ? slot1.getItem().count : 0; + int j1 = slot1.e() ? slot1.getItem().count : 0; a(this.h, this.f, itemstack2, j1); if (itemstack2.count > itemstack2.getMaxStackSize()) { @@ -276,11 +275,9 @@ public abstract class Container { k1 = slot2.a(); } - // CraftBukkit start if (itemstack4.count >= k1) { slot2.set(itemstack4.a(k1)); } - // CraftBukkit end if (itemstack4.count == 0) { playerinventory.setCarried((ItemStack) null); @@ -331,7 +328,7 @@ public abstract class Container { } } - slot2.e(); + slot2.f(); } } } else if (k == 2 && j >= 0 && j < 9) { @@ -346,7 +343,7 @@ public abstract class Container { flag |= k1 > -1; } - if (slot2.d() && flag) { + if (slot2.e() && flag) { itemstack3 = slot2.getItem(); playerinventory.setItem(j, itemstack3.cloneItemStack()); if ((slot2.inventory != playerinventory || !slot2.isAllowed(itemstack1)) && itemstack1 != null) { @@ -361,21 +358,21 @@ public abstract class Container { slot2.set(itemstack1); slot2.a(entityhuman, itemstack3); } - } else if (!slot2.d() && itemstack1 != null && slot2.isAllowed(itemstack1)) { + } else if (!slot2.e() && itemstack1 != null && slot2.isAllowed(itemstack1)) { playerinventory.setItem(j, (ItemStack) null); slot2.set(itemstack1); } } } else if (k == 3 && entityhuman.abilities.canInstantlyBuild && playerinventory.getCarried() == null && i >= 0) { slot2 = (Slot) this.c.get(i); - if (slot2 != null && slot2.d()) { + if (slot2 != null && slot2.e()) { itemstack1 = slot2.getItem().cloneItemStack(); itemstack1.count = itemstack1.getMaxStackSize(); playerinventory.setCarried(itemstack1); } } else if (k == 4 && playerinventory.getCarried() == null && i >= 0) { slot2 = (Slot) this.c.get(i); - if (slot2 != null && slot2.d() && slot2.a(entityhuman)) { + if (slot2 != null && slot2.e() && slot2.a(entityhuman)) { itemstack1 = slot2.a(j == 0 ? 1 : slot2.getItem().count); slot2.a(entityhuman, itemstack1); entityhuman.drop(itemstack1); @@ -383,7 +380,7 @@ public abstract class Container { } else if (k == 6 && i >= 0) { slot2 = (Slot) this.c.get(i); itemstack1 = playerinventory.getCarried(); - if (itemstack1 != null && (slot2 == null || !slot2.d() || !slot2.a(entityhuman))) { + if (itemstack1 != null && (slot2 == null || !slot2.e() || !slot2.a(entityhuman))) { l = j == 0 ? 0 : this.c.size() - 1; k1 = j == 0 ? 1 : -1; @@ -391,7 +388,7 @@ public abstract class Container { for (int i2 = l; i2 >= 0 && i2 < this.c.size() && itemstack1.count < itemstack1.getMaxStackSize(); i2 += k1) { Slot slot3 = (Slot) this.c.get(i2); - if (slot3.d() && a(slot3, itemstack1, true) && slot3.a(entityhuman) && this.a(itemstack1, slot3) && (l1 != 0 || slot3.getItem().count != slot3.getItem().getMaxStackSize())) { + if (slot3.e() && a(slot3, itemstack1, true) && slot3.a(entityhuman) && this.a(itemstack1, slot3) && (l1 != 0 || slot3.getItem().count != slot3.getItem().getMaxStackSize())) { int j2 = Math.min(itemstack1.getMaxStackSize() - itemstack1.count, slot3.getItem().count); ItemStack itemstack5 = slot3.a(j2); @@ -473,12 +470,12 @@ public abstract class Container { if (l <= itemstack.getMaxStackSize()) { itemstack.count = 0; itemstack1.count = l; - slot.e(); + slot.f(); flag1 = true; } else if (itemstack1.count < itemstack.getMaxStackSize()) { itemstack.count -= itemstack.getMaxStackSize() - itemstack1.count; itemstack1.count = itemstack.getMaxStackSize(); - slot.e(); + slot.f(); flag1 = true; } } @@ -503,7 +500,7 @@ public abstract class Container { itemstack1 = slot.getItem(); if (itemstack1 == null) { slot.set(itemstack.cloneItemStack()); - slot.e(); + slot.f(); itemstack.count = 0; flag1 = true; break; @@ -538,9 +535,9 @@ public abstract class Container { } public static boolean a(Slot slot, ItemStack itemstack, boolean flag) { - boolean flag1 = slot == null || !slot.d(); + boolean flag1 = slot == null || !slot.e(); - if (slot != null && slot.d() && itemstack != null && itemstack.doMaterialsMatch(slot.getItem()) && ItemStack.equals(slot.getItem(), itemstack)) { + if (slot != null && slot.e() && itemstack != null && itemstack.doMaterialsMatch(slot.getItem()) && ItemStack.equals(slot.getItem(), itemstack)) { int i = flag ? 0 : itemstack.count; flag1 |= slot.getItem().count + i <= itemstack.getMaxStackSize(); -- cgit v1.2.3