Search in sources :

Example 1 with ContainerDispenser

use of net.minecraft.server.v1_12_R1.ContainerDispenser in project PaperDev by Kamillaova.

the class CraftContainer method setupSlots.

private void setupSlots(IInventory top, PlayerInventory bottom, EntityHuman entityhuman) {
    switch(cachedType) {
        case CREATIVE:
            // TODO: This should be an error?
            break;
        case PLAYER:
        case CHEST:
            delegate = new ContainerChest(bottom, top, entityhuman);
            break;
        case DISPENSER:
        case DROPPER:
            delegate = new ContainerDispenser(bottom, top);
            break;
        case FURNACE:
            delegate = new ContainerFurnace(bottom, top);
            break;
        // TODO: This should be an error?
        case CRAFTING:
        case WORKBENCH:
            // SPIGOT-3812 - manually set up slots so we can use the delegated inventory and not the automatically created one
            setupWorkbench(top, bottom);
            break;
        case ENCHANTING:
            delegate = new ContainerEnchantTable(bottom, entityhuman.world, entityhuman.getChunkCoordinates());
            break;
        case BREWING:
            delegate = new ContainerBrewingStand(bottom, top);
            break;
        case HOPPER:
            delegate = new ContainerHopper(bottom, top, entityhuman);
            break;
        case ANVIL:
            delegate = new ContainerAnvil(bottom, entityhuman.world, entityhuman.getChunkCoordinates(), entityhuman);
            break;
        case BEACON:
            delegate = new ContainerBeacon(bottom, top);
            break;
        case SHULKER_BOX:
            delegate = new ContainerShulkerBox(bottom, top, entityhuman);
            break;
    }
    if (delegate != null) {
        this.items = delegate.items;
        this.slots = delegate.slots;
    }
}
Also used : ContainerDispenser(net.minecraft.server.v1_12_R1.ContainerDispenser) ContainerFurnace(net.minecraft.server.v1_12_R1.ContainerFurnace) ContainerEnchantTable(net.minecraft.server.v1_12_R1.ContainerEnchantTable) ContainerAnvil(net.minecraft.server.v1_12_R1.ContainerAnvil) ContainerShulkerBox(net.minecraft.server.v1_12_R1.ContainerShulkerBox) ContainerChest(net.minecraft.server.v1_12_R1.ContainerChest) ContainerHopper(net.minecraft.server.v1_12_R1.ContainerHopper) ContainerBeacon(net.minecraft.server.v1_12_R1.ContainerBeacon) ContainerBrewingStand(net.minecraft.server.v1_12_R1.ContainerBrewingStand)

Aggregations

ContainerAnvil (net.minecraft.server.v1_12_R1.ContainerAnvil)1 ContainerBeacon (net.minecraft.server.v1_12_R1.ContainerBeacon)1 ContainerBrewingStand (net.minecraft.server.v1_12_R1.ContainerBrewingStand)1 ContainerChest (net.minecraft.server.v1_12_R1.ContainerChest)1 ContainerDispenser (net.minecraft.server.v1_12_R1.ContainerDispenser)1 ContainerEnchantTable (net.minecraft.server.v1_12_R1.ContainerEnchantTable)1 ContainerFurnace (net.minecraft.server.v1_12_R1.ContainerFurnace)1 ContainerHopper (net.minecraft.server.v1_12_R1.ContainerHopper)1 ContainerShulkerBox (net.minecraft.server.v1_12_R1.ContainerShulkerBox)1