2015-04-10 00:17:30 +02:00
|
|
|
package techreborn.client;
|
|
|
|
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2015-05-22 22:15:19 +02:00
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2015-04-10 00:17:30 +02:00
|
|
|
import net.minecraft.world.World;
|
2015-06-14 17:42:03 +02:00
|
|
|
import techreborn.client.container.*;
|
|
|
|
import techreborn.client.gui.*;
|
2015-04-18 22:24:49 +02:00
|
|
|
import techreborn.pda.GuiPda;
|
2015-05-22 22:15:19 +02:00
|
|
|
import techreborn.tiles.*;
|
2015-04-24 15:20:09 +02:00
|
|
|
import cpw.mods.fml.common.network.IGuiHandler;
|
2015-06-16 14:38:46 +02:00
|
|
|
import techreborn.tiles.iesu.TileIDSU;
|
2015-06-14 17:42:03 +02:00
|
|
|
import techreborn.tiles.lesu.TileLesu;
|
2015-04-10 00:17:30 +02:00
|
|
|
|
|
|
|
public class GuiHandler implements IGuiHandler {
|
|
|
|
|
2015-04-24 15:20:09 +02: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;
|
2015-04-24 16:01:19 +02:00
|
|
|
public static final int alloySmelterID = 6;
|
2015-04-28 18:58:01 +02:00
|
|
|
public static final int grinderID = 7;
|
|
|
|
public static final int compresserID = 8;
|
|
|
|
public static final int matterfabID = 9;
|
|
|
|
public static final int pdaID = 10;
|
2015-04-28 22:41:10 +02:00
|
|
|
public static final int chunkloaderID = 11;
|
2015-05-08 00:39:26 +02:00
|
|
|
public static final int assemblingmachineID = 12;
|
2015-05-08 01:15:04 +02:00
|
|
|
public static final int latheID = 13;
|
2015-05-08 01:30:59 +02:00
|
|
|
public static final int platecuttingmachineID = 14;
|
2015-05-09 00:02:35 +02:00
|
|
|
public static final int dieselGeneratorID = 15;
|
2015-05-09 20:13:43 +02:00
|
|
|
public static final int industrialElectrolyzerID = 16;
|
2015-05-09 21:19:40 +02:00
|
|
|
public static final int aesuID =17;
|
2015-05-10 20:00:58 +02:00
|
|
|
public static final int alloyFurnaceID = 18;
|
2015-05-11 18:04:27 +02:00
|
|
|
public static final int sawMillID = 19;
|
2015-05-12 01:17:17 +02:00
|
|
|
public static final int chemicalReactorID = 20;
|
2015-06-05 05:34:04 +02:00
|
|
|
public static final int semifluidGeneratorID = 21;
|
2015-06-05 22:24:52 +02:00
|
|
|
public static final int gasTurbineID = 22;
|
2015-06-07 04:11:13 +02:00
|
|
|
public static final int digitalChestID = 23;
|
2015-06-14 01:21:03 +02:00
|
|
|
public static final int destructoPackID = 25;
|
2015-06-14 17:42:03 +02:00
|
|
|
public static final int lesuID = 26;
|
2015-06-16 14:38:46 +02:00
|
|
|
public static final int idsuID = 27;
|
2015-06-14 01:21:03 +02:00
|
|
|
|
2015-04-24 15:20:09 +02:00
|
|
|
@Override
|
|
|
|
public Object getServerGuiElement(int ID, EntityPlayer player, World world,
|
|
|
|
int x, int y, int z)
|
|
|
|
{
|
|
|
|
if (ID == thermalGeneratorID)
|
|
|
|
{
|
|
|
|
return new ContainerThermalGenerator(
|
|
|
|
(TileThermalGenerator) world.getTileEntity(x, y, z), player);
|
2015-06-05 05:34:04 +02:00
|
|
|
} else if (ID == semifluidGeneratorID)
|
|
|
|
{
|
|
|
|
return new ContainerSemifluidGenerator(
|
|
|
|
(TileSemifluidGenerator) world.getTileEntity(x, y, z), player);
|
2015-06-05 22:24:52 +02:00
|
|
|
} else if (ID == gasTurbineID)
|
|
|
|
{
|
|
|
|
return new ContainerGasTurbine(
|
|
|
|
(TileGasTurbine) world.getTileEntity(x, y, z), player);
|
2015-04-24 15:20:09 +02:00
|
|
|
} else if (ID == quantumTankID)
|
|
|
|
{
|
|
|
|
return new ContainerQuantumTank(
|
|
|
|
(TileQuantumTank) world.getTileEntity(x, y, z), player);
|
2015-06-07 04:11:13 +02:00
|
|
|
} else if (ID == digitalChestID)
|
|
|
|
{
|
|
|
|
return new ContainerDigitalChest(
|
|
|
|
(TileDigitalChest) world.getTileEntity(x, y, z), player);
|
2015-04-24 15:20:09 +02:00
|
|
|
} else if (ID == quantumChestID)
|
|
|
|
{
|
|
|
|
return new ContainerQuantumChest(
|
|
|
|
(TileQuantumChest) world.getTileEntity(x, y, z), player);
|
|
|
|
} else if (ID == centrifugeID)
|
|
|
|
{
|
|
|
|
return new ContainerCentrifuge(
|
|
|
|
(TileCentrifuge) world.getTileEntity(x, y, z), player);
|
|
|
|
} else if (ID == rollingMachineID)
|
|
|
|
{
|
|
|
|
return new ContainerRollingMachine(
|
|
|
|
(TileRollingMachine) world.getTileEntity(x, y, z), player);
|
|
|
|
} else if (ID == blastFurnaceID)
|
|
|
|
{
|
|
|
|
return new ContainerBlastFurnace(
|
|
|
|
(TileBlastFurnace) world.getTileEntity(x, y, z), player);
|
2015-04-24 16:01:19 +02:00
|
|
|
} else if (ID == alloySmelterID)
|
|
|
|
{
|
|
|
|
return new ContainerAlloySmelter(
|
|
|
|
(TileAlloySmelter) world.getTileEntity(x, y, z), player);
|
2015-04-28 18:58:01 +02:00
|
|
|
} else if (ID == grinderID)
|
|
|
|
{
|
|
|
|
return new ContainerGrinder(
|
|
|
|
(TileGrinder) world.getTileEntity(x, y, z), player);
|
|
|
|
} else if (ID == compresserID)
|
|
|
|
{
|
|
|
|
return new ContainerImplosionCompressor(
|
|
|
|
(TileImplosionCompressor) world.getTileEntity(x, y, z), player);
|
|
|
|
} else if (ID == matterfabID)
|
|
|
|
{
|
|
|
|
return new ContainerMatterFabricator(
|
|
|
|
(TileMatterFabricator) world.getTileEntity(x, y, z), player);
|
2015-04-28 22:41:10 +02:00
|
|
|
} else if (ID == chunkloaderID)
|
|
|
|
{
|
|
|
|
return new ContainerChunkloader(
|
|
|
|
(TileChunkLoader) world.getTileEntity(x, y, z), player);
|
2015-05-08 00:39:26 +02:00
|
|
|
} else if (ID == assemblingmachineID)
|
|
|
|
{
|
|
|
|
return new ContainerAssemblingMachine(
|
|
|
|
(TileAssemblingMachine) world.getTileEntity(x, y, z), player);
|
2015-05-08 01:15:04 +02:00
|
|
|
} else if (ID == latheID)
|
|
|
|
{
|
|
|
|
return new ContainerLathe(
|
|
|
|
(TileLathe) world.getTileEntity(x, y, z), player);
|
2015-05-08 01:30:59 +02:00
|
|
|
} else if (ID == platecuttingmachineID)
|
|
|
|
{
|
|
|
|
return new ContainerPlateCuttingMachine(
|
|
|
|
(TilePlateCuttingMachine) world.getTileEntity(x, y, z), player);
|
2015-05-09 00:02:35 +02:00
|
|
|
} else if (ID == dieselGeneratorID)
|
|
|
|
{
|
|
|
|
return new ContainerDieselGenerator(
|
|
|
|
(TileDieselGenerator) world.getTileEntity(x, y, z), player);
|
2015-05-09 20:13:43 +02:00
|
|
|
} else if (ID == industrialElectrolyzerID)
|
|
|
|
{
|
|
|
|
return new ContainerIndustrialElectrolyzer(
|
|
|
|
(TileIndustrialElectrolyzer) world.getTileEntity(x, y, z), player);
|
2015-05-09 21:19:40 +02:00
|
|
|
} else if (ID == aesuID)
|
|
|
|
{
|
|
|
|
return new ContainerAesu(
|
|
|
|
(TileAesu) world.getTileEntity(x, y, z), player);
|
2015-05-10 20:00:58 +02:00
|
|
|
} else if (ID == alloyFurnaceID)
|
|
|
|
{
|
|
|
|
return new ContainerAlloyFurnace(
|
|
|
|
(TileAlloyFurnace) world.getTileEntity(x, y, z), player);
|
2015-05-11 18:04:27 +02:00
|
|
|
} else if (ID == sawMillID)
|
|
|
|
{
|
|
|
|
return new ContainerIndustrialSawmill(
|
2015-05-12 01:17:17 +02:00
|
|
|
(TileIndustrialSawmill) world.getTileEntity(x, y, z), player);
|
|
|
|
} else if (ID == chemicalReactorID)
|
|
|
|
{
|
|
|
|
return new ContainerChemicalReactor(
|
|
|
|
(TileChemicalReactor) world.getTileEntity(x, y, z), player);
|
2015-04-24 15:20:09 +02:00
|
|
|
} else if (ID == pdaID)
|
|
|
|
{
|
|
|
|
return null;
|
2015-06-14 01:21:03 +02:00
|
|
|
} else if (ID == destructoPackID) {
|
|
|
|
return new ContainerDestructoPack(player);
|
2015-06-14 17:42:03 +02:00
|
|
|
} else if (ID == lesuID) {
|
|
|
|
return new ContainerLesu((TileLesu) world.getTileEntity(x, y, z), player);
|
2015-06-16 14:38:46 +02:00
|
|
|
} else if (ID == idsuID) {
|
|
|
|
return new ContainerIDSU((TileIDSU) world.getTileEntity(x, y, z), player);
|
|
|
|
}
|
2015-04-11 11:37:47 +02:00
|
|
|
|
2015-04-24 15:20:09 +02:00
|
|
|
return null;
|
|
|
|
}
|
2015-04-10 00:17:30 +02:00
|
|
|
|
2015-04-24 15:20:09 +02:00
|
|
|
@Override
|
|
|
|
public Object getClientGuiElement(int ID, EntityPlayer player, World world,
|
|
|
|
int x, int y, int z)
|
|
|
|
{
|
|
|
|
if (ID == thermalGeneratorID)
|
|
|
|
{
|
|
|
|
return new GuiThermalGenerator(player,
|
|
|
|
(TileThermalGenerator) world.getTileEntity(x, y, z));
|
2015-06-05 05:34:04 +02:00
|
|
|
} else if (ID == semifluidGeneratorID)
|
|
|
|
{
|
|
|
|
return new GuiSemifluidGenerator(player,
|
|
|
|
(TileSemifluidGenerator) world.getTileEntity(x, y, z));
|
2015-06-05 22:24:52 +02:00
|
|
|
} else if (ID == gasTurbineID)
|
|
|
|
{
|
|
|
|
return new GuiGasTurbine(player,
|
|
|
|
(TileGasTurbine) world.getTileEntity(x, y, z));
|
|
|
|
} else if (ID == quantumTankID)
|
2015-04-24 15:20:09 +02:00
|
|
|
{
|
|
|
|
return new GuiQuantumTank(player,
|
|
|
|
(TileQuantumTank) world.getTileEntity(x, y, z));
|
2015-06-07 04:11:13 +02:00
|
|
|
} else if (ID == digitalChestID)
|
|
|
|
{
|
|
|
|
return new GuiDigitalChest(player,
|
|
|
|
(TileDigitalChest) world.getTileEntity(x, y, z));
|
2015-04-24 15:20:09 +02:00
|
|
|
} else if (ID == quantumChestID)
|
|
|
|
{
|
|
|
|
return new GuiQuantumChest(player,
|
|
|
|
(TileQuantumChest) world.getTileEntity(x, y, z));
|
|
|
|
} else if (ID == centrifugeID)
|
|
|
|
{
|
|
|
|
return new GuiCentrifuge(player,
|
|
|
|
(TileCentrifuge) world.getTileEntity(x, y, z));
|
|
|
|
} else if (ID == rollingMachineID)
|
|
|
|
{
|
|
|
|
return new GuiRollingMachine(player,
|
|
|
|
(TileRollingMachine) world.getTileEntity(x, y, z));
|
|
|
|
} else if (ID == blastFurnaceID)
|
|
|
|
{
|
|
|
|
return new GuiBlastFurnace(player,
|
|
|
|
(TileBlastFurnace) world.getTileEntity(x, y, z));
|
2015-04-24 16:01:19 +02:00
|
|
|
} else if (ID == alloySmelterID)
|
|
|
|
{
|
|
|
|
return new GuiAlloySmelter(player,
|
|
|
|
(TileAlloySmelter) world.getTileEntity(x, y, z));
|
2015-04-28 18:58:01 +02:00
|
|
|
} else if (ID == grinderID)
|
|
|
|
{
|
|
|
|
return new GuiGrinder(player,
|
|
|
|
(TileGrinder) world.getTileEntity(x, y, z));
|
|
|
|
} else if (ID == compresserID)
|
|
|
|
{
|
|
|
|
return new GuiImplosionCompressor(player,
|
|
|
|
(TileImplosionCompressor) world.getTileEntity(x, y, z));
|
|
|
|
} else if (ID == matterfabID)
|
|
|
|
{
|
|
|
|
return new GuiMatterFabricator(player,
|
|
|
|
(TileMatterFabricator) world.getTileEntity(x, y, z));
|
2015-04-28 22:41:10 +02:00
|
|
|
} else if (ID == chunkloaderID)
|
|
|
|
{
|
|
|
|
return new GuiChunkLoader(player,
|
|
|
|
(TileChunkLoader) world.getTileEntity(x, y, z));
|
2015-05-08 00:39:26 +02:00
|
|
|
} else if (ID == assemblingmachineID)
|
|
|
|
{
|
|
|
|
return new GuiAssemblingMachine(player,
|
|
|
|
(TileAssemblingMachine) world.getTileEntity(x, y, z));
|
2015-05-08 01:15:04 +02:00
|
|
|
} else if (ID == latheID)
|
|
|
|
{
|
|
|
|
return new GuiLathe(player,
|
|
|
|
(TileLathe) world.getTileEntity(x, y, z));
|
2015-05-08 01:30:59 +02:00
|
|
|
} else if (ID == platecuttingmachineID)
|
|
|
|
{
|
|
|
|
return new GuiPlateCuttingMachine(player,
|
|
|
|
(TilePlateCuttingMachine) world.getTileEntity(x, y, z));
|
2015-05-09 00:02:35 +02:00
|
|
|
} else if (ID == dieselGeneratorID)
|
|
|
|
{
|
|
|
|
return new GuiDieselGenerator(player,
|
|
|
|
(TileDieselGenerator) world.getTileEntity(x, y, z));
|
2015-05-09 20:13:43 +02:00
|
|
|
} else if (ID == industrialElectrolyzerID)
|
|
|
|
{
|
|
|
|
return new GuiIndustrialElectrolyzer(player,
|
|
|
|
(TileIndustrialElectrolyzer) world.getTileEntity(x, y, z));
|
2015-05-09 21:19:40 +02:00
|
|
|
} else if (ID == aesuID)
|
|
|
|
{
|
|
|
|
return new GuiAesu(player,
|
|
|
|
(TileAesu) world.getTileEntity(x, y, z));
|
2015-05-10 20:00:58 +02:00
|
|
|
} else if (ID == alloyFurnaceID)
|
|
|
|
{
|
|
|
|
return new GuiAlloyFurnace(player,
|
|
|
|
(TileAlloyFurnace) world.getTileEntity(x, y, z));
|
2015-05-11 18:04:27 +02:00
|
|
|
} else if (ID == sawMillID)
|
|
|
|
{
|
|
|
|
return new GuiIndustrialSawmill(player,
|
|
|
|
(TileIndustrialSawmill) world.getTileEntity(x, y, z));
|
2015-05-12 01:17:17 +02:00
|
|
|
} else if (ID == chemicalReactorID)
|
|
|
|
{
|
|
|
|
return new GuiChemicalReactor(player,
|
|
|
|
(TileChemicalReactor) world.getTileEntity(x, y, z));
|
2015-04-24 15:20:09 +02:00
|
|
|
} else if (ID == pdaID)
|
|
|
|
{
|
|
|
|
return new GuiPda(player);
|
2015-06-14 01:21:03 +02:00
|
|
|
} else if (ID == destructoPackID) {
|
|
|
|
return new GuiDestructoPack(new ContainerDestructoPack(player));
|
2015-06-14 17:42:03 +02:00
|
|
|
} else if (ID == lesuID) {
|
|
|
|
return new GuiLesu(player, (TileLesu)world.getTileEntity(x, y, z));
|
2015-06-16 14:38:46 +02:00
|
|
|
} else if (ID == idsuID) {
|
|
|
|
return new GuiIDSU(player, (TileIDSU)world.getTileEntity(x, y, z));
|
|
|
|
}
|
2015-04-24 15:20:09 +02:00
|
|
|
return null;
|
|
|
|
}
|
2015-04-10 00:17:30 +02:00
|
|
|
}
|