Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
1package net.minecraft.server;
2
3public class InventoryLargeChest implements IInventory {
4
5 private String a;
6 private IInventory b;
7 private IInventory c;
8
9 // CraftBukkit start
10 public ItemStack[] getContents() {
11 ItemStack[] result = new ItemStack[this.getSize()];
12 for (int i = 0; i < result.length; i++) {
13 result[i] = this.getItem(i);
14 }
15 return result;
16 }
17 // CraftBukkit end
18
19 public InventoryLargeChest(String s, IInventory iinventory, IInventory iinventory1) {
20 this.a = s;
21 this.b = iinventory;
22 this.c = iinventory1;
23 }
24
25 public int getSize() {
26 return this.b.getSize() + this.c.getSize();
27 }
28
29 public String getName() {
30 return this.a;
31 }
32
33 public ItemStack getItem(int i) {
34 return i >= this.b.getSize() ? this.c.getItem(i - this.b.getSize()) : this.b.getItem(i);
35 }
36
37 public ItemStack splitStack(int i, int j) {
38 return i >= this.b.getSize() ? this.c.splitStack(i - this.b.getSize(), j) : this.b.splitStack(i, j);
39 }
40
41 public void setItem(int i, ItemStack itemstack) {
42 if (i >= this.b.getSize()) {
43 this.c.setItem(i - this.b.getSize(), itemstack);
44 } else {
45 this.b.setItem(i, itemstack);
46 }
47 }
48
49 public int getMaxStackSize() {
50 return this.b.getMaxStackSize();
51 }
52
53 public void update() {
54 this.b.update();
55 this.c.update();
56 }
57
58 public boolean a_(EntityHuman entityhuman) {
59 return this.b.a_(entityhuman) && this.c.a_(entityhuman);
60 }
61}