private boolean isStackValidForSlot(int index, @Nonnull ItemStack stack) { if (!slotChecksEnabled) return true; if (type.isOutputSlot(index)) { return false; } else if (type.isInputSlot(index)) { return true; } else { return TileEntityFurnace.isItemFuel(stack) || SlotFurnaceFuel.isBucket(stack); } }
/** * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. For * guis use Slot.isItemValid */ public boolean isItemValidForSlot(int index, ItemStack stack) { if (index == 2) { return false; } else if (index != 1) { return true; } else { ItemStack itemstack = (ItemStack)this.furnaceItemStacks.get(1); return isItemFuel(stack) || SlotFurnaceFuel.isBucket(stack) && itemstack.getItem() != Items.BUCKET; } }
public ContainerAmmoFurnace(InventoryPlayer playerInventory, IInventory furnaceInventory) { this.tileFurnace = furnaceInventory; for (int i = 0; i < 9; i++) this.addSlotToContainer(new Slot(furnaceInventory, i, 9 + (i % 3) * 18, 17 + (i / 3) * 18)); this.addSlotToContainer(new SlotFurnaceFuel(furnaceInventory, 9, 80, 53)); for (int i = 0; i < 9; i++) this.addSlotToContainer(new SlotFurnaceOutput(playerInventory.player, furnaceInventory, i + 10, 116 + (i % 3) * 18, 17 + (i / 3) * 18)); for (int i = 0; i < 3; ++i) for (int j = 0; j < 9; ++j) this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); for (int k = 0; k < 9; ++k) this.addSlotToContainer(new Slot(playerInventory, k, 8 + k * 18, 142)); }
/** * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. For * guis use Slot.isItemValid */ public boolean isItemValidForSlot(int index, ItemStack stack) { if (index == 2) { return false; } else if (index != 1) { return true; } else { ItemStack itemstack = this.furnaceItemStacks[1]; return isItemFuel(stack) || SlotFurnaceFuel.isBucket(stack) && (itemstack == null || itemstack.getItem() != Items.BUCKET); } }
public ContainerAlloyFurnace(InventoryPlayer p_i45794_1_, IInventory furnaceInventory) { this.tileFurnace = furnaceInventory; this.addSlotToContainer(new Slot(furnaceInventory, 0, 35, 17)); this.addSlotToContainer(new Slot(furnaceInventory, 1, 53, 17)); this.addSlotToContainer(new SlotFurnaceFuel(furnaceInventory, 2, 44, 53)); this.addSlotToContainer(new SlotFurnaceOutput(p_i45794_1_.player, furnaceInventory, 3, 116, 35)); int i; for (i = 0; i < 3; ++i) { for (int j = 0; j < 9; ++j) { this.addSlotToContainer(new Slot(p_i45794_1_, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } for (i = 0; i < 9; ++i) { this.addSlotToContainer(new Slot(p_i45794_1_, i, 8 + i * 18, 142)); } }
private void addSlots() { this.addSlotToContainer(new Slot(tileFurnace, 0, 56, 17)); this.addSlotToContainer(new SlotFurnaceFuel(tileFurnace, 1, 56, 53)); this.addSlotToContainer(new SlotFurnaceOutput(playerInventory.player, tileFurnace, 2, 116, 35)); // Adds the player inventory to furnace's gui. for (int y = 0; y < 3; y++) { for (int x = 0; x < 9; x++) { this.addSlotToContainer(new Slot(playerInventory, x + y * 9 + 9, 8 + x * 18, 84 + y * 18)); } } // Adds the player hotbar slots to the gui. for (int i = 0; i < 9; i++) { this.addSlotToContainer(new Slot(playerInventory, i, 8 + i * 18, 142)); // 198 } }
public ContainerFurnace(InventoryPlayer inventory, IInventory te) { this.furnace = te; this.addSlotToContainer(new Slot(te, 0, 56, 17)); this.addSlotToContainer(new SlotFurnaceFuel(te, 1, 56, 53)); this.addSlotToContainer(new SlotFurnaceOutput(inventory.player, te, 2, 116, 35)); int i; for(i = 0; i < 3; i++) { for(int j = 0; j < 9; j++) { this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } for(i = 0; i < 9; i++) { this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); } }
/** * Returns true if automation is allowed to insert the given stack (ignoring * stack size) into the given slot. */ @Override public boolean isItemValidForSlot(int index, ItemStack stack) { if (index > 9) return false; else if (index != 9) return true; else { ItemStack itemstack = this.furnaceItemStacks.get(9); return isItemFuel(stack) || SlotFurnaceFuel.isBucket(stack) && (itemstack.isEmpty() || itemstack.getItem() != Items.BUCKET); } }
public ContainerRefinery(InventoryPlayer playerInv, TileEntityRefinery te) { this.te = te; sync = new FluidSynchronizer(() -> te.getTankIn().getFluid(), () -> te.getTankOut1().getFluid(), () -> te.getTankOut2().getFluid(), () -> te.getTankOut3().getFluid()); addSlotToContainer(new SlotFurnaceFuel(te, 0, 49, 63)); addSlotToContainer(new SlotFurnaceFuel(te, 1, 30, 27)); addSlotToContainer(new SlotFurnaceFuel(te, 2, 30, 45)); addSlotToContainer(new SlotFurnaceFuel(te, 3, 30, 63)); addPlayerSlots(playerInv, 8, 94); }
public ContainerFurnaceGenerator(InventoryPlayer inv, TileFurnaceGenerator generator){ this.generator = generator; addSlotToContainer(new SlotItemHandler(generator, 0, 80, 34){ @Override public boolean isItemValid(ItemStack stack) { return SlotFurnaceFuel.isBucket(stack) || TileEntityFurnace.isItemFuel(stack); } }); // Nice and centered :P for(int i = 0; i<3; ++i) for(int j = 0; j<9; ++j) addSlotToContainer(new Slot(inv, j+i*9+9, 8+j*18, 84+i*18)); for(int i = 0; i<9; ++i) addSlotToContainer(new Slot(inv, i, 8+i*18, 142)); }
public ContainerFractionalDistiller(InventoryPlayer inventoryPlayer, TileEntityFractionalDistillation fractionaldistiller) { this.fractionaldistiller = fractionaldistiller; lastValue = new int[this.fractionaldistiller.getFieldCount()]; addSlotToContainer(new SlotFurnaceFuel(fractionaldistiller, 0, 80, 108)); addSlotToContainer(new SlotFractionalDistllerBucket(fractionaldistiller, 1, 126, 90)); if (fractionaldistiller.hasSlot(2)) { addSlotToContainer(new SlotFractionalDistllerBucket(fractionaldistiller, 2, 126, 66)); isSlot3Active = true; } if (fractionaldistiller.hasSlot(3)) { addSlotToContainer(new SlotFractionalDistllerBucket(fractionaldistiller, 3, 126, 48)); isSlot3Active = true; } if (fractionaldistiller.hasSlot(4)) { addSlotToContainer(new SlotFractionalDistllerBucket(fractionaldistiller, 4, 126, 30)); isSlot4Active = true; } if (fractionaldistiller.hasSlot(5)) { addSlotToContainer(new SlotFractionalDistllerBucket(fractionaldistiller, 5, 126, 12)); isSlot5Active = true; } // // for (int i = 0; i < 1; i++) { // for (int j = 0; j < 1; j++) { // addSlotToContainer(new Slot(fractionaldistiller, j + i * 9, 8 + j * 18, 18 + i * 18)); // } // } // commonly used vanilla code that adds the player's inventory bindPlayerInventory(inventoryPlayer); }
public ContainerDistiller(InventoryPlayer inventoryPlayer, TileEntityDistiller distiller) { this.distiller = distiller; lastFuelStorage = -1; lastRemainBurnTime = -1; for (int i = 0; i < 1; i++) { for (int j = 0; j < 1; j++) { addSlotToContainer(new SlotFurnaceFuel(distiller, j + i * 9, 8 + j * 18, 18 + i * 18)); } } // commonly used vanilla code that adds the player's inventory bindPlayerInventory(inventoryPlayer); }
public CSteamFurnace(InventoryPlayer playerInv, IInventory furnaceInv) { this.furnaceInv = furnaceInv; this.addSlotToContainer(new SlotFurnaceFuel(furnaceInv, 0, 80, 41)); this.addSlotToContainer(new SLimitedSlot(new Item[] { Items.bucket, Items.water_bucket }, 1, furnaceInv, 1, 26, 61)); int i, j; for (i = 0; i < 3; ++i) { for (j = 0; j < 9; ++j) { this.addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } for (i = 0; i < 9; ++i) { this.addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 142)); } }
@Override public boolean isItemValidForSlot(int slot, ItemStack stack) { if (slot == 2) return false; else if (slot != 1) return true; else { final ItemStack itemStack = slots.get(1); return isItemFuel(stack) || SlotFurnaceFuel.isBucket(stack) && (itemStack == ItemStack.EMPTY || itemStack.getItem() != Items.BUCKET); } }
/** * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. */ public boolean isItemValidForSlot(int index, ItemStack stack) { return index == 2 ? false : (index != 1 ? true : isItemFuel(stack) || SlotFurnaceFuel.isBucket(stack)); }
public boolean isItemValid(ItemStack stack) { return TileEntityFurnace.isItemFuel(stack) || SlotFurnaceFuel.isBucket(stack); }
public int getItemStackLimit(ItemStack stack) { return SlotFurnaceFuel.isBucket(stack) ? 1 : super.getItemStackLimit(stack); }
public ContainerBasicBoiler(InventoryPlayer playerInv, TileEntityBasicBoiler te) { this.te = te; sync = new FluidSynchronizer(() -> te.getTankWater().getFluid(), () -> te.getTankSteam().getFluid()); addSlotToContainer(new SlotFurnaceFuel(te.inv, 0, 43, 64)); addPlayerSlots(playerInv, 8, 94); }
public ContainerAdvBoiler(InventoryPlayer playerInv, TileEntityAdvBoiler te) { this.te = te; sync = new FluidSynchronizer(() -> te.getTankWater().getFluid(), () -> te.getTankSteam().getFluid()); addSlotToContainer(new SlotFurnaceFuel(te.inv, 0, 43, 64)); addPlayerSlots(playerInv, 8, 94); }
@Override public boolean isItemValidForSlot(int index, ItemStack stack) { return index != 2 && (index != 1 || (isItemFuel(stack) || SlotFurnaceFuel.isBucket(stack))); }
@Override public boolean isItemValidForSlot(int index, ItemStack stack) { return !(index == 2 || index == 3) && (index != 1 || (isItemFuel(stack) || SlotFurnaceFuel.isBucket(stack))); }
@Override public boolean isItemValidForSlot(int index, ItemStack stack) { return index == 2 ? false : (index != 1 ? true : isItemFuel(stack) || SlotFurnaceFuel.isBucket(stack)); }