@Override public boolean isItemValid(ItemStack stack) { if (myTile.augmentFood() && !FurnaceManager.isFood(stack)) { return false; } if (myTile.augmentOre() && !FurnaceManager.isOre(stack)) { return false; } return FurnaceManager.recipeExists(stack, myTile.augmentPyrolysis()); }
public TileFurnace() { super(); inventory = new ItemStack[1 + 1 + 1]; Arrays.fill(inventory, ItemStack.EMPTY); createAllSlots(inventory.length); tank.setLock(TFFluids.fluidCreosote); }
@Override protected void transferInput() { if (!getTransferIn()) { return; } int side; for (int i = inputTracker + 1; i <= inputTracker + 6; i++) { side = i % 6; if (isPrimaryInput(sideConfig.sideTypes[sideCache[side]])) { if (extractItem(0, ITEM_TRANSFER[level], EnumFacing.VALUES[side])) { inputTracker = side; break; } } } }
@Override public void initGui() { super.initGui(); tankBackground = (ElementSimple) addElement(new ElementSimple(this, 151, 8).setTextureOffsets(176, 104).setSize(18, 62).setTexture(TEX_PATH, 256, 256)); slotInput = addElement(new ElementSlotOverlay(this, 53, 26).setSlotInfo(SlotColor.BLUE, SlotType.STANDARD, SlotRender.FULL)); slotOutput = addElement(new ElementSlotOverlay(this, 112, 31).setSlotInfo(SlotColor.ORANGE, SlotType.OUTPUT, SlotRender.FULL)); slotTank = (ElementSlotOverlay) addElement(new ElementSlotOverlay(this, 152, 9).setSlotInfo(SlotColor.ORANGE, SlotType.TANK, SlotRender.FULL).setVisible(false)); if (!myTile.smallStorage()) { addElement(new ElementEnergyStored(this, 8, 8, myTile.getEnergyStorage())); } progress = (ElementDualScaled) addElement(new ElementDualScaled(this, 79, 34).setMode(1).setSize(24, 16).setTexture(TEX_ARROW_RIGHT, 64, 16)); speed = (ElementDualScaled) addElement(new ElementDualScaled(this, 53, 44).setSize(16, 16).setTexture(TEX_FLAME, 32, 16)); tank = (ElementFluidTank) addElement(new ElementFluidTank(this, 152, 9, myTile.getTank()).setGauge(0).setAlwaysShow(true)); progressFluid = (ElementFluid) addElement(new ElementFluid(this, 79, 34).setFluid(myTile.getTankFluid()).setSize(24, 16)); progressOverlay = (ElementDualScaled) addElement(new ElementDualScaled(this, 79, 34).setBackground(false).setMode(1).setSize(24, 16).setTexture(TEX_ARROW_FLUID_RIGHT, 64, 16)); tankBackground.setVisible(myTile.augmentPyrolysisClient()); tank.setVisible(myTile.augmentPyrolysisClient()); progressFluid.setVisible(myTile.augmentPyrolysisClient()); progressOverlay.setVisible(myTile.augmentPyrolysisClient()); }
public static void initialize() { SIDE_CONFIGS[TYPE] = new SideConfig(); SIDE_CONFIGS[TYPE].numConfig = 5; SIDE_CONFIGS[TYPE].slotGroups = new int[][] { {}, { 0 }, { 1 }, { 0, 1 }, { 0, 1 } }; SIDE_CONFIGS[TYPE].sideTypes = new int[] { NONE, INPUT_ALL, OUTPUT_ALL, OPEN, OMNI }; SIDE_CONFIGS[TYPE].defaultSides = new byte[] { 1, 1, 2, 2, 2, 2 }; ALT_SIDE_CONFIGS[TYPE] = new SideConfig(); ALT_SIDE_CONFIGS[TYPE].numConfig = 2; ALT_SIDE_CONFIGS[TYPE].slotGroups = new int[][] { {}, { 0 }, { 1 }, { 0, 1 }, { 0, 1 } }; ALT_SIDE_CONFIGS[TYPE].sideTypes = new int[] { NONE, OPEN }; ALT_SIDE_CONFIGS[TYPE].defaultSides = new byte[] { 1, 1, 1, 1, 1, 1 }; SLOT_CONFIGS[TYPE] = new SlotConfig(); SLOT_CONFIGS[TYPE].allowInsertionSlot = new boolean[] { true, false, false }; SLOT_CONFIGS[TYPE].allowExtractionSlot = new boolean[] { false, true, false }; VALID_AUGMENTS[TYPE] = new HashSet<>(); VALID_AUGMENTS[TYPE].add(TEProps.MACHINE_FURNACE_FOOD); VALID_AUGMENTS[TYPE].add(TEProps.MACHINE_FURNACE_ORE); VALID_AUGMENTS[TYPE].add(TEProps.MACHINE_FURNACE_PYROLYSIS); LIGHT_VALUES[TYPE] = 14; GameRegistry.registerTileEntity(TileFurnace.class, "thermalexpansion:machine_furnace"); config(); }
@Override protected void updateElementInformation() { super.updateElementInformation(); slotInput.setVisible(baseTile.hasSideType(INPUT_ALL) || baseTile.hasSideType(OMNI)); slotOutput.setVisible(baseTile.hasSideType(OUTPUT_ALL) || baseTile.hasSideType(OMNI)); slotTank.setVisible(myTile.augmentPyrolysisClient() && (baseTile.hasSideType(OUTPUT_ALL) || baseTile.hasSideType(OMNI))); progress.setQuantity(baseTile.getScaledProgress(PROGRESS)); speed.setQuantity(baseTile.getScaledSpeed(SPEED)); progressFluid.setSize(baseTile.getScaledProgress(PROGRESS), 16); progressOverlay.setQuantity(baseTile.getScaledProgress(PROGRESS)); progress.setVisible(!myTile.augmentPyrolysisClient()); tankBackground.setVisible(myTile.augmentPyrolysisClient()); tank.setVisible(myTile.augmentPyrolysisClient()); progressFluid.setVisible(myTile.augmentPyrolysisClient()); progressOverlay.setVisible(myTile.augmentPyrolysisClient()); }
public ContainerFurnace(InventoryPlayer inventory, TileEntity tile) { super(inventory, tile); myTile = (TileFurnace) tile; addSlotToContainer(new SlotValidated(this, myTile, 0, 53, 26)); addSlotToContainer(new SlotFurnaceOutput(inventory.player, myTile, 1, 116, 35)); addSlotToContainer(new SlotEnergy(myTile, myTile.getChargeSlot(), 8, 53)); }
return new TileFurnace(); case PULVERIZER: return new TilePulverizer();