Advertisement
HalestormXV

Untitled

Mar 19th, 2016
86
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.halestormxv.guihandler;
  2.  
  3. import com.halestormxv.blocks.CelestialCraft_blocks;
  4. import com.halestormxv.gui.GuiCelestialForge;
  5. import com.halestormxv.gui.GuiCelestialFurnace;
  6. import com.halestormxv.gui.GuiCelestialKeyPouch;
  7. import com.halestormxv.inventory.ContainerCelestialForge;
  8. import com.halestormxv.inventory.ContainerCelestialFurnace;
  9. import com.halestormxv.inventory.ContainerCelestialKeypouch;
  10. import com.halestormxv.inventory.InventoryKeyPouch;
  11. import com.halestormxv.item.CelestialCraft_items;
  12. import com.halestormxv.item.keyPouch;
  13. import com.halestormxv.tile_entity.TileEntityCelestialFurnace;
  14.  
  15. import cpw.mods.fml.common.network.IGuiHandler;
  16. import net.minecraft.entity.player.EntityPlayer;
  17. import net.minecraft.tileentity.TileEntity;
  18. import net.minecraft.world.World;
  19.  
  20. public class CCGuiHandler implements IGuiHandler {
  21.  
  22.     @Override
  23.     public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
  24.         TileEntity entity = world.getTileEntity(x, y, z);
  25.  
  26.         if(entity != null){
  27.             switch(ID){
  28.             case CelestialCraft_blocks.guiIDCelestialFurnace:
  29.                 if (entity instanceof TileEntityCelestialFurnace){
  30.                     return new ContainerCelestialFurnace(player.inventory, (TileEntityCelestialFurnace) entity);
  31.                 }
  32.                 return null;       
  33.             }
  34.         }
  35.  
  36.         if(ID == CelestialCraft_blocks.guiIDCelestialForge)
  37.         {
  38.             return ID == CelestialCraft_blocks.guiIDCelestialForge && world.getBlock(x, y, z) == CelestialCraft_blocks.blockCelestialForge ? new ContainerCelestialForge(player.inventory, world, x, y, z) : null;
  39.         }
  40.        
  41.         if(ID == CelestialCraft_items.guiIDKeyPouch)
  42.         {
  43.             return new ContainerCelestialKeypouch(player, player.inventory, new InventoryKeyPouch(player.getHeldItem()));
  44.         }
  45.  
  46.         return null;
  47.     }  
  48.  
  49.     @Override
  50.     public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
  51.         TileEntity entity = world.getTileEntity(x, y, z);
  52.  
  53.         if(entity != null){
  54.             switch(ID){
  55.             case CelestialCraft_blocks.guiIDCelestialFurnace:
  56.                 if (entity instanceof TileEntityCelestialFurnace){
  57.                     return new GuiCelestialFurnace(player.inventory, (TileEntityCelestialFurnace) entity);
  58.                 }
  59.                 return null;       
  60.             }
  61.         }
  62.  
  63.         if(ID == CelestialCraft_blocks.guiIDCelestialForge)
  64.         {
  65.             return ID == CelestialCraft_blocks.guiIDCelestialForge && world.getBlock(x, y, z) == CelestialCraft_blocks.blockCelestialForge ? new GuiCelestialForge(player.inventory, world, x, y, z) : null;
  66.         }
  67.        
  68.         if(ID == CelestialCraft_items.guiIDKeyPouch)
  69.         {
  70.             return new GuiCelestialKeyPouch((ContainerCelestialKeypouch) new ContainerCelestialKeypouch(player, player.inventory, new InventoryKeyPouch(player.getHeldItem())));
  71.         }
  72.  
  73.         return null;
  74.     }
  75.  
  76. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement