Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.dagarath.forthedarkness;
- import java.util.HashMap;
- import java.util.Map;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.world.World;
- import cpw.mods.fml.common.network.IGuiHandler;
- import com.dagarath.forthedarkness.client.gui.GuiSkills;
- import com.dagarath.forthedarkness.entity.PlayerSkills;
- public class CommonProxy implements IGuiHandler
- {
- /** Used to store IExtendedEntityProperties data temporarily between player death and respawn or dimension change */
- private static final Map<String, NBTTagCompound> extendedEntityData = new HashMap<String, NBTTagCompound>();
- public void registerRenderers() {}
- @Override
- public Object getServerGuiElement(int guiId, EntityPlayer player, World world, int x, int y, int z) {
- return null;
- }
- @Override
- public Object getClientGuiElement(int guiId, EntityPlayer player, World world, int x, int y, int z) {
- if (guiId == ForTheDarkness.GUI_SKILLS){
- return new GuiSkills();
- }
- else
- return null;
- }
- /**
- * Adds an entity's custom data to the map for temporary storage
- */
- public static void storeEntityData(String name, NBTTagCompound compound) {
- extendedEntityData.put(name, compound);
- }
- /**
- * Removes the compound from the map and returns the NBT tag stored for name or null if none exists
- */
- public static NBTTagCompound getEntityData(String name) {
- return extendedEntityData.remove(name);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement