BloodMagic/src/main/java/WayofTime/bloodmagic/client/mesh/CustomMeshDefinitionMultiWill.java
Nicholas Ignoffo 2fecb427fd Merge apibutnotreally with the main packages
Do not consider anything outside of the true API safe to use. And even then,
I'm changing things. Just wait. Please I beg you.
2018-02-15 18:49:07 -08:00

28 lines
1.1 KiB
Java

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;
public class CustomMeshDefinitionMultiWill implements ItemMeshDefinition {
private final String name;
public CustomMeshDefinitionMultiWill(String name) {
this.name = name;
}
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
if (!stack.isEmpty() && stack.getItem() instanceof IMultiWillTool) {
EnumDemonWillType type = ((IMultiWillTool) stack.getItem()).getCurrentType(stack);
return new ModelResourceLocation(new ResourceLocation(BloodMagic.MODID, name), "type=" + type.getName().toLowerCase());
}
return new ModelResourceLocation(new ResourceLocation(BloodMagic.MODID, name), "type=default");
}
}