Advertisement
Guest User

AssemblyGuiHandler

a guest
Apr 16th, 2014
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.73 KB | None | 0 0
  1. public class AssemblyGuiHandler implements IGuiHandler {
  2.     boolean flag;
  3.  
  4.     public Object getServerGuiElement(int id, EntityPlayer player, World world, int i, int j, int k) {
  5.         try {
  6.             if (id == Assembly.sorterGUI) {
  7.                 TileEntityAssemblySorter tile = (TileEntityAssemblySorter) world.getTileEntity(i, j, k);
  8.                 return new ContainerAssemblySorter(player.inventory, tile, tile);
  9.             }
  10.             if (id == Assembly.furnaceGUI) {
  11.                 TileEntityAssemblyFurnace tile = (TileEntityAssemblyFurnace) world.getTileEntity(i, j, k);
  12.                 return new ContainerAssemblyFurnace(player.inventory, tile);
  13.             }
  14.             if (id == Assembly.workbenchGUI) {
  15.                 return new ContainerAssemblyWorkbench(player.inventory, world, i, j, k);
  16.             }
  17.             if (id == Assembly.counterGUI) {
  18.                 return null;
  19.             }
  20.         } catch (Exception e) {
  21.             e.printStackTrace();
  22.         }
  23.         return null;
  24.     }
  25.  
  26.     public Object getClientGuiElement(int id, EntityPlayer player, World world, int i, int j, int k) {
  27.         try {
  28.             if (id == Assembly.sorterGUI) {
  29.                 TileEntityAssemblySorter tile = (TileEntityAssemblySorter) world.getTileEntity(i, j, k);
  30.                 return new GuiAssemblySorter(tile, player.inventory, tile, tile.nogo);
  31.             }
  32.             if (id == Assembly.furnaceGUI) {
  33.                 TileEntityAssemblyFurnace tile = (TileEntityAssemblyFurnace) world.getTileEntity(i, j, k);
  34.                 return new GuiAssemblyFurnace(player.inventory, tile);
  35.             }
  36.             if (id == Assembly.workbenchGUI) {
  37.                 flag = true;
  38.                 return new GuiAssemblyWorkbench(player.inventory, world, i, j, k);
  39.             }
  40.             if (id == Assembly.counterGUI) {
  41.                 TileEntityAssemblyCounter tile = (TileEntityAssemblyCounter) world.getTileEntity(i, j, k);
  42.                 return new GuiAssemblyCounter(tile);
  43.             }
  44.         } catch (Exception e) {
  45.             e.printStackTrace();
  46.         }
  47.         return null;
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement