use of net.minecraft.inventory.container.ShulkerBoxContainer in project Magma-1.16.x by magmafoundation.
the class CraftContainer method setupSlots.
private void setupSlots(IInventory top, PlayerInventory bottom, PlayerEntity entityhuman) {
int windowId = -1;
switch(cachedType) {
case CREATIVE:
// TODO: This should be an error?
break;
case PLAYER:
case CHEST:
case ENDER_CHEST:
case BARREL:
delegate = new ChestContainer(ContainerType.GENERIC_9x3, windowId, bottom, top, top.getContainerSize() / 9);
break;
case DISPENSER:
case DROPPER:
delegate = new DispenserContainer(windowId, bottom, top);
break;
case FURNACE:
delegate = new FurnaceContainer(windowId, bottom, top, new IntArray(4));
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 EnchantmentContainer(windowId, bottom);
break;
case BREWING:
delegate = new BrewingStandContainer(windowId, bottom, top, new IntArray(2));
break;
case HOPPER:
delegate = new HopperContainer(windowId, bottom, top);
break;
case ANVIL:
delegate = new RepairContainer(windowId, bottom);
break;
case SMITHING:
delegate = new SmokerContainer(windowId, bottom);
break;
case BEACON:
delegate = new BeaconContainer(windowId, bottom);
break;
case SHULKER_BOX:
delegate = new ShulkerBoxContainer(windowId, bottom, top);
break;
case BLAST_FURNACE:
delegate = new BlastFurnaceContainer(windowId, bottom, top, new IntArray(4));
break;
case LECTERN:
delegate = new LecternContainer(windowId, top, new IntArray(1), bottom);
break;
case SMOKER:
delegate = new SmokerContainer(windowId, bottom, top, new IntArray(4));
break;
case LOOM:
delegate = new LoomContainer(windowId, bottom);
break;
case CARTOGRAPHY:
delegate = new CartographyContainer(windowId, bottom);
break;
case GRINDSTONE:
delegate = new GrindstoneContainer(windowId, bottom);
break;
case STONECUTTER:
delegate = new StonecutterContainer(windowId, bottom);
break;
case MERCHANT:
delegate = new MerchantContainer(windowId, bottom);
break;
}
if (delegate != null) {
this.lastSlots = delegate.lastSlots;
this.slots = delegate.slots;
}
// SPIGOT-4598 - we should still delegate the shift click handler
if (cachedType == InventoryType.WORKBENCH) {
delegate = new WorkbenchContainer(windowId, bottom);
}
}
use of net.minecraft.inventory.container.ShulkerBoxContainer in project LoliServer by Loli-Server.
the class CraftContainer method setupSlots.
private void setupSlots(IInventory top, PlayerInventory bottom, PlayerEntity entityhuman) {
int windowId = -1;
switch(cachedType) {
case CREATIVE:
// TODO: This should be an error?
break;
case PLAYER:
case CHEST:
case ENDER_CHEST:
case BARREL:
delegate = new ChestContainer(ContainerType.GENERIC_9x3, windowId, bottom, top, top.getContainerSize() / 9);
break;
case DISPENSER:
case DROPPER:
delegate = new DispenserContainer(windowId, bottom, top);
break;
case FURNACE:
delegate = new FurnaceContainer(windowId, bottom, top, new IntArray(4));
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 EnchantmentContainer(windowId, bottom);
break;
case BREWING:
delegate = new BrewingStandContainer(windowId, bottom, top, new IntArray(2));
break;
case HOPPER:
delegate = new HopperContainer(windowId, bottom, top);
break;
case ANVIL:
delegate = new RepairContainer(windowId, bottom);
break;
case SMITHING:
delegate = new SmokerContainer(windowId, bottom);
break;
case BEACON:
delegate = new BeaconContainer(windowId, bottom);
break;
case SHULKER_BOX:
delegate = new ShulkerBoxContainer(windowId, bottom, top);
break;
case BLAST_FURNACE:
delegate = new BlastFurnaceContainer(windowId, bottom, top, new IntArray(4));
break;
case LECTERN:
delegate = new LecternContainer(windowId, top, new IntArray(1), bottom);
break;
case SMOKER:
delegate = new SmokerContainer(windowId, bottom, top, new IntArray(4));
break;
case LOOM:
delegate = new LoomContainer(windowId, bottom);
break;
case CARTOGRAPHY:
delegate = new CartographyContainer(windowId, bottom);
break;
case GRINDSTONE:
delegate = new GrindstoneContainer(windowId, bottom);
break;
case STONECUTTER:
delegate = new StonecutterContainer(windowId, bottom);
break;
case MERCHANT:
delegate = new MerchantContainer(windowId, bottom);
break;
}
if (delegate != null) {
this.lastSlots = delegate.lastSlots;
this.slots = delegate.slots;
}
// SPIGOT-4598 - we should still delegate the shift click handler
if (cachedType == InventoryType.WORKBENCH) {
delegate = new WorkbenchContainer(windowId, bottom);
}
}
Aggregations