Implemented the ItemMeshDefinition for the Sentient Sword, allowing for me to make the sword enchantable while still allowing the texture to change. This may be expanded to other items.

This commit is contained in:
WayofTime 2016-01-10 18:31:48 -05:00
parent cb77b7821f
commit 1abae8e4ee
5 changed files with 66 additions and 9 deletions

View file

@ -40,8 +40,7 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon
super(ModItems.soulToolMaterial);
setUnlocalizedName(Constants.Mod.MODID + ".sentientSword");
setHasSubtypes(true);
setNoRepair();
setCreativeTab(BloodMagic.tabBloodMagic);
}
@ -129,14 +128,19 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon
return true;
}
private boolean getActivated(ItemStack stack)
public boolean getActivated(ItemStack stack)
{
return stack.getItemDamage() > 0;
NBTHelper.checkNBT(stack);
NBTTagCompound tag = stack.getTagCompound();
return tag.getBoolean("activated");
}
private ItemStack setActivated(ItemStack stack, boolean activated)
public ItemStack setActivated(ItemStack stack, boolean activated)
{
stack.setItemDamage(activated ? 1 : 0);
NBTHelper.checkNBT(stack);
NBTTagCompound tag = stack.getTagCompound();
tag.setBoolean("activated", activated);
return stack;
}