BloodMagic/src/main/java/WayofTime/bloodmagic/client/mesh/CustomMeshDefinitionWillGem.java
Nicholas Ignoffo ddaadfbe52 Swap the API packages
The new one is now built for the api jar and the old one is now internal.
It will slowly be moved around to sane places within the internal code. Most
of the features provided in the old "api" are addon specific features which
will generally rely on the main jar anyways. The new API will be specific
to compatibility features, such as blacklists, recipes, and value modification.
2018-02-05 17:04:46 -08:00

28 lines
1.2 KiB
Java

package WayofTime.bloodmagic.client.mesh;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.apibutnotreally.soul.EnumDemonWillType;
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
import WayofTime.bloodmagic.item.soul.ItemSoulGem;
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 CustomMeshDefinitionWillGem implements ItemMeshDefinition {
private final String name;
public CustomMeshDefinitionWillGem(String name) {
this.name = name;
}
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
if (!stack.isEmpty() && stack.getItem() == RegistrarBloodMagicItems.SOUL_GEM) {
EnumDemonWillType type = ((ItemSoulGem) stack.getItem()).getCurrentType(stack);
return new ModelResourceLocation(new ResourceLocation(BloodMagic.MODID, name), "type=" + ItemSoulGem.names[stack.getItemDamage()] + "_" + type.getName().toLowerCase());
}
return new ModelResourceLocation(new ResourceLocation(BloodMagic.MODID, name), "type=petty_default");
}
}