Paper/src/main/java/net/minecraft/server/InventoryLargeChest.java

62 Zeilen
1.4 KiB
Java

2011-01-29 22:50:29 +01:00
package net.minecraft.server;
public class InventoryLargeChest implements IInventory {
private String a;
private IInventory b;
private IInventory c;
// CraftBukkit start
public ItemStack[] getContents() {
2011-03-31 22:40:00 +02:00
ItemStack[] result = new ItemStack[q_()];
2011-01-29 22:50:29 +01:00
for (int i = 0; i < result.length; i++) {
2011-02-23 03:37:56 +01:00
result[i] = c_(i);
2011-01-29 22:50:29 +01:00
}
return result;
}
// CraftBukkit end
public InventoryLargeChest(String s, IInventory iinventory, IInventory iinventory1) {
this.a = s;
this.b = iinventory;
this.c = iinventory1;
}
2011-03-31 22:40:00 +02:00
public int q_() {
return this.b.q_() + this.c.q_();
2011-01-29 22:50:29 +01:00
}
2011-02-23 03:37:56 +01:00
public String c() {
2011-01-29 22:50:29 +01:00
return this.a;
}
2011-02-23 03:37:56 +01:00
public ItemStack c_(int i) {
2011-03-31 22:40:00 +02:00
return i >= this.b.q_() ? this.c.c_(i - this.b.q_()) : this.b.c_(i);
2011-01-29 22:50:29 +01:00
}
2011-02-23 03:37:56 +01:00
public ItemStack a(int i, int j) {
2011-03-31 22:40:00 +02:00
return i >= this.b.q_() ? this.c.a(i - this.b.q_(), j) : this.b.a(i, j);
2011-01-29 22:50:29 +01:00
}
public void a(int i, ItemStack itemstack) {
2011-03-31 22:40:00 +02:00
if (i >= this.b.q_()) {
this.c.a(i - this.b.q_(), itemstack);
2011-01-29 22:50:29 +01:00
} else {
this.b.a(i, itemstack);
}
}
2011-03-31 22:40:00 +02:00
public int r_() {
return this.b.r_();
2011-01-29 22:50:29 +01:00
}
2011-03-31 22:40:00 +02:00
public void i() {
this.b.i();
this.c.i();
2011-01-29 22:50:29 +01:00
}
public boolean a_(EntityHuman entityhuman) {
return this.b.a_(entityhuman) && this.c.a_(entityhuman);
}
}