Search in sources :

Example 1 with DoubleChestInventory

use of cn.nukkit.inventory.DoubleChestInventory in project Nukkit by Nukkit.

the class BlockEntityChest method checkPairing.

protected void checkPairing() {
    BlockEntityChest pair = this.getPair();
    if (pair != null) {
        if (!pair.isPaired()) {
            pair.createPair(this);
            pair.checkPairing();
        }
        if (this.doubleInventory == null) {
            if ((pair.x + ((int) pair.z << 15)) > (this.x + ((int) this.z << 15))) {
                // Order them correctly
                this.doubleInventory = new DoubleChestInventory(pair, this);
            } else {
                this.doubleInventory = new DoubleChestInventory(this, pair);
            }
        }
    } else {
        this.doubleInventory = null;
        this.namedTag.remove("pairx");
        this.namedTag.remove("pairz");
    }
}
Also used : DoubleChestInventory(cn.nukkit.inventory.DoubleChestInventory)

Aggregations

DoubleChestInventory (cn.nukkit.inventory.DoubleChestInventory)1