custom namespace support of CustomRenderedItemModels

This commit is contained in:
QubicQuantum 2021-08-15 20:54:00 -07:00
parent f1701ae784
commit 7ddf11004b
5 changed files with 8 additions and 7 deletions

View file

@ -8,7 +8,7 @@ import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
public class SymmetryWandModel extends CustomRenderedItemModel { public class SymmetryWandModel extends CustomRenderedItemModel {
public SymmetryWandModel(IBakedModel template) { public SymmetryWandModel(IBakedModel template) {
super(template, "wand_of_symmetry"); super(template, "create", "wand_of_symmetry");
addPartials("bits", "core", "core_glow"); addPartials("bits", "core", "core_glow");
} }

View file

@ -8,7 +8,7 @@ import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
public class ExtendoGripModel extends CustomRenderedItemModel { public class ExtendoGripModel extends CustomRenderedItemModel {
public ExtendoGripModel(IBakedModel template) { public ExtendoGripModel(IBakedModel template) {
super(template, "extendo_grip"); super(template, "create", "extendo_grip");
addPartials("cog", "thin_short", "wide_short", "thin_long", "wide_long"); addPartials("cog", "thin_short", "wide_short", "thin_long", "wide_long");
} }

View file

@ -8,7 +8,7 @@ import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
public class PotatoCannonModel extends CustomRenderedItemModel { public class PotatoCannonModel extends CustomRenderedItemModel {
public PotatoCannonModel(IBakedModel template) { public PotatoCannonModel(IBakedModel template) {
super(template, "potato_cannon"); super(template, "create", "potato_cannon");
addPartials("cog"); addPartials("cog");
} }

View file

@ -8,7 +8,7 @@ import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
public class WorldshaperModel extends CustomRenderedItemModel { public class WorldshaperModel extends CustomRenderedItemModel {
public WorldshaperModel(IBakedModel template) { public WorldshaperModel(IBakedModel template) {
super(template, "handheld_worldshaper"); super(template, "create", "handheld_worldshaper");
addPartials("core", "core_glow", "accelerator"); addPartials("core", "core_glow", "accelerator");
} }

View file

@ -22,8 +22,9 @@ public abstract class CustomRenderedItemModel extends BakedModelWrapper<IBakedMo
protected Map<String, IBakedModel> partials = new HashMap<>(); protected Map<String, IBakedModel> partials = new HashMap<>();
protected ItemStackTileEntityRenderer renderer; protected ItemStackTileEntityRenderer renderer;
public CustomRenderedItemModel(IBakedModel template, String basePath) { public CustomRenderedItemModel(IBakedModel template, String namespace, String basePath) {
super(template); super(template);
this.namespace = namespace;
this.basePath = basePath; this.basePath = basePath;
this.renderer = createRenderer(); this.renderer = createRenderer();
} }
@ -72,7 +73,7 @@ public abstract class CustomRenderedItemModel extends BakedModelWrapper<IBakedMo
} }
private ResourceLocation getPartialModelLocation(String name) { private ResourceLocation getPartialModelLocation(String name) {
return new ResourceLocation(Create.ID, "item/" + basePath + "/" + name); return new ResourceLocation(namespace, "item/" + basePath + "/" + name);
} }
public IBakedModel getPartial(String name) { public IBakedModel getPartial(String name) {