Guest User

Gui Handler 2

a guest
Nov 17th, 2014
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. package coolalias.inventoryitem;
  2.  
  3. import com.Looke81.BioWarfare.BioWarfare;
  4. import com.Looke81.BioWarfare.container.ContainerMicrobeExtractor;
  5. import com.Looke81.BioWarfare.tileentity.TileEntityMicrobeExtractor;
  6.  
  7. import net.minecraft.entity.player.EntityPlayer;
  8. import net.minecraft.tileentity.TileEntity;
  9. import net.minecraft.world.World;
  10. import cpw.mods.fml.common.network.IGuiHandler;
  11.  
  12. public class GuiHandler2 implements IGuiHandler
  13. {
  14. public void registerRenderers() {}
  15.  
  16. @Override
  17. public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z){
  18.  
  19. if (ID == BioWarfare.GUI_ITEM_INV) {
  20. // Use the player's held item to create the inventory
  21. return new ContainerItem(player, player.inventory, new InventoryItem(player.getHeldItem()));
  22.  
  23. }
  24. return null;
  25.  
  26. }
  27. @Override
  28. public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z){
  29.  
  30.  
  31. if (ID == BioWarfare.GUI_ITEM_INV) {
  32. // Use the player's held item to create the inventory
  33. return new ContainerItem(player, player.inventory, new InventoryItem(player.getHeldItem()));
  34.  
  35. }
  36. return null;
  37.  
  38. }
  39.  
  40.  
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment