@Override protected void handleModePacket(PacketBase payload) { super.handleModePacket(payload); lockPrimary = payload.getBool(); callNeighborTileChange(); }
public static void initialize() { SIDE_CONFIGS[TYPE] = new SideConfig(); SIDE_CONFIGS[TYPE].numConfig = 9; SIDE_CONFIGS[TYPE].slotGroups = new int[][] { {}, { 0, 1 }, { 2 }, { 3 }, { 2, 3 }, { 0 }, { 1 }, { 0, 1, 2, 3 }, { 0, 1, 2, 3 } }; SIDE_CONFIGS[TYPE].sideTypes = new int[] { NONE, INPUT_ALL, OUTPUT_PRIMARY, OUTPUT_SECONDARY, OUTPUT_ALL, INPUT_PRIMARY, INPUT_SECONDARY, OPEN, OMNI }; SIDE_CONFIGS[TYPE].defaultSides = new byte[] { 3, 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 }, { 2 }, { 3 }, { 2, 3 }, { 0 }, { 1 }, { 0, 1, 2, 3 }, { 0, 1, 2, 3 } }; 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, true, false, false, false }; SLOT_CONFIGS[TYPE].allowExtractionSlot = new boolean[] { false, false, true, true, false }; VALID_AUGMENTS[TYPE] = new HashSet<>(); VALID_AUGMENTS[TYPE].add(TEProps.MACHINE_INSOLATOR_FERTILIZER); VALID_AUGMENTS[TYPE].add(TEProps.MACHINE_INSOLATOR_MONOCULTURE); VALID_AUGMENTS[TYPE].add(TEProps.MACHINE_INSOLATOR_TREE); VALID_AUGMENTS[TYPE].add(TEProps.MACHINE_SECONDARY); VALID_AUGMENTS[TYPE].add(TEProps.MACHINE_SECONDARY_NULL); LIGHT_VALUES[TYPE] = 14; GameRegistry.registerTileEntity(TileInsolator.class, "thermalexpansion:machine_insolator"); config(); }
public TileInsolator() { super(); inventory = new ItemStack[2 + 1 + 1 + 1]; Arrays.fill(inventory, ItemStack.EMPTY); createAllSlots(inventory.length); tank.setLock(FluidRegistry.WATER); }
@Override protected void transferInput() { if (!getTransferIn()) { return; } int side; for (int i = inputTrackerPrimary + 1; i <= inputTrackerPrimary + 6; i++) { side = i % 6; if (isPrimaryInput(sideConfig.sideTypes[sideCache[side]])) { if (extractItem(0, ITEM_TRANSFER[level], EnumFacing.VALUES[side])) { inputTrackerPrimary = side; break; } } } for (int i = inputTrackerSecondary + 1; i <= inputTrackerSecondary + 6; i++) { side = i % 6; if (isSecondaryInput(sideConfig.sideTypes[sideCache[side]])) { if (extractItem(1, ITEM_TRANSFER[level], EnumFacing.VALUES[side])) { inputTrackerSecondary = side; break; } } } }
@Override public void initGui() { super.initGui(); slotPrimaryInput[0] = (ElementSlotOverlay) addElement(new ElementSlotOverlay(this, 32, 26).setSlotInfo(SlotColor.BLUE, SlotType.STANDARD, SlotRender.FULL)); slotPrimaryInput[1] = (ElementSlotOverlay) addElement(new ElementSlotOverlay(this, 32, 26).setSlotInfo(SlotColor.GREEN, SlotType.STANDARD, SlotRender.BOTTOM)); slotSecondaryInput[0] = (ElementSlotOverlay) addElement(new ElementSlotOverlay(this, 56, 26).setSlotInfo(SlotColor.BLUE, SlotType.STANDARD, SlotRender.FULL)); slotSecondaryInput[1] = (ElementSlotOverlay) addElement(new ElementSlotOverlay(this, 56, 26).setSlotInfo(SlotColor.PURPLE, SlotType.STANDARD, SlotRender.BOTTOM)); slotPrimaryOutput[0] = (ElementSlotOverlay) addElement(new ElementSlotOverlay(this, 112, 22).setSlotInfo(SlotColor.ORANGE, SlotType.OUTPUT, SlotRender.FULL)); slotPrimaryOutput[1] = (ElementSlotOverlay) addElement(new ElementSlotOverlay(this, 112, 22).setSlotInfo(SlotColor.RED, SlotType.OUTPUT, SlotRender.BOTTOM)); slotSecondaryOutput[0] = (ElementSlotOverlay) addElement(new ElementSlotOverlay(this, 116, 53).setSlotInfo(SlotColor.ORANGE, SlotType.STANDARD, SlotRender.FULL)); slotSecondaryOutput[1] = (ElementSlotOverlay) addElement(new ElementSlotOverlay(this, 116, 53).setSlotInfo(SlotColor.YELLOW, SlotType.STANDARD, SlotRender.BOTTOM)); if (!myTile.smallStorage()) { addElement(new ElementEnergyStored(this, 8, 8, myTile.getEnergyStorage())); } addElement(new ElementFluidTank(this, 152, 9, myTile.getTank()).setGauge(1).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)); speed = (ElementDualScaled) addElement(new ElementDualScaled(this, 44, 44).setSize(16, 16).setTexture(TEX_SUN, 32, 16)); mode = (ElementButton) addElement(new ElementButton(this, 80, 53, "Mode", 176, 0, 176, 16, 176, 32, 16, 16, TEX_PATH)); modeOverlay = (ElementSimple) addElement(new ElementSimple(this, 32, 26).setTextureOffsets(176, 48).setSize(16, 16).setTexture(TEX_PATH, 256, 256)); }
slotPrimaryInput[0].setVisible(myTile.hasSideType(INPUT_ALL) || baseTile.hasSideType(OMNI)); slotPrimaryInput[1].setVisible(myTile.hasSideType(INPUT_PRIMARY)); slotSecondaryInput[0].setVisible(myTile.hasSideType(INPUT_ALL) || baseTile.hasSideType(OMNI)); slotSecondaryInput[1].setVisible(myTile.hasSideType(INPUT_SECONDARY)); slotPrimaryOutput[0].setVisible(myTile.hasSideType(OUTPUT_ALL) || baseTile.hasSideType(OMNI)); slotPrimaryOutput[1].setVisible(myTile.hasSideType(OUTPUT_PRIMARY)); slotSecondaryOutput[0].setVisible(myTile.hasSideType(OUTPUT_ALL) || baseTile.hasSideType(OMNI)); slotSecondaryOutput[1].setVisible(myTile.hasSideType(OUTPUT_SECONDARY)); speed.setQuantity(myTile.getScaledSpeed(SPEED));
getRecipe(); processOff(); return;
@Override protected boolean hasValidInput() { if (curRecipe == null) { getRecipe(); } if (curRecipe == null) { return false; } if (InsolatorManager.isRecipeReversed(inventory[0], inventory[1])) { return curRecipe.getPrimaryInput().getCount() <= inventory[1].getCount() && curRecipe.getSecondaryInput().getCount() <= inventory[0].getCount(); } else { return curRecipe.getPrimaryInput().getCount() <= inventory[0].getCount() && curRecipe.getSecondaryInput().getCount() <= inventory[1].getCount(); } }
public ContainerInsolator(InventoryPlayer inventory, TileEntity tile) { super(inventory, tile); myTile = (TileInsolator) tile; addSlotToContainer(new SlotValidated(lockSlot, myTile, 0, 32, 26)); addSlotToContainer(new SlotValidated(otherSlot, myTile, 1, 56, 26)); addSlotToContainer(new SlotRemoveOnly(myTile, 2, 116, 26)); addSlotToContainer(new SlotRemoveOnly(myTile, 3, 116, 53)); addSlotToContainer(new SlotEnergy(myTile, myTile.getChargeSlot(), 8, 53)); }
return new TileSmelter(); case INSOLATOR: return new TileInsolator(); case COMPACTOR: return new TileCompactor();
return false; getRecipe();