summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/InventoryLargeChest.java
blob: 60e008527c6340b1d909f540e617e0de012bd05c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package net.minecraft.server;

public class InventoryLargeChest implements IInventory {

    private String a;
    private IInventory b;
    private IInventory c;

    // CraftBukkit start
    public ItemStack[] getContents() {
        ItemStack[] result = new ItemStack[q_()];
        for (int i = 0; i < result.length; i++) {
            result[i] = c_(i);
        }
        return result;
    }
    // CraftBukkit end

    public InventoryLargeChest(String s, IInventory iinventory, IInventory iinventory1) {
        this.a = s;
        this.b = iinventory;
        this.c = iinventory1;
    }

    public int q_() {
        return this.b.q_() + this.c.q_();
    }

    public String c() {
        return this.a;
    }

    public ItemStack c_(int i) {
        return i >= this.b.q_() ? this.c.c_(i - this.b.q_()) : this.b.c_(i);
    }

    public ItemStack a(int i, int j) {
        return i >= this.b.q_() ? this.c.a(i - this.b.q_(), j) : this.b.a(i, j);
    }

    public void a(int i, ItemStack itemstack) {
        if (i >= this.b.q_()) {
            this.c.a(i - this.b.q_(), itemstack);
        } else {
            this.b.a(i, itemstack);
        }
    }

    public int r_() {
        return this.b.r_();
    }

    public void i() {
        this.b.i();
        this.c.i();
    }

    public boolean a_(EntityHuman entityhuman) {
        return this.b.a_(entityhuman) && this.c.a_(entityhuman);
    }
}