Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CommonProxy implements IGuiHandler{
- public static final int GUI_TUNNELER = 1;
- public static final int GUI_KINETIC_RELOCATOR = 2;
- public static final int GUI_TELEPORTER = 3;
- public void registerRenders(){}
- public EntityPlayer getPlayerEntity(MessageContext ctx){
- return ctx.getServerHandler().playerEntity;
- }
- public IThreadListener getThreadFromContext(MessageContext ctx){
- return ctx.getServerHandler().playerEntity.getServerForPlayer();
- }
- public void initial(){
- NetworkRegistry.INSTANCE.registerGuiHandler(EnergyTools.EnergyTools.instance, new CommonProxy());
- }
- @Override
- public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
- switch(ID){
- case(GUI_TUNNELER):{
- return new ContainerItem(player, player.inventory, new InventoryItem(player.getHeldItem()));
- }
- case(GUI_KINETIC_RELOCATOR):{
- return new ContainerKineticRelocator(player.inventory, (KineticRelocatorTileEntity) world.getTileEntity(new BlockPos(x,y,z)));
- }
- case(GUI_TELEPORTER):{
- return new ContainerTeleporterBlock(player.inventory, (TeleporterTE) world.getTileEntity(new BlockPos(x,y,z)));
- }
- }
- return null;
- }
- @Override
- public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
- switch(ID){
- case(GUI_TUNNELER):{
- return new GuiItemInventory((ContainerItem) new ContainerItem(player, player.inventory, new InventoryItem(player.getHeldItem())));
- }
- case(GUI_KINETIC_RELOCATOR):{
- return new GuiKineticRelocator(player.inventory, (KineticRelocatorTileEntity) world.getTileEntity(new BlockPos(x,y,z)));
- }
- case(GUI_TELEPORTER):{
- return new GuiTeleporterBlock(player.inventory, (TeleporterTE) world.getTileEntity(new BlockPos(x,y,z)));
- }
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement