Mrhand3

GuiHandler

Jan 30th, 2014
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. package Mrhand3.SOARYN.Gui;
  2.  
  3. import net.minecraft.client.multiplayer.WorldClient;
  4. import net.minecraft.entity.player.EntityPlayer;
  5. import net.minecraft.world.World;
  6. import Mrhand3.SOARYN.common.BaseMod;
  7. import Mrhand3.SOARYN.mob.EntitySoarynChest;
  8. import cpw.mods.fml.common.network.IGuiHandler;
  9.  
  10. public class GuiHandler implements IGuiHandler
  11. {
  12. @Override
  13. public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
  14. {
  15. if (id != -1)
  16. {
  17. int guiId = BaseMod.guiSoarynChestID;
  18.  
  19. if (guiId == BaseMod.guiSoarynChestID)
  20. {
  21. return new ContainerFossilizer(player.inventory, (EntitySoarynChest)world.getEntityByID(x));
  22. }
  23. }
  24. else
  25. {
  26. return false;
  27. }
  28.  
  29. return null;
  30. }
  31.  
  32. @Override
  33. public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
  34. {
  35. if ((world instanceof WorldClient))
  36. {
  37. if (ID == BaseMod.guiSoarynChestID)
  38. {
  39. return new GuiFossilizer(new ContainerFossilizer(player.inventory, (EntitySoarynChest)world.getEntityByID(x)));
  40. }
  41. }
  42.  
  43. return null;
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment