Improved the API and internal workings
Update things Fix some more things Update once more Refactoring and removing unnecessary null checks Woops Fix Nother fix Moar fix Fix imports Update ItemBindable.java
This commit is contained in:
parent
0a2dfb4fd4
commit
3e50dd4117
28 changed files with 389 additions and 340 deletions
|
@ -97,7 +97,7 @@ public class ItemBoundSword extends ItemSword implements IBindable, IActivatable
|
|||
|
||||
tooltip.add(TextHelper.localize("tooltip.BloodMagic." + (getActivated(stack) ? "activated" : "deactivated")));
|
||||
|
||||
if (!Strings.isNullOrEmpty(stack.getTagCompound().getString(Constants.NBT.OWNER_UUID)))
|
||||
if (!Strings.isNullOrEmpty(getOwnerUUID(stack)))
|
||||
tooltip.add(TextHelper.localizeEffect("tooltip.BloodMagic.currentOwner", PlayerHelper.getUsernameFromStack(stack)));
|
||||
}
|
||||
|
||||
|
@ -113,20 +113,6 @@ public class ItemBoundSword extends ItemSword implements IBindable, IActivatable
|
|||
return multimap;
|
||||
}
|
||||
|
||||
public boolean getActivated(ItemStack stack)
|
||||
{
|
||||
NBTHelper.checkNBT(stack);
|
||||
return stack.getTagCompound().getBoolean(Constants.NBT.ACTIVATED);
|
||||
}
|
||||
|
||||
public ItemStack setActivatedState(ItemStack stack, boolean activated)
|
||||
{
|
||||
NBTHelper.checkNBT(stack);
|
||||
stack.getTagCompound().setBoolean(Constants.NBT.ACTIVATED, activated);
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ItemMeshDefinition getMeshDefinition()
|
||||
|
@ -169,4 +155,24 @@ public class ItemBoundSword extends ItemSword implements IBindable, IActivatable
|
|||
{
|
||||
return stack != null ? NBTHelper.checkNBT(stack).getTagCompound().getString(Constants.NBT.OWNER_UUID) : null;
|
||||
}
|
||||
|
||||
// IActivatable
|
||||
|
||||
@Override
|
||||
public boolean getActivated(ItemStack stack)
|
||||
{
|
||||
return stack != null && NBTHelper.checkNBT(stack).getTagCompound().getBoolean(Constants.NBT.ACTIVATED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack setActivatedState(ItemStack stack, boolean activated)
|
||||
{
|
||||
if (stack != null)
|
||||
{
|
||||
NBTHelper.checkNBT(stack).getTagCompound().setBoolean(Constants.NBT.ACTIVATED, activated);
|
||||
return stack;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue