BloodMagic/src/main/java/WayofTime/bloodmagic/client/mesh/CustomMeshDefinitionMultiWill.java

28 lines
1.1 KiB
Java
Raw Normal View History

package WayofTime.bloodmagic.client.mesh;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.iface.IMultiWillTool;
import WayofTime.bloodmagic.soul.EnumDemonWillType;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
2017-08-16 04:30:48 +00:00
public class CustomMeshDefinitionMultiWill implements ItemMeshDefinition {
private final String name;
2017-08-16 04:30:48 +00:00
public CustomMeshDefinitionMultiWill(String name) {
this.name = name;
}
@Override
2017-08-16 04:30:48 +00:00
public ModelResourceLocation getModelLocation(ItemStack stack) {
if (!stack.isEmpty() && stack.getItem() instanceof IMultiWillTool) {
EnumDemonWillType type = ((IMultiWillTool) stack.getItem()).getCurrentType(stack);
2017-08-16 23:39:57 +00:00
return new ModelResourceLocation(new ResourceLocation(BloodMagic.MODID, name), "type=" + type.getName().toLowerCase());
}
2017-08-16 23:39:57 +00:00
return new ModelResourceLocation(new ResourceLocation(BloodMagic.MODID, name), "type=default");
}
}