More work on the implementation of events
This commit is contained in:
parent
dd3a093825
commit
39b4243a82
27 changed files with 217 additions and 259 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue