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

53 lines
2.2 KiB
Java
Raw Normal View History

2015-04-10 00:17:30 +02:00
package techreborn.client;
2015-04-15 17:23:12 +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;
2015-04-15 17:23:12 +02:00
import techreborn.client.container.*;
import techreborn.client.gui.*;
import techreborn.tiles.*;
2015-04-10 00:17:30 +02:00
public class GuiHandler implements IGuiHandler {
public static final int thermalGeneratorID = 0;
2015-04-11 11:37:47 +02:00
public static final int quantumTankID = 1;
2015-04-11 12:30:16 +02:00
public static final int quantumChestID = 2;
public static final int centrifugeID = 3;
2015-04-15 17:23:12 +02:00
public static final int rollingMachineID = 4;
2015-04-11 11:37:47 +02:00
2015-04-10 00:17:30 +02:00
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
2015-04-15 17:23:12 +02:00
if (ID == thermalGeneratorID) {
2015-04-10 00:17:30 +02:00
return new ContainerThermalGenerator((TileThermalGenerator) world.getTileEntity(x, y, z), player);
2015-04-15 17:23:12 +02:00
} else if (ID == quantumTankID) {
2015-04-11 11:37:47 +02:00
return new ContainerQuantumTank((TileQuantumTank) world.getTileEntity(x, y, z), player);
2015-04-15 17:23:12 +02:00
} else if (ID == quantumChestID) {
2015-04-11 12:30:16 +02:00
return new ContainerQuantumChest((TileQuantumChest) world.getTileEntity(x, y, z), player);
2015-04-15 17:23:12 +02:00
} else if (ID == centrifugeID) {
return new ContainerCentrifuge((TileCentrifuge) world.getTileEntity(x, y, z), player);
2015-04-15 17:23:12 +02:00
} else if (ID == rollingMachineID) {
2015-04-14 01:12:24 +02:00
return new ContainerRollingMachine((TileRollingMachine) world.getTileEntity(x, y, z), player);
2015-04-10 00:17:30 +02:00
}
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) {
2015-04-15 17:23:12 +02:00
if (ID == thermalGeneratorID) {
return new GuiThermalGenerator(player, (TileThermalGenerator) world.getTileEntity(x, y, z));
} else if (ID == quantumTankID) {
return new GuiQuantumTank(player, (TileQuantumTank) 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));
2015-04-10 00:17:30 +02:00
}
return null;
}
}