More work on the implementation of events

This commit is contained in:
WayofTime 2014-11-07 13:45:02 -05:00
parent dd3a093825
commit 39b4243a82
27 changed files with 217 additions and 259 deletions

View file

@ -185,17 +185,7 @@ public class EnergyItems extends Item implements IBindable
//Global static methods
public static void checkAndSetItemOwner(ItemStack item, EntityPlayer player)
{
if (item.stackTagCompound == null)
{
item.setTagCompound(new NBTTagCompound());
}
if (item.stackTagCompound.getString("ownerName").equals(""))
{
item.stackTagCompound.setString("ownerName", SoulNetworkHandler.getUsername(player));
}
initializePlayer(player);
SoulNetworkHandler.checkAndSetItemOwner(item, player);
}
public static void setItemOwner(ItemStack item, String ownerName)
@ -221,16 +211,6 @@ public class EnergyItems extends Item implements IBindable
}
}
public static void initializePlayer(EntityPlayer player)
{
NBTTagCompound tag = player.getEntityData();
if (tag.getInteger("currentEssence") == 0)
{
tag.setInteger("currentEssence", 0);
}
}
public static String getOwnerName(ItemStack item)
{
if (item.stackTagCompound == null)