public GuiPatternChest(InventoryPlayer playerInv, World world, BlockPos pos, TilePatternChest tile) { super(world, pos, (ContainerTinkerStation<TilePatternChest>) tile.createContainer(playerInv, world, pos)); // we use the sideinventory class for the inventory itself // it doesn't contain the player inventory guiInventory = new GuiScalingChest(this, container.getSubContainer(ContainerPatternChest.DynamicChestInventory.class)); addModule(guiInventory); }
ItemStack itemstack = slot.getStack().copy(); Container container = getSlotContainer(index); boolean nothingDone = true; nothingDone &= moveToTileInventory(itemstack); nothingDone &= moveToPlayerInventory(itemstack); nothingDone &= refillAnyContainer(itemstack, subContainers); nothingDone &= moveToPlayerInventory(itemstack); nothingDone &= moveToAnyContainer(itemstack, subContainers); nothingDone &= moveToTileInventory(itemstack); nothingDone &= moveToAnyContainer(itemstack, subContainers); return notifySlotAfterTransfer(playerIn, itemstack, ret, slot);
protected void drawContainerName() { ContainerMultiModule multiContainer = (ContainerMultiModule) this.inventorySlots; String localizedName = multiContainer.getInventoryDisplayName(); if(localizedName != null) { this.fontRenderer.drawString(localizedName, 8, 6, 0x404040); } }
/** Searches for a sidechest to display in the UI */ public <TE extends TileEntity> TE detectTE(Class<TE> clazz) { return ObjectUtils.firstNonNull(detectChest(this.pos.north(), clazz), detectChest(this.pos.east(), clazz), detectChest(this.pos.south(), clazz), detectChest(this.pos.west(), clazz)); }
protected boolean moveToAnyContainer(@Nonnull ItemStack itemstack, Collection<Container> containers) { if(itemstack.isEmpty()) { return false; } for(Container submodule : containers) { if(moveToContainer(itemstack, submodule)) { return true; } } return false; }
protected boolean refillContainer(@Nonnull ItemStack itemstack, Container container) { Pair<Integer, Integer> range = subContainerSlotRanges.get(container); return !this.mergeItemStackRefill(itemstack, range.getLeft(), range.getRight(), false); }
protected GuiModule getModuleForSlot(int slotNumber) { return getModuleForContainer(getContainer().getSlotContainer(slotNumber)); }
info.setCaption(container.getInventoryDisplayName()); info.setText(I18n.translateToLocal("gui.partbuilder.info"));
public GuiPartChest(InventoryPlayer playerInv, World world, BlockPos pos, TilePartChest tile) { super(world, pos, (ContainerTinkerStation) tile.createContainer(playerInv, world, pos)); // we use the sideinventory class for the inventory itself // it doesn't contain the player inventory guiInventory = new GuiScalingChest(this, container.getSubContainer(ContainerPartChest.DynamicChestInventory.class)); addModule(guiInventory); }
public <TC extends Container> TC getSubContainer(Class<TC> clazz) { return getSubContainer(clazz, 0); }