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

@ -0,0 +1,25 @@
package WayofTime.bloodmagic.client.mesh;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.ItemStack;
import WayofTime.bloodmagic.item.soul.ItemSentientSword;
public class ItemSentientSwordMeshDefinition implements ItemMeshDefinition
{
@Override
public ModelResourceLocation getModelLocation(ItemStack stack)
{
if (stack != null && stack.getItem() instanceof ItemSentientSword)
{
if (((ItemSentientSword) stack.getItem()).getActivated(stack))
{
return new ModelResourceLocation("bloodmagic:ItemSentientSword1", "inventory");
} else
{
return new ModelResourceLocation("bloodmagic:ItemSentientSword0", "inventory");
}
}
return null;
}
}