@Override public boolean isItemValid(ItemStack stack) { if (myTile.augmentLava() && !CrucibleManager.isLava(stack)) { return false; } return CrucibleManager.recipeExists(stack); }
@Override protected void handleFluidPacket(PacketBase payload) { super.handleFluidPacket(payload); renderFluid = payload.getFluidStack(); callBlockUpdate(); }
public TileCrucible() { super(); inventory = new ItemStack[1 + 1]; Arrays.fill(inventory, ItemStack.EMPTY); createAllSlots(inventory.length); }
@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 protected void processFinish() { if (curRecipe == null) { getRecipe(); } if (curRecipe == null) { processOff(); return; } tank.fill(curRecipe.getOutput(), true); inventory[0].shrink(1); if (inventory[0].getCount() <= 0) { inventory[0] = ItemStack.EMPTY; } }
@Override public void initGui() { super.initGui(); slotInput = addElement(new ElementSlotOverlay(this, 53, 26).setSlotInfo(SlotColor.BLUE, SlotType.STANDARD, SlotRender.FULL)); slotTankOutput = addElement(new ElementSlotOverlay(this, 152, 9).setSlotInfo(SlotColor.ORANGE, SlotType.TANK, SlotRender.FULL)); if (!myTile.smallStorage()) { addElement(new ElementEnergyStored(this, 8, 8, myTile.getEnergyStorage())); } addElement(new ElementFluidTank(this, 152, 9, baseTile.getTank()).setGauge(1).setAlwaysShow(true)); progressFluid = (ElementFluid) addElement(new ElementFluid(this, 103, 34).setFluid(baseTile.getTankFluid()).setSize(24, 16)); progressOverlay = (ElementDualScaled) addElement(new ElementDualScaled(this, 103, 34).setMode(1).setBackground(false).setSize(24, 16).setTexture(TEX_DROP_RIGHT, 64, 16)); speed = (ElementDualScaled) addElement(new ElementDualScaled(this, 53, 44).setSize(16, 16).setTexture(TEX_FLAME, 32, 16)); }
@Override protected boolean hasValidInput() { if (augmentLava && !CrucibleManager.isLava(inventory[0])) { return false; } if (curRecipe == null) { getRecipe(); } if (curRecipe == null) { return false; } return curRecipe.getInput().getCount() <= inventory[0].getCount(); }
public static void initialize() { SIDE_CONFIGS[TYPE] = new SideConfig(); SIDE_CONFIGS[TYPE].numConfig = 5; SIDE_CONFIGS[TYPE].slotGroups = new int[][] { {}, { 0 }, {}, { 0 }, { 0 } }; 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 }, {}, { 0 }, { 0 } }; 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 }; SLOT_CONFIGS[TYPE].allowExtractionSlot = new boolean[] { false, false }; VALID_AUGMENTS[TYPE] = new HashSet<>(); VALID_AUGMENTS[TYPE].add(TEProps.MACHINE_CRUCIBLE_LAVA); LIGHT_VALUES[TYPE] = 14; GameRegistry.registerTileEntity(TileCrucible.class, "thermalexpansion:machine_crucible"); config(); }
public ContainerCrucible(InventoryPlayer inventory, TileEntity tile) { super(inventory, tile); myTile = (TileCrucible) tile; addSlotToContainer(new SlotValidated(this, myTile, 0, 53, 26)); addSlotToContainer(new SlotEnergy(myTile, myTile.getChargeSlot(), 8, 53)); }
return new TileCompactor(); case CRUCIBLE: return new TileCrucible(); case REFINERY: return new TileRefinery();
@Override public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); inputTracker = nbt.getInteger(CoreProps.TRACK_IN); outputTrackerFluid = nbt.getInteger(CoreProps.TRACK_OUT); tank.readFromNBT(nbt); getRecipe(); if (tank.getFluid() != null) { renderFluid = tank.getFluid().copy(); } else if (curRecipe != null) { renderFluid = curRecipe.getOutput().copy(); } }
@Override protected boolean canStart() { if (inventory[0].isEmpty() || energyStorage.getEnergyStored() <= 0 || tank.getSpace() <= 0) { return false; } if (augmentLava && !CrucibleManager.isLava(inventory[0])) { return false; } getRecipe(); if (curRecipe == null) { return false; } if (inventory[0].getCount() < curRecipe.getInput().getCount()) { return false; } FluidStack output = curRecipe.getOutput(); return tank.fill(output, false) == output.amount; }