summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/InventoryLargeChest.java
blob: a766cb4f3ebc409b45fb93ed1b4b338369634973 (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
62
63
64
65
66
67
68
69
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[h_()];
        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;
    }

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

    public String b() {
        return a;
    }

    public ItemStack a(int i) {
        if (i >= b.h_()) {
            return c.a(i - b.h_());
        } else {
            return b.a(i);
        }
    }

    public ItemStack b(int i, int j) {
        if (i >= b.h_()) {
            return c.b(i - b.h_(), j);
        } else {
            return b.b(i, j);
        }
    }

    public void a(int i, ItemStack itemstack) {
        if (i >= b.h_()) {
            c.a(i - b.h_(), itemstack);
        } 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);
    }
}