mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-27 15:23:06 +00:00
More work on the implementation of events
This commit is contained in:
1 parent
dd3a093825
commit
39b4243a82
27 files changed
+217
-259
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user