Advertisement
Guest User

Untitled

a guest
Jul 29th, 2017
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. package com.mod.drakania.items;
  2.  
  3. import net.minecraft.entity.player.EntityPlayer;
  4. import net.minecraft.world.World;
  5.  
  6. import com.mod.drakania.inventory.ContainerBackPack;
  7. import com.mod.drakania.inventory.InventoryBackPack;
  8. import com.mod.drakania.items.GuiBackPack;
  9. import com.mod.drakania.items.ItemBackPack;
  10.  
  11. import cpw.mods.fml.common.network.IGuiHandler;
  12.  
  13. /**
  14. * @author SCAREX
  15. *
  16. */
  17. public class EmotionGuiHandler implements IGuiHandler
  18. {
  19. @Override
  20. public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
  21. switch (ID) {
  22. case 0:
  23. // The last parameter must be a multiple of 9 (e.g: 9, 18, 27, 54)
  24. // Condition to check if the player has the right item in hand
  25. if (player.getHeldItem() == null || !(player.getHeldItem().getItem() instanceof ItemBackPack)) return null;
  26. return new ContainerBackPack(player.inventory, new InventoryBackPack(player.getHeldItem(), 54));
  27. }
  28. return null;
  29. }
  30.  
  31. @Override
  32. public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
  33. switch (ID) {
  34. case 0:
  35. // The last parameter must be a multiple of 9 (e.g: 9, 18, 27, 54)
  36. // Condition to check if the player has the right item in hand
  37. if (player.getHeldItem() == null || !(player.getHeldItem().getItem() instanceof ItemBackPack)) return null;
  38. return new GuiBackPack(player.inventory, new InventoryBackPack(player.getHeldItem(), 54));
  39. }
  40. return null;
  41. }
  42.  
  43. public void registerRenders()
  44. {
  45. // TODO Auto-generated method stub
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement