Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2016
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. public class GuiHandler implements IGuiHandler
  2. {
  3. public static final int CARD_VIEWER_GUI = 0;
  4. public static final int DUEL_FIELD_GUI = 1;
  5. public static final int DECK_GUI = 2;
  6. public static final int DUEL_GUI = 3;
  7.  
  8. @Override
  9. public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
  10. {
  11. if (ID == GuiHandler.CARD_VIEWER_GUI)
  12. {
  13. TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
  14. if(tile instanceof TileEntityCardViewer)
  15. {
  16. return new ContainerCardViewer(world, player.inventory, (TileEntityCardViewer) tile);
  17. }
  18.  
  19. }
  20. else if(ID == GuiHandler.DUEL_FIELD_GUI)
  21. {
  22. TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
  23. if(tile instanceof TileEntityDuelField)
  24. {
  25. return new ContainerDuelField(player.inventory, (TileEntityDuelField) tile);
  26. }
  27. }
  28. else if(ID == GuiHandler.DECK_GUI)
  29. {
  30. return new ContainerDeck(player.inventory, player);
  31. }
  32. else if(ID == GuiHandler.DUEL_GUI)
  33. {
  34. TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
  35. return new ContainerDuel(player, (TileEntityDuelField) tile);
  36. }
  37. return null;
  38. }
  39.  
  40. @Override
  41. public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
  42. {
  43. if (ID == GuiHandler.CARD_VIEWER_GUI)
  44. {
  45. TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
  46. if(tile instanceof TileEntityCardViewer)
  47. {
  48. return new GuiCardViewer(world, player.inventory, (TileEntityCardViewer) tile);
  49. }
  50.  
  51. }
  52. else if(ID == GuiHandler.DUEL_FIELD_GUI)
  53. {
  54. TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
  55. if(tile instanceof TileEntityDuelField)
  56. {
  57. return new GuiDuelField(player.inventory, (TileEntityDuelField) tile);
  58. }
  59.  
  60. }
  61. else if(ID == GuiHandler.DECK_GUI)
  62. {
  63. return new GuiDeck(player.inventory, player);
  64. }
  65. else if(ID == GuiHandler.DUEL_GUI)
  66. {
  67. TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
  68. return new GuiDuel(player, (TileEntityDuelField) tile);
  69. }
  70. return null;
  71. }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement