TechReborn/src/main/java/techreborn/client/GuiHandler.java

215 lines
11 KiB
Java
Raw Normal View History

2015-04-10 00:17:30 +02:00
package techreborn.client;
2015-07-02 20:51:24 +02:00
import cpw.mods.fml.common.network.IGuiHandler;
2015-04-10 00:17:30 +02:00
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import techreborn.client.container.*;
import techreborn.client.gui.*;
import techreborn.pda.GuiManual;
import techreborn.tiles.*;
import techreborn.tiles.fusionReactor.TileEntityFusionController;
import techreborn.tiles.idsu.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 {
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 grinderID = 7;
public static final int compresserID = 8;
public static final int matterfabID = 9;
public static final int pdaID = 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;
2015-06-14 17:42:03 +02:00
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;
@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);
} else if (ID == semifluidGeneratorID) {
return new ContainerSemifluidGenerator(
(TileSemifluidGenerator) world.getTileEntity(x, y, z), player);
} else if (ID == gasTurbineID) {
return new ContainerGasTurbine(
(TileGasTurbine) world.getTileEntity(x, y, z), player);
} else if (ID == quantumTankID) {
return new ContainerQuantumTank(
(TileQuantumTank) world.getTileEntity(x, y, z), player);
} else if (ID == digitalChestID) {
return new ContainerDigitalChest(
(TileDigitalChest) world.getTileEntity(x, y, z), player);
} 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);
} else if (ID == alloySmelterID) {
return new ContainerAlloySmelter(
(TileAlloySmelter) world.getTileEntity(x, y, z), player);
} 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);
} else if (ID == chunkloaderID) {
return new ContainerChunkloader(
(TileChunkLoader) world.getTileEntity(x, y, z), player);
} else if (ID == assemblingmachineID) {
return new ContainerAssemblingMachine(
(TileAssemblingMachine) world.getTileEntity(x, y, z), player);
2015-11-08 13:15:45 +01:00
} else if (ID == dieselGeneratorID) {
return new ContainerDieselGenerator(
(TileDieselGenerator) world.getTileEntity(x, y, z), player);
} else if (ID == industrialElectrolyzerID) {
return new ContainerIndustrialElectrolyzer(
(TileIndustrialElectrolyzer) world.getTileEntity(x, y, z), player);
} else if (ID == aesuID) {
return new ContainerAesu(
(TileAesu) world.getTileEntity(x, y, z), player);
} else if (ID == alloyFurnaceID) {
return new ContainerAlloyFurnace(
(TileAlloyFurnace) world.getTileEntity(x, y, z), player);
} else if (ID == sawMillID) {
return new ContainerIndustrialSawmill(
(TileIndustrialSawmill) world.getTileEntity(x, y, z), player);
} else if (ID == chemicalReactorID) {
return new ContainerChemicalReactor(
(TileChemicalReactor) world.getTileEntity(x, y, z), player);
} else if (ID == pdaID) {
return null;
} else if (ID == destructoPackID) {
return new ContainerDestructoPack(player);
} else if (ID == lesuID) {
2015-06-14 17:42:03 +02:00
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);
} else if (ID == chargeBench) {
return new ContainerChargeBench((TileChargeBench) world.getTileEntity(x, y, z), player);
} else if (ID == fusionID) {
return new ContainerFusionReactor((TileEntityFusionController) world.getTileEntity(x, y, z), player);
}else if (ID == vacuumFreezerID) {
return new ContainerVacuumFreezer((TileVacuumFreezer) world.getTileEntity(x, y, z), player);
}
2015-04-11 11:37:47 +02:00
2015-04-10 00:17:30 +02:00
return null;
}
@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));
} else if (ID == semifluidGeneratorID) {
return new GuiSemifluidGenerator(player,
(TileSemifluidGenerator) world.getTileEntity(x, y, z));
} else if (ID == gasTurbineID) {
return new GuiGasTurbine(player,
(TileGasTurbine) world.getTileEntity(x, y, z));
} else if (ID == quantumTankID) {
return new GuiQuantumTank(player,
(TileQuantumTank) world.getTileEntity(x, y, z));
} else if (ID == digitalChestID) {
return new GuiDigitalChest(player,
(TileDigitalChest) world.getTileEntity(x, y, z));
} 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));
} else if (ID == alloySmelterID) {
return new GuiAlloySmelter(player,
(TileAlloySmelter) world.getTileEntity(x, y, z));
} 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));
} else if (ID == chunkloaderID) {
return new GuiChunkLoader(player,
(TileChunkLoader) world.getTileEntity(x, y, z));
} else if (ID == assemblingmachineID) {
return new GuiAssemblingMachine(player,
(TileAssemblingMachine) world.getTileEntity(x, y, z));
2015-11-08 13:15:45 +01:00
} else if (ID == dieselGeneratorID) {
return new GuiDieselGenerator(player,
(TileDieselGenerator) world.getTileEntity(x, y, z));
} else if (ID == industrialElectrolyzerID) {
return new GuiIndustrialElectrolyzer(player,
(TileIndustrialElectrolyzer) world.getTileEntity(x, y, z));
} else if (ID == aesuID) {
return new GuiAesu(player,
(TileAesu) world.getTileEntity(x, y, z));
} else if (ID == alloyFurnaceID) {
return new GuiAlloyFurnace(player,
(TileAlloyFurnace) world.getTileEntity(x, y, z));
} else if (ID == sawMillID) {
return new GuiIndustrialSawmill(player,
(TileIndustrialSawmill) world.getTileEntity(x, y, z));
} else if (ID == chemicalReactorID) {
return new GuiChemicalReactor(player,
(TileChemicalReactor) world.getTileEntity(x, y, z));
} else if (ID == pdaID) {
return new GuiManual();
} else if (ID == destructoPackID) {
return new GuiDestructoPack(new ContainerDestructoPack(player));
} 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));
} else if (ID == chargeBench) {
return new GuiChargeBench(player, (TileChargeBench) world.getTileEntity(x, y, z));
}else if (ID == fusionID) {
return new GuiFusionReactor(player, (TileEntityFusionController) world.getTileEntity(x, y, z));
}else if (ID == vacuumFreezerID) {
return new GuiVacuumFreezer(player, (TileVacuumFreezer) world.getTileEntity(x, y, z));
}
return null;
}
2015-04-10 00:17:30 +02:00
}