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 SymmetryWandModel(IBakedModel template) {
super(template, "wand_of_symmetry");
super(template, "create", "wand_of_symmetry");
addPartials("bits", "core", "core_glow");
}
@ -16,5 +16,5 @@ public class SymmetryWandModel extends CustomRenderedItemModel {
public ItemStackTileEntityRenderer createRenderer() {
return new SymmetryWandItemRenderer();
}
}

View file

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

View file

@ -8,7 +8,7 @@ import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
public class WorldshaperModel extends CustomRenderedItemModel {
public WorldshaperModel(IBakedModel template) {
super(template, "handheld_worldshaper");
super(template, "create", "handheld_worldshaper");
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 ItemStackTileEntityRenderer renderer;
public CustomRenderedItemModel(IBakedModel template, String basePath) {
public CustomRenderedItemModel(IBakedModel template, String namespace, String basePath) {
super(template);
this.namespace = namespace;
this.basePath = basePath;
this.renderer = createRenderer();
}
@ -72,7 +73,7 @@ public abstract class CustomRenderedItemModel extends BakedModelWrapper<IBakedMo
}
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) {