2011-01-09 18:27:46 +01:00
|
|
|
package net.minecraft.server;
|
|
|
|
|
2011-01-11 09:25:13 +01:00
|
|
|
public class InventoryLargeChest implements IInventory {
|
2011-01-09 18:27:46 +01:00
|
|
|
|
|
|
|
private String a;
|
|
|
|
private IInventory b;
|
|
|
|
private IInventory c;
|
2011-01-11 09:25:13 +01:00
|
|
|
|
2011-01-09 18:27:46 +01:00
|
|
|
// CraftBukkit start
|
|
|
|
public ItemStack[] getContents() {
|
2011-01-14 14:31:10 +01:00
|
|
|
ItemStack[] result = new ItemStack[h_()];
|
2011-01-09 18:27:46 +01:00
|
|
|
for (int i = 0; i < result.length; i++) {
|
|
|
|
result[i] = a(i);
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
|
|
|
|
public InventoryLargeChest(String s, IInventory iinventory, IInventory iinventory1) {
|
|
|
|
a = s;
|
|
|
|
b = iinventory;
|
|
|
|
c = iinventory1;
|
|
|
|
}
|
|
|
|
|
2011-01-14 14:31:10 +01:00
|
|
|
public int h_() {
|
|
|
|
return b.h_() + c.h_();
|
2011-01-09 18:27:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public String b() {
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ItemStack a(int i) {
|
2011-01-14 14:31:10 +01:00
|
|
|
if (i >= b.h_()) {
|
|
|
|
return c.a(i - b.h_());
|
2011-01-09 18:27:46 +01:00
|
|
|
} else {
|
|
|
|
return b.a(i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-14 14:31:10 +01:00
|
|
|
public ItemStack b(int i, int j) {
|
|
|
|
if (i >= b.h_()) {
|
|
|
|
return c.b(i - b.h_(), j);
|
2011-01-09 18:27:46 +01:00
|
|
|
} else {
|
2011-01-14 14:31:10 +01:00
|
|
|
return b.b(i, j);
|
2011-01-09 18:27:46 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void a(int i, ItemStack itemstack) {
|
2011-01-14 14:31:10 +01:00
|
|
|
if (i >= b.h_()) {
|
|
|
|
c.a(i - b.h_(), itemstack);
|
2011-01-09 18:27:46 +01:00
|
|
|
} else {
|
|
|
|
b.a(i, itemstack);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public int c() {
|
|
|
|
return b.c();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void d() {
|
|
|
|
b.d();
|
|
|
|
c.d();
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean a_(EntityPlayer entityplayer) {
|
|
|
|
return b.a_(entityplayer) && c.a_(entityplayer);
|
|
|
|
}
|
|
|
|
}
|