Guest User

GuiHandler

a guest
Aug 18th, 2017
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. package kyros.testMod.handler;
  2.  
  3. import cpw.mods.fml.common.network.IGuiHandler;
  4. import kyros.testMod.testMod;
  5. import kyros.testMod.container.ContainerCCrafter;
  6. import kyros.testMod.gui.guiCCrafter;
  7. import net.minecraft.client.resources.I18n;
  8. import net.minecraft.entity.player.EntityPlayer;
  9. import net.minecraft.tileentity.TileEntity;
  10. import net.minecraft.world.World;
  11.  
  12. public class GuiHandler implements IGuiHandler {
  13.  
  14. @Override
  15. public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
  16. TileEntity entity = world.getTileEntity(x, y, z);
  17.  
  18. if(entity != null) {
  19.  
  20.  
  21.  
  22. if(ID == testMod.ENUM_IDS.CRafter.ordinal()) {
  23. return new ContainerCCrafter(player.inventory, world, x, y, z);
  24. }
  25. }
  26. return null;
  27. }
  28.  
  29. @Override
  30. public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
  31. TileEntity entity = world.getTileEntity(x, y, z);
  32.  
  33. if(entity != null)
  34. {
  35.  
  36. if(ID == testMod.ENUM_IDS.CRafter.ordinal()) {
  37. return new guiCCrafter(player.inventory, world, x, y, z);
  38. }
  39.  
  40. }
  41. return null;
  42. }
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment