2015-04-10 00:17:30 +02:00
|
|
|
package techreborn.client;
|
|
|
|
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2017-01-06 00:43:21 +01:00
|
|
|
import net.minecraft.inventory.IInventory;
|
2016-03-13 17:08:30 +01:00
|
|
|
import net.minecraft.util.math.BlockPos;
|
2015-04-10 00:17:30 +02:00
|
|
|
import net.minecraft.world.World;
|
2015-11-23 20:19:18 +01:00
|
|
|
import net.minecraftforge.fml.common.network.IGuiHandler;
|
2017-01-07 17:21:14 +01:00
|
|
|
|
2017-01-08 13:10:13 +01:00
|
|
|
import reborncore.api.recipe.RecipeHandler;
|
2016-04-12 09:33:38 +02:00
|
|
|
import reborncore.api.tile.IContainerLayout;
|
|
|
|
import reborncore.common.container.RebornContainer;
|
2017-01-08 13:10:13 +01:00
|
|
|
import reborncore.common.util.ItemUtils;
|
2017-01-07 17:21:14 +01:00
|
|
|
|
2017-01-08 14:00:19 +01:00
|
|
|
import techreborn.api.RollingMachineRecipe;
|
2017-01-08 13:10:13 +01:00
|
|
|
import techreborn.api.recipe.machines.AlloySmelterRecipe;
|
2016-03-27 21:10:49 +02:00
|
|
|
import techreborn.client.container.*;
|
2017-01-06 00:43:21 +01:00
|
|
|
import techreborn.client.container.builder.ContainerBuilder;
|
2016-03-27 21:10:49 +02:00
|
|
|
import techreborn.client.gui.*;
|
2017-01-08 12:05:57 +01:00
|
|
|
import techreborn.init.ModItems;
|
2016-02-25 19:25:52 +01:00
|
|
|
import techreborn.manual.GuiManual;
|
2016-03-27 21:10:49 +02:00
|
|
|
import techreborn.tiles.*;
|
2015-11-16 16:20:13 +01:00
|
|
|
import techreborn.tiles.fusionReactor.TileEntityFusionController;
|
2016-03-27 21:10:49 +02:00
|
|
|
import techreborn.tiles.generator.*;
|
2015-06-17 18:01:26 +02:00
|
|
|
import techreborn.tiles.idsu.TileIDSU;
|
2015-06-14 17:42:03 +02:00
|
|
|
import techreborn.tiles.lesu.TileLesu;
|
2016-07-24 21:26:15 +02:00
|
|
|
import techreborn.tiles.multiblock.*;
|
2016-03-21 16:30:32 +01:00
|
|
|
import techreborn.tiles.storage.TileBatBox;
|
2016-03-28 10:34:48 +02:00
|
|
|
import techreborn.tiles.storage.TileMFE;
|
2016-03-27 21:10:49 +02:00
|
|
|
import techreborn.tiles.storage.TileMFSU;
|
|
|
|
import techreborn.tiles.teir1.*;
|
2015-04-10 00:17:30 +02:00
|
|
|
|
2016-10-08 21:46:16 +02:00
|
|
|
public class GuiHandler implements IGuiHandler {
|
2015-04-10 00:17:30 +02:00
|
|
|
|
2016-03-25 10:47:34 +01:00
|
|
|
public static final int thermalGeneratorID = 0;
|
|
|
|
public static final int quantumTankID = 1;
|
|
|
|
public static final int quantumChestID = 2;
|
|
|
|
public static final int centrifugeID = 3;
|
|
|
|
public static final int rollingMachineID = 4;
|
|
|
|
public static final int blastFurnaceID = 5;
|
|
|
|
public static final int alloySmelterID = 6;
|
|
|
|
public static final int industrialGrinderID = 7;
|
|
|
|
public static final int implosionCompresserID = 8;
|
|
|
|
public static final int matterfabID = 9;
|
|
|
|
public static final int manuelID = 10;
|
|
|
|
public static final int chunkloaderID = 11;
|
|
|
|
public static final int assemblingmachineID = 12;
|
|
|
|
public static final int dieselGeneratorID = 15;
|
|
|
|
public static final int industrialElectrolyzerID = 16;
|
|
|
|
public static final int aesuID = 17;
|
|
|
|
public static final int alloyFurnaceID = 18;
|
|
|
|
public static final int sawMillID = 19;
|
|
|
|
public static final int chemicalReactorID = 20;
|
|
|
|
public static final int semifluidGeneratorID = 21;
|
|
|
|
public static final int gasTurbineID = 22;
|
|
|
|
public static final int digitalChestID = 23;
|
|
|
|
public static final int destructoPackID = 25;
|
|
|
|
public static final int lesuID = 26;
|
|
|
|
public static final int idsuID = 27;
|
|
|
|
public static final int chargeBench = 28;
|
|
|
|
public static final int fusionID = 29;
|
|
|
|
public static final int vacuumFreezerID = 30;
|
|
|
|
public static final int grinderID = 31;
|
|
|
|
public static final int generatorID = 32;
|
|
|
|
public static final int extractorID = 33;
|
|
|
|
public static final int compressorID = 34;
|
|
|
|
public static final int electricFurnaceID = 35;
|
|
|
|
public static final int ironFurnace = 36;
|
|
|
|
public static final int recyclerID = 37;
|
|
|
|
public static final int scrapboxinatorID = 38;
|
|
|
|
public static final int batboxID = 39;
|
2016-03-27 21:10:49 +02:00
|
|
|
public static final int mfsuID = 40;
|
|
|
|
public static final int mfeID = 41;
|
2016-10-08 21:46:16 +02:00
|
|
|
|
2016-03-25 10:47:34 +01:00
|
|
|
@Override
|
2017-01-08 02:04:02 +01:00
|
|
|
public Object getServerGuiElement(final int ID, final EntityPlayer player, final World world, final int x,
|
|
|
|
final int y, final int z) {
|
2017-01-08 13:10:13 +01:00
|
|
|
final RebornContainer container = null;
|
2017-01-07 21:06:08 +01:00
|
|
|
if (ID == GuiHandler.gasTurbineID || ID == GuiHandler.semifluidGeneratorID
|
|
|
|
|| ID == GuiHandler.thermalGeneratorID || ID == GuiHandler.dieselGeneratorID) {
|
2017-01-08 02:04:02 +01:00
|
|
|
return new ContainerBuilder("fluidgenerator").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 80, 17)
|
|
|
|
.outputSlot(1, 80, 53).fakeSlot(2, 59, 42).syncEnergyValue().addInventory().create();
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.quantumTankID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new ContainerQuantumTank((TileQuantumTank) world.getTileEntity(new BlockPos(x, y, z)), player);
|
2017-01-06 00:43:21 +01:00
|
|
|
} else if (ID == GuiHandler.digitalChestID || ID == GuiHandler.quantumChestID) {
|
2017-01-08 02:04:02 +01:00
|
|
|
return new ContainerBuilder("digitalchest").player(player.inventory).inventory().hotbar().addInventory()
|
2017-01-07 02:46:46 +01:00
|
|
|
.tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 80, 17).outputSlot(1, 80, 53)
|
|
|
|
.fakeSlot(2, 59, 42).addInventory().create();
|
2017-01-06 00:43:21 +01:00
|
|
|
} else if (ID == GuiHandler.centrifugeID) {
|
2017-01-08 02:19:26 +01:00
|
|
|
return new ContainerBuilder("centrifuge").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 80, 35)
|
|
|
|
.slot(1, 50, 5).outputSlot(2, 80, 5).outputSlot(3, 110, 35).outputSlot(4, 80, 65)
|
|
|
|
.outputSlot(5, 50, 35).energySlot(6, 8, 51).upgradeSlot(7, 152, 8).upgradeSlot(8, 152, 26)
|
|
|
|
.upgradeSlot(9, 152, 44).upgradeSlot(10, 152, 62).syncEnergyValue().syncCrafterValue()
|
|
|
|
.addInventory().create();
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.rollingMachineID) {
|
2017-01-08 14:00:19 +01:00
|
|
|
return new ContainerBuilder("rollingmachine").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile(((TileRollingMachine) world.getTileEntity(new BlockPos(x, y, z))).craftMatrix)
|
|
|
|
.slot(0, 30, 17).slot(1, 48, 17).slot(2, 66, 17).slot(3, 30, 35).slot(4, 48, 35).slot(5, 66, 35)
|
|
|
|
.slot(6, 30, 53).slot(7, 48, 53).slot(8, 66, 53)
|
|
|
|
.onCraft(inv -> ((TileRollingMachine) world.getTileEntity(new BlockPos(x, y, z))).inventory
|
|
|
|
.setInventorySlotContents(1, RollingMachineRecipe.instance.findMatchingRecipe(inv, world)))
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).outputSlot(0, 124, 35)
|
|
|
|
.energySlot(2, 8, 51).syncEnergyValue()
|
|
|
|
.syncIntegerValue(((TileRollingMachine) world.getTileEntity(new BlockPos(x, y, z)))::getBurnTime,
|
|
|
|
((TileRollingMachine) world.getTileEntity(new BlockPos(x, y, z)))::setBurnTime)
|
|
|
|
.addInventory().create();
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.blastFurnaceID) {
|
2017-01-08 15:45:05 +01:00
|
|
|
return new ContainerBuilder("blastfurnace").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 40, 25)
|
|
|
|
.slot(1, 40, 43).outputSlot(2, 100, 35).outputSlot(3, 118, 35).syncEnergyValue().syncCrafterValue()
|
|
|
|
.syncIntegerValue(((TileBlastFurnace) world.getTileEntity(new BlockPos(x, y, z)))::getHeat,
|
|
|
|
((TileBlastFurnace) world.getTileEntity(new BlockPos(x, y, z)))::setHeat)
|
|
|
|
.addInventory().create();
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.alloySmelterID) {
|
2017-01-08 13:10:13 +01:00
|
|
|
return new ContainerBuilder("alloysmelter").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z)))
|
|
|
|
.filterSlot(0, 47, 17, stack -> RecipeHandler.recipeList.stream()
|
|
|
|
.anyMatch(recipe -> recipe instanceof AlloySmelterRecipe
|
|
|
|
&& ItemUtils.isItemEqual(recipe.getInputs().get(0), stack, true, true, true)))
|
|
|
|
.filterSlot(1, 65, 17, stack -> RecipeHandler.recipeList.stream()
|
|
|
|
.anyMatch(recipe -> recipe instanceof AlloySmelterRecipe
|
|
|
|
&& ItemUtils.isItemEqual(recipe.getInputs().get(1), stack, true, true, true)))
|
|
|
|
.outputSlot(2, 116, 35).energySlot(3, 56, 53).upgradeSlot(4, 152, 8).upgradeSlot(5, 152, 26)
|
|
|
|
.upgradeSlot(6, 152, 44).upgradeSlot(7, 152, 62).syncEnergyValue().syncCrafterValue().addInventory()
|
|
|
|
.create();
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.industrialGrinderID) {
|
2017-01-08 16:20:13 +01:00
|
|
|
return new ContainerBuilder("industrialgrinder").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 32, 26)
|
|
|
|
.slot(1, 32, 44).outputSlot(2, 77, 35).outputSlot(3, 95, 35).outputSlot(4, 113, 35)
|
|
|
|
.outputSlot(5, 131, 35).syncEnergyValue().syncCrafterValue().addInventory().create();
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.implosionCompresserID) {
|
2017-01-08 16:01:24 +01:00
|
|
|
return new ContainerBuilder("implosioncompressor").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 37, 26)
|
|
|
|
.slot(1, 37, 44).outputSlot(2, 93, 35).outputSlot(3, 111, 35).syncEnergyValue().syncCrafterValue()
|
|
|
|
.addInventory().create();
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.matterfabID) {
|
2017-01-08 15:22:59 +01:00
|
|
|
return new ContainerBuilder("matterfabricator").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 33, 17)
|
|
|
|
.slot(1, 33, 35).slot(2, 33, 53).slot(3, 51, 17).slot(4, 51, 35).slot(5, 51, 53)
|
|
|
|
.outputSlot(6, 116, 35).syncEnergyValue()
|
|
|
|
.syncIntegerValue(((TileMatterFabricator) world.getTileEntity(new BlockPos(x, y, z)))::getProgress,
|
|
|
|
((TileMatterFabricator) world.getTileEntity(new BlockPos(x, y, z)))::setProgress)
|
|
|
|
.addInventory().create();
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.assemblingmachineID) {
|
2017-01-08 02:31:37 +01:00
|
|
|
return new ContainerBuilder("assemblingmachine").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 47, 17)
|
|
|
|
.slot(1, 65, 17).outputSlot(2, 116, 35).energySlot(3, 56, 53).upgradeSlot(4, 152, 8)
|
|
|
|
.upgradeSlot(5, 152, 26).upgradeSlot(6, 152, 44).upgradeSlot(7, 152, 62).syncEnergyValue()
|
|
|
|
.syncCrafterValue().addInventory().create();
|
2017-01-06 02:30:51 +01:00
|
|
|
} else if (ID == GuiHandler.chunkloaderID) {
|
2017-01-08 02:04:02 +01:00
|
|
|
return new ContainerBuilder("chunkloader").player(player.inventory).inventory().hotbar().addInventory()
|
2017-01-06 02:30:51 +01:00
|
|
|
.create();
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.industrialElectrolyzerID) {
|
2017-01-08 16:20:13 +01:00
|
|
|
return new ContainerBuilder("industrialelectrolyzer").player(player.inventory).inventory(8, 84)
|
|
|
|
.hotbar(8, 142).addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z)))
|
|
|
|
.slot(0, 80, 51).slot(1, 50, 51).outputSlot(2, 50, 19).outputSlot(3, 70, 19).outputSlot(4, 90, 19)
|
|
|
|
.outputSlot(5, 110, 19).energySlot(6, 18, 51).syncEnergyValue().syncCrafterValue().addInventory()
|
|
|
|
.create();
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.aesuID) {
|
2016-03-29 04:47:00 +02:00
|
|
|
return new ContainerAESU((TileAesu) world.getTileEntity(new BlockPos(x, y, z)), player);
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.alloyFurnaceID) {
|
2017-01-08 13:10:13 +01:00
|
|
|
return new ContainerBuilder("alloyfurnace").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z)))
|
|
|
|
.filterSlot(0, 47, 17, stack -> RecipeHandler.recipeList.stream()
|
|
|
|
.anyMatch(recipe -> recipe instanceof AlloySmelterRecipe
|
|
|
|
&& ItemUtils.isItemEqual(recipe.getInputs().get(0), stack, true, true, true)))
|
|
|
|
.filterSlot(1, 65, 17, stack -> RecipeHandler.recipeList.stream()
|
|
|
|
.anyMatch(recipe -> recipe instanceof AlloySmelterRecipe
|
|
|
|
&& ItemUtils.isItemEqual(recipe.getInputs().get(1), stack, true, true, true)))
|
|
|
|
.outputSlot(2, 116, 35).fuelSlot(3, 56, 53)
|
|
|
|
.syncIntegerValue(((TileAlloyFurnace) world.getTileEntity(new BlockPos(x, y, z)))::getBurnTime,
|
|
|
|
((TileAlloyFurnace) world.getTileEntity(new BlockPos(x, y, z)))::setBurnTime)
|
|
|
|
.syncIntegerValue(((TileAlloyFurnace) world.getTileEntity(new BlockPos(x, y, z)))::getCookTime,
|
|
|
|
((TileAlloyFurnace) world.getTileEntity(new BlockPos(x, y, z)))::setCookTime)
|
|
|
|
.syncIntegerValue(
|
|
|
|
((TileAlloyFurnace) world.getTileEntity(new BlockPos(x, y, z)))::getCurrentItemBurnTime,
|
|
|
|
((TileAlloyFurnace) world.getTileEntity(new BlockPos(x, y, z)))::setCurrentItemBurnTime)
|
|
|
|
.addInventory().create();
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.sawMillID) {
|
2017-01-08 16:20:13 +01:00
|
|
|
return new ContainerBuilder("industrialsawmill").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 32, 26)
|
|
|
|
.slot(1, 32, 44).outputSlot(2, 84, 35).outputSlot(3, 102, 35).outputSlot(4, 120, 35)
|
|
|
|
.syncEnergyValue().addInventory().create();
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.chemicalReactorID) {
|
2017-01-08 02:23:03 +01:00
|
|
|
return new ContainerBuilder("chemicalreactor").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 70, 21)
|
2017-01-08 02:31:37 +01:00
|
|
|
.slot(1, 90, 21).outputSlot(2, 80, 51).energySlot(3, 8, 51).upgradeSlot(4, 152, 8)
|
|
|
|
.upgradeSlot(5, 152, 26).upgradeSlot(6, 152, 44).upgradeSlot(7, 152, 62).syncEnergyValue()
|
2017-01-08 02:23:03 +01:00
|
|
|
.syncCrafterValue().addInventory().create();
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.manuelID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return null;
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.destructoPackID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new ContainerDestructoPack(player);
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.lesuID) {
|
2016-03-29 04:47:00 +02:00
|
|
|
return new ContainerLESU((TileLesu) world.getTileEntity(new BlockPos(x, y, z)), player);
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.idsuID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new ContainerIDSU((TileIDSU) world.getTileEntity(new BlockPos(x, y, z)), player);
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.fusionID) {
|
2017-01-08 16:32:03 +01:00
|
|
|
return new ContainerBuilder("fusionreactor").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 88, 17)
|
|
|
|
.slot(1, 88, 53).outputSlot(2, 148, 35).syncEnergyValue()
|
|
|
|
.syncIntegerValue(
|
|
|
|
((TileEntityFusionController) world.getTileEntity(new BlockPos(x, y, z)))::getCoilStatus,
|
|
|
|
((TileEntityFusionController) world.getTileEntity(new BlockPos(x, y, z)))::setCoilStatus)
|
|
|
|
.syncIntegerValue(
|
|
|
|
((TileEntityFusionController) world
|
|
|
|
.getTileEntity(new BlockPos(x, y, z)))::getCrafingTickTime,
|
|
|
|
((TileEntityFusionController) world
|
|
|
|
.getTileEntity(new BlockPos(x, y, z)))::setCrafingTickTime)
|
|
|
|
.syncIntegerValue(
|
|
|
|
((TileEntityFusionController) world.getTileEntity(new BlockPos(x, y, z)))::getFinalTickTime,
|
|
|
|
((TileEntityFusionController) world.getTileEntity(new BlockPos(x, y, z)))::setFinalTickTime)
|
|
|
|
.syncIntegerValue(
|
|
|
|
((TileEntityFusionController) world.getTileEntity(new BlockPos(x, y, z)))::getNeededPower,
|
|
|
|
((TileEntityFusionController) world.getTileEntity(new BlockPos(x, y, z)))::setNeededPower)
|
|
|
|
.addInventory().create();
|
2017-01-06 02:30:51 +01:00
|
|
|
} else if (ID == GuiHandler.chargeBench) {
|
2017-01-08 02:04:02 +01:00
|
|
|
return new ContainerBuilder("chargebench").player(player.inventory).inventory().hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).energySlot(0, 62, 21)
|
2017-01-07 02:46:46 +01:00
|
|
|
.energySlot(1, 80, 21).energySlot(2, 98, 21).energySlot(3, 62, 39).energySlot(4, 80, 39)
|
2017-01-07 17:21:14 +01:00
|
|
|
.energySlot(5, 98, 39).syncEnergyValue().addInventory().create();
|
|
|
|
} else if (ID == GuiHandler.vacuumFreezerID) {
|
2017-01-08 16:01:24 +01:00
|
|
|
return new ContainerBuilder("vacuumfreezer").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 56, 34)
|
|
|
|
.outputSlot(1, 116, 35).syncEnergyValue().syncCrafterValue().addInventory().create();
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.generatorID) {
|
2017-01-08 02:04:02 +01:00
|
|
|
return new ContainerBuilder("generator").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).fuelSlot(0, 80, 53)
|
2017-01-07 20:34:03 +01:00
|
|
|
.energySlot(1, 80, 17).syncEnergyValue()
|
|
|
|
.syncIntegerValue(((TileGenerator) world.getTileEntity(new BlockPos(x, y, z)))::getBurnTime,
|
|
|
|
((TileGenerator) world.getTileEntity(new BlockPos(x, y, z)))::setBurnTime)
|
|
|
|
.syncIntegerValue(((TileGenerator) world.getTileEntity(new BlockPos(x, y, z)))::getTotalBurnTime,
|
|
|
|
((TileGenerator) world.getTileEntity(new BlockPos(x, y, z)))::setTotalBurnTime)
|
|
|
|
.addInventory().create();
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.compressorID) {
|
2017-01-08 02:04:02 +01:00
|
|
|
return new ContainerBuilder("compressor").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 56, 34)
|
|
|
|
.outputSlot(1, 116, 34).upgradeSlot(2, 152, 8).upgradeSlot(3, 152, 26).upgradeSlot(4, 152, 44)
|
|
|
|
.upgradeSlot(5, 152, 62).syncEnergyValue().syncCrafterValue().addInventory().create();
|
|
|
|
} else if (ID == GuiHandler.extractorID) {
|
|
|
|
return new ContainerBuilder("extractor").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 56, 34)
|
|
|
|
.outputSlot(1, 116, 34).upgradeSlot(2, 152, 8).upgradeSlot(3, 152, 26).upgradeSlot(4, 152, 44)
|
|
|
|
.upgradeSlot(5, 152, 62).syncEnergyValue().syncCrafterValue().addInventory().create();
|
|
|
|
} else if (ID == GuiHandler.grinderID) {
|
|
|
|
return new ContainerBuilder("grinder").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 56, 34)
|
|
|
|
.outputSlot(1, 116, 34).upgradeSlot(2, 152, 8).upgradeSlot(3, 152, 26).upgradeSlot(4, 152, 44)
|
|
|
|
.upgradeSlot(5, 152, 62).syncEnergyValue().syncCrafterValue().addInventory().create();
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.electricFurnaceID) {
|
2017-01-08 02:04:02 +01:00
|
|
|
return new ContainerBuilder("electricfurnace").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 56, 34)
|
2017-01-07 22:11:54 +01:00
|
|
|
.outputSlot(1, 116, 34).upgradeSlot(2, 152, 8).upgradeSlot(3, 152, 26).upgradeSlot(4, 152, 44)
|
|
|
|
.upgradeSlot(5, 152, 62).syncEnergyValue()
|
|
|
|
.syncIntegerValue(((TileElectricFurnace) world.getTileEntity(new BlockPos(x, y, z)))::getBurnTime,
|
|
|
|
((TileElectricFurnace) world.getTileEntity(new BlockPos(x, y, z)))::setBurnTime)
|
|
|
|
.addInventory().create();
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.ironFurnace) {
|
2017-01-08 02:04:02 +01:00
|
|
|
return new ContainerBuilder("ironfurnace").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 56, 17)
|
2017-01-07 21:56:23 +01:00
|
|
|
.outputSlot(1, 116, 34).fuelSlot(2, 56, 53)
|
|
|
|
.syncIntegerValue(((TileIronFurnace) world.getTileEntity(new BlockPos(x, y, z)))::getBurnTime,
|
|
|
|
((TileIronFurnace) world.getTileEntity(new BlockPos(x, y, z)))::setBurnTime)
|
|
|
|
.syncIntegerValue(((TileIronFurnace) world.getTileEntity(new BlockPos(x, y, z)))::getTotalBurnTime,
|
|
|
|
((TileIronFurnace) world.getTileEntity(new BlockPos(x, y, z)))::setTotalBurnTime)
|
|
|
|
.addInventory().create();
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.recyclerID) {
|
2017-01-08 02:41:50 +01:00
|
|
|
return new ContainerBuilder("recycler").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 56, 34)
|
|
|
|
.slot(1, 116, 34).upgradeSlot(2, 152, 8).upgradeSlot(3, 152, 26).upgradeSlot(4, 152, 44)
|
|
|
|
.upgradeSlot(5, 152, 62).syncEnergyValue()
|
|
|
|
.syncIntegerValue(((TileRecycler) world.getTileEntity(new BlockPos(x, y, z)))::getProgress,
|
|
|
|
((TileRecycler) world.getTileEntity(new BlockPos(x, y, z)))::setProgress)
|
|
|
|
.addInventory().create();
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.scrapboxinatorID) {
|
2017-01-08 12:05:57 +01:00
|
|
|
return new ContainerBuilder("scrapboxinator").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z)))
|
|
|
|
.filterSlot(0, 56, 34, stack -> stack.getItem() == ModItems.SCRAP_BOX).outputSlot(1, 116, 34)
|
|
|
|
.upgradeSlot(2, 152, 8).upgradeSlot(3, 152, 26).upgradeSlot(4, 152, 44).upgradeSlot(5, 152, 62)
|
|
|
|
.syncEnergyValue()
|
|
|
|
.syncIntegerValue(((TileScrapboxinator) world.getTileEntity(new BlockPos(x, y, z)))::getProgress,
|
|
|
|
((TileScrapboxinator) world.getTileEntity(new BlockPos(x, y, z)))::setProgress)
|
|
|
|
.addInventory().create();
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.batboxID) {
|
2017-01-08 02:04:02 +01:00
|
|
|
return new ContainerBuilder("batbox").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
|
|
|
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).energySlot(0, 80, 17)
|
|
|
|
.energySlot(1, 80, 53).syncEnergyValue().addInventory().create();
|
|
|
|
} else if (ID == GuiHandler.mfeID) {
|
|
|
|
return new ContainerBuilder("mfe").player(player.inventory).inventory(8, 84).hotbar(8, 142).armor()
|
|
|
|
.complete(44, 6).addArmor().addInventory()
|
2017-01-07 19:12:50 +01:00
|
|
|
.tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).energySlot(0, 80, 17)
|
|
|
|
.energySlot(1, 80, 53).syncEnergyValue().addInventory().create();
|
2017-01-08 02:04:02 +01:00
|
|
|
} else if (ID == GuiHandler.mfsuID) {
|
|
|
|
return new ContainerBuilder("mfsu").player(player.inventory).inventory(8, 84).hotbar(8, 142).armor()
|
2017-01-07 17:21:14 +01:00
|
|
|
.complete(44, 6).addArmor().addInventory()
|
|
|
|
.tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).energySlot(0, 80, 17)
|
|
|
|
.energySlot(1, 80, 53).syncEnergyValue().addInventory().create();
|
2016-03-25 10:47:34 +01:00
|
|
|
}
|
2016-10-08 21:46:16 +02:00
|
|
|
if (container != null) {
|
|
|
|
if (container instanceof IContainerLayout) {
|
2017-01-07 17:21:14 +01:00
|
|
|
final IContainerLayout layout = (IContainerLayout) container;
|
2016-04-12 09:33:38 +02:00
|
|
|
layout.setTile(world.getTileEntity(new BlockPos(x, y, z)));
|
|
|
|
layout.setPlayer(player);
|
|
|
|
layout.addInventorySlots();
|
|
|
|
layout.addPlayerSlots();
|
|
|
|
}
|
|
|
|
return container;
|
|
|
|
}
|
2016-03-25 10:47:34 +01:00
|
|
|
return null;
|
|
|
|
}
|
2015-08-09 12:05:32 +02:00
|
|
|
|
2016-03-25 10:47:34 +01:00
|
|
|
@Override
|
2017-01-08 02:04:02 +01:00
|
|
|
public Object getClientGuiElement(final int ID, final EntityPlayer player, final World world, final int x,
|
|
|
|
final int y, final int z) {
|
2017-01-07 17:21:14 +01:00
|
|
|
if (ID == GuiHandler.thermalGeneratorID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiThermalGenerator(player, (TileThermalGenerator) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.semifluidGeneratorID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiSemifluidGenerator(player,
|
2017-01-07 17:21:14 +01:00
|
|
|
(TileSemifluidGenerator) world.getTileEntity(new BlockPos(x, y, z)));
|
|
|
|
} else if (ID == GuiHandler.gasTurbineID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiGasTurbine(player, (TileGasTurbine) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.quantumTankID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiQuantumTank(player, (TileQuantumTank) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.digitalChestID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiDigitalChest(player, (TileDigitalChest) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.quantumChestID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiQuantumChest(player, (TileQuantumChest) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.centrifugeID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiCentrifuge(player, (TileCentrifuge) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.rollingMachineID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiRollingMachine(player, (TileRollingMachine) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.blastFurnaceID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiBlastFurnace(player, (TileBlastFurnace) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.alloySmelterID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiAlloySmelter(player, (TileAlloySmelter) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.industrialGrinderID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiIndustrialGrinder(player, (TileIndustrialGrinder) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.implosionCompresserID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiImplosionCompressor(player,
|
2017-01-07 17:21:14 +01:00
|
|
|
(TileImplosionCompressor) world.getTileEntity(new BlockPos(x, y, z)));
|
|
|
|
} else if (ID == GuiHandler.matterfabID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiMatterFabricator(player, (TileMatterFabricator) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.chunkloaderID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiChunkLoader(player, (TileChunkLoader) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.assemblingmachineID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiAssemblingMachine(player, (TileAssemblingMachine) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.dieselGeneratorID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiDieselGenerator(player, (TileDieselGenerator) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.industrialElectrolyzerID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiIndustrialElectrolyzer(player,
|
2017-01-07 17:21:14 +01:00
|
|
|
(TileIndustrialElectrolyzer) world.getTileEntity(new BlockPos(x, y, z)));
|
|
|
|
} else if (ID == GuiHandler.aesuID) {
|
2016-03-29 04:47:00 +02:00
|
|
|
return new GuiAESU(player, (TileAesu) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.alloyFurnaceID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiAlloyFurnace(player, (TileAlloyFurnace) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.sawMillID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiIndustrialSawmill(player, (TileIndustrialSawmill) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.chemicalReactorID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiChemicalReactor(player, (TileChemicalReactor) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.manuelID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiManual();
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.destructoPackID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiDestructoPack(new ContainerDestructoPack(player));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.lesuID) {
|
2016-03-29 04:47:00 +02:00
|
|
|
return new GuiLESU(player, (TileLesu) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.idsuID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiIDSU(player, (TileIDSU) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.chargeBench) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiChargeBench(player, (TileChargeBench) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.fusionID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiFusionReactor(player,
|
2017-01-07 17:21:14 +01:00
|
|
|
(TileEntityFusionController) world.getTileEntity(new BlockPos(x, y, z)));
|
|
|
|
} else if (ID == GuiHandler.vacuumFreezerID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiVacuumFreezer(player, (TileVacuumFreezer) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.grinderID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiGrinder(player, (TileGrinder) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.generatorID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiGenerator(player, (TileGenerator) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.extractorID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiExtractor(player, (TileExtractor) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.compressorID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiCompressor(player, (TileCompressor) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.electricFurnaceID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiElectricFurnace(player, (TileElectricFurnace) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.ironFurnace) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiIronFurnace(player, (TileIronFurnace) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.recyclerID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiRecycler(player, (TileRecycler) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.scrapboxinatorID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiScrapboxinator(player, (TileScrapboxinator) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.batboxID) {
|
2016-03-25 10:47:34 +01:00
|
|
|
return new GuiBatbox(player, (TileBatBox) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.mfsuID) {
|
2016-03-27 21:10:49 +02:00
|
|
|
return new GuiMFSU(player, (TileMFSU) world.getTileEntity(new BlockPos(x, y, z)));
|
2017-01-07 17:21:14 +01:00
|
|
|
} else if (ID == GuiHandler.mfeID) {
|
2016-03-28 10:34:48 +02:00
|
|
|
return new GuiMFE(player, (TileMFE) world.getTileEntity(new BlockPos(x, y, z)));
|
|
|
|
}
|
2016-03-25 10:47:34 +01:00
|
|
|
return null;
|
|
|
|
}
|
2015-04-10 00:17:30 +02:00
|
|
|
}
|