Advertisement
Guest User

CommonProxy

a guest
Jun 23rd, 2014
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. package com.dagarath.forthedarkness;
  2.  
  3.  
  4. import java.util.HashMap;
  5. import java.util.Map;
  6.  
  7. import net.minecraft.entity.player.EntityPlayer;
  8. import net.minecraft.nbt.NBTTagCompound;
  9. import net.minecraft.world.World;
  10. import cpw.mods.fml.common.network.IGuiHandler;
  11.  
  12. import com.dagarath.forthedarkness.client.gui.GuiSkills;
  13. import com.dagarath.forthedarkness.entity.PlayerSkills;
  14.  
  15.  
  16.  
  17. public class CommonProxy implements IGuiHandler
  18. {
  19. /** Used to store IExtendedEntityProperties data temporarily between player death and respawn or dimension change */
  20. private static final Map<String, NBTTagCompound> extendedEntityData = new HashMap<String, NBTTagCompound>();
  21.  
  22. public void registerRenderers() {}
  23.  
  24. @Override
  25. public Object getServerGuiElement(int guiId, EntityPlayer player, World world, int x, int y, int z) {
  26. return null;
  27. }
  28.  
  29. @Override
  30. public Object getClientGuiElement(int guiId, EntityPlayer player, World world, int x, int y, int z) {
  31.  
  32. if (guiId == ForTheDarkness.GUI_SKILLS){
  33. return new GuiSkills();
  34. }
  35. else
  36. return null;
  37. }
  38.  
  39. /**
  40. * Adds an entity's custom data to the map for temporary storage
  41. */
  42. public static void storeEntityData(String name, NBTTagCompound compound) {
  43. extendedEntityData.put(name, compound);
  44. }
  45.  
  46. /**
  47. * Removes the compound from the map and returns the NBT tag stored for name or null if none exists
  48. */
  49. public static NBTTagCompound getEntityData(String name) {
  50. return extendedEntityData.remove(name);
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement