Created visual niceties when an item uses/contains a different will type.
This commit is contained in:
parent
09e90f93c3
commit
4ea3e0ca92
9 changed files with 349 additions and 117 deletions
|
@ -0,0 +1,31 @@
|
|||
package WayofTime.bloodmagic.client.mesh;
|
||||
|
||||
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.Constants;
|
||||
import WayofTime.bloodmagic.api.iface.IMultiWillTool;
|
||||
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||
|
||||
public class CustomMeshDefinitionMultiWill implements ItemMeshDefinition
|
||||
{
|
||||
private final String name;
|
||||
|
||||
public CustomMeshDefinitionMultiWill(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack)
|
||||
{
|
||||
if (stack != null && stack.getItem() instanceof IMultiWillTool)
|
||||
{
|
||||
EnumDemonWillType type = ((IMultiWillTool) stack.getItem()).getCurrentType(stack);
|
||||
return new ModelResourceLocation(new ResourceLocation(Constants.Mod.MODID, "item/" + name), "type=" + type.getName().toLowerCase());
|
||||
}
|
||||
|
||||
return new ModelResourceLocation(new ResourceLocation(Constants.Mod.MODID, "item/" + name), "type=default");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue