summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/ContainerChest.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/minecraft/server/ContainerChest.java')
-rw-r--r--src/main/java/net/minecraft/server/ContainerChest.java30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/main/java/net/minecraft/server/ContainerChest.java b/src/main/java/net/minecraft/server/ContainerChest.java
index 86270600..6f3c93ac 100644
--- a/src/main/java/net/minecraft/server/ContainerChest.java
+++ b/src/main/java/net/minecraft/server/ContainerChest.java
@@ -8,7 +8,7 @@ import org.bukkit.craftbukkit.inventory.CraftInventoryView;
public class ContainerChest extends Container {
public IInventory container; // CraftBukkit - private->public
- private int b;
+ private int f;
// CraftBukkit start
private CraftInventoryView bukkitEntity = null;
private PlayerInventory player;
@@ -17,6 +17,7 @@ public class ContainerChest extends Container {
if (bukkitEntity != null) {
return bukkitEntity;
}
+
CraftInventory inventory;
if (this.container instanceof PlayerInventory) {
inventory = new org.bukkit.craftbukkit.inventory.CraftInventoryPlayer((PlayerInventory) this.container);
@@ -25,6 +26,7 @@ public class ContainerChest extends Container {
} else {
inventory = new CraftInventory(this.container);
}
+
bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), inventory, this);
return bukkitEntity;
}
@@ -32,9 +34,9 @@ public class ContainerChest extends Container {
public ContainerChest(IInventory iinventory, IInventory iinventory1) {
this.container = iinventory1;
- this.b = iinventory1.getSize() / 9;
- iinventory1.f();
- int i = (this.b - 4) * 18;
+ this.f = iinventory1.getSize() / 9;
+ iinventory1.startOpen();
+ int i = (this.f - 4) * 18;
// CraftBukkit start - save player
// TODO: Should we check to make sure it really is an InventoryPlayer?
this.player = (PlayerInventory)iinventory;
@@ -43,7 +45,7 @@ public class ContainerChest extends Container {
int j;
int k;
- for (j = 0; j < this.b; ++j) {
+ for (j = 0; j < this.f; ++j) {
for (k = 0; k < 9; ++k) {
this.a(new Slot(iinventory1, k + j * 9, 8 + k * 18, 18 + j * 18));
}
@@ -60,31 +62,31 @@ public class ContainerChest extends Container {
}
}
- public boolean b(EntityHuman entityhuman) {
+ public boolean c(EntityHuman entityhuman) {
if (!this.checkReachable) return true; // CraftBukkit
return this.container.a(entityhuman);
}
- public ItemStack a(int i) {
+ public ItemStack b(int i) {
ItemStack itemstack = null;
- Slot slot = (Slot) this.e.get(i);
+ Slot slot = (Slot) this.b.get(i);
- if (slot != null && slot.c()) {
+ if (slot != null && slot.d()) {
ItemStack itemstack1 = slot.getItem();
itemstack = itemstack1.cloneItemStack();
- if (i < this.b * 9) {
- if (!this.a(itemstack1, this.b * 9, this.e.size(), true)) {
+ if (i < this.f * 9) {
+ if (!this.a(itemstack1, this.f * 9, this.b.size(), true)) {
return null;
}
- } else if (!this.a(itemstack1, 0, this.b * 9, false)) {
+ } else if (!this.a(itemstack1, 0, this.f * 9, false)) {
return null;
}
if (itemstack1.count == 0) {
slot.set((ItemStack) null);
} else {
- slot.d();
+ slot.e();
}
}
@@ -93,6 +95,6 @@ public class ContainerChest extends Container {
public void a(EntityHuman entityhuman) {
super.a(entityhuman);
- this.container.g();
+ this.container.f();
}
}