2016-03-29 00:14:05 +00:00
|
|
|
package WayofTime.bloodmagic.client.mesh;
|
|
|
|
|
2017-08-15 03:53:42 +00:00
|
|
|
import WayofTime.bloodmagic.BloodMagic;
|
2016-03-29 00:14:05 +00:00
|
|
|
import net.minecraft.client.renderer.ItemMeshDefinition;
|
|
|
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.util.ResourceLocation;
|
|
|
|
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
|
|
|
import WayofTime.bloodmagic.item.soul.ItemSoulGem;
|
2017-08-15 03:53:42 +00:00
|
|
|
import WayofTime.bloodmagic.registry.RegistrarBloodMagicItems;
|
2016-03-29 00:14:05 +00:00
|
|
|
|
|
|
|
public class CustomMeshDefinitionWillGem implements ItemMeshDefinition
|
|
|
|
{
|
|
|
|
private final String name;
|
|
|
|
|
|
|
|
public CustomMeshDefinitionWillGem(String name)
|
|
|
|
{
|
|
|
|
this.name = name;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ModelResourceLocation getModelLocation(ItemStack stack)
|
|
|
|
{
|
2017-08-15 03:53:42 +00:00
|
|
|
if (stack != null && stack.getItem() == RegistrarBloodMagicItems.SOUL_GEM)
|
2016-03-29 00:14:05 +00:00
|
|
|
{
|
|
|
|
EnumDemonWillType type = ((ItemSoulGem) stack.getItem()).getCurrentType(stack);
|
2017-08-15 03:53:42 +00:00
|
|
|
return new ModelResourceLocation(new ResourceLocation(BloodMagic.MODID, "item/" + name), "type=" + ItemSoulGem.names[stack.getItemDamage()] + "_" + type.getName().toLowerCase());
|
2016-03-29 00:14:05 +00:00
|
|
|
}
|
|
|
|
|
2017-08-15 03:53:42 +00:00
|
|
|
return new ModelResourceLocation(new ResourceLocation(BloodMagic.MODID, "item/" + name), "type=petty_default");
|
2016-03-29 00:14:05 +00:00
|
|
|
}
|
|
|
|
}
|