Advertisement
MightyDanp

eotGuiHandler

Jul 7th, 2015
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. package com.mightydanp.eot.core.handler;
  2.  
  3. import java.util.HashMap;
  4.  
  5. import com.mightydanp.eot.core.client.gui.container.ContainterEotInventory;
  6. import com.mightydanp.eot.core.client.gui.inventory.TileEntityEotInventory;
  7. import com.mightydanp.eot.core.entities.player.EotPlayerStatus;
  8. import com.mightydanp.eot.lib.GuiIds;
  9.  
  10. import net.minecraft.entity.player.EntityPlayer;
  11. import net.minecraft.tileentity.TileEntity;
  12. import net.minecraft.world.World;
  13. import cpw.mods.fml.common.network.IGuiHandler;
  14.  
  15. public class eotGuiHandler implements IGuiHandler {
  16.  
  17. private static HashMap<Integer, IGuiHandler> serverGuiHandlers = new HashMap<Integer, IGuiHandler>();
  18. private static HashMap<Integer, IGuiHandler> clientGuiHandlers = new HashMap<Integer, IGuiHandler>();
  19.  
  20. public void initialize (){}
  21.  
  22. protected void registerGuiHandler (){}
  23.  
  24. @Override
  25. public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
  26. IGuiHandler handler = serverGuiHandlers.get(ID);
  27. if (handler != null)
  28. return handler.getServerGuiElement(ID, player, world, x, y, z);
  29. return null;
  30.  
  31. }
  32.  
  33. @Override
  34. public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
  35. return null;
  36. }
  37.  
  38. public static void registerServerGuiHandler (int gui, IGuiHandler handler)
  39. {
  40. serverGuiHandlers.put(gui, handler);
  41. }
  42.  
  43. public static void registerClientGuiHandler (int gui, IGuiHandler handler)
  44. {
  45. clientGuiHandlers.put(gui, handler);
  46. }
  47.  
  48. public void updatePlayerStats(EotPlayerStatus stats) {
  49.  
  50. }
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement