mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-28 16:06:48 +01:00
Merge pull request #2121 from Ovionyx/mc1.16/dev
custom namespace support of CustomRenderedItemModels
This commit is contained in:
commit
8a68911335
9 changed files with 32 additions and 18 deletions
|
@ -1,11 +1,11 @@
|
|||
package com.simibubi.create.content.contraptions.wrench;
|
||||
|
||||
import com.simibubi.create.foundation.item.render.CustomRenderedItemModel;
|
||||
import com.simibubi.create.foundation.item.render.CreateCustomRenderedItemModel;
|
||||
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
|
||||
|
||||
public class WrenchModel extends CustomRenderedItemModel {
|
||||
public class WrenchModel extends CreateCustomRenderedItemModel {
|
||||
|
||||
public WrenchModel(IBakedModel template) {
|
||||
super(template, "wrench");
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.simibubi.create.content.curiosities.symmetry.client;
|
||||
|
||||
import com.simibubi.create.foundation.item.render.CustomRenderedItemModel;
|
||||
import com.simibubi.create.foundation.item.render.CreateCustomRenderedItemModel;
|
||||
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
|
||||
|
||||
public class SymmetryWandModel extends CustomRenderedItemModel {
|
||||
public class SymmetryWandModel extends CreateCustomRenderedItemModel {
|
||||
|
||||
public SymmetryWandModel(IBakedModel template) {
|
||||
super(template, "wand_of_symmetry");
|
||||
|
@ -16,5 +16,5 @@ public class SymmetryWandModel extends CustomRenderedItemModel {
|
|||
public ItemStackTileEntityRenderer createRenderer() {
|
||||
return new SymmetryWandItemRenderer();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.simibubi.create.content.curiosities.tools;
|
||||
|
||||
import com.simibubi.create.foundation.item.render.CustomRenderedItemModel;
|
||||
import com.simibubi.create.foundation.item.render.CreateCustomRenderedItemModel;
|
||||
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
|
||||
|
||||
public class ExtendoGripModel extends CustomRenderedItemModel {
|
||||
public class ExtendoGripModel extends CreateCustomRenderedItemModel {
|
||||
|
||||
public ExtendoGripModel(IBakedModel template) {
|
||||
super(template, "extendo_grip");
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.simibubi.create.content.curiosities.tools;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.simibubi.create.foundation.item.render.CustomRenderedItemModel;
|
||||
import com.simibubi.create.foundation.item.render.CreateCustomRenderedItemModel;
|
||||
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
@ -79,7 +79,7 @@ public class SandPaperItemRenderer extends ItemStackTileEntityRenderer {
|
|||
ms.popPose();
|
||||
}
|
||||
|
||||
public static class SandPaperModel extends CustomRenderedItemModel {
|
||||
public static class SandPaperModel extends CreateCustomRenderedItemModel {
|
||||
|
||||
public SandPaperModel(IBakedModel template) {
|
||||
super(template, "");
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.simibubi.create.content.curiosities.weapons;
|
||||
|
||||
import com.simibubi.create.foundation.item.render.CustomRenderedItemModel;
|
||||
import com.simibubi.create.foundation.item.render.CreateCustomRenderedItemModel;
|
||||
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
|
||||
|
||||
public class PotatoCannonModel extends CustomRenderedItemModel {
|
||||
public class PotatoCannonModel extends CreateCustomRenderedItemModel {
|
||||
|
||||
public PotatoCannonModel(IBakedModel template) {
|
||||
super(template, "potato_cannon");
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.simibubi.create.content.curiosities.zapper.terrainzapper;
|
||||
|
||||
import com.simibubi.create.foundation.item.render.CustomRenderedItemModel;
|
||||
import com.simibubi.create.foundation.item.render.CreateCustomRenderedItemModel;
|
||||
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
|
||||
|
||||
public class WorldshaperModel extends CustomRenderedItemModel {
|
||||
public class WorldshaperModel extends CreateCustomRenderedItemModel {
|
||||
|
||||
public WorldshaperModel(IBakedModel template) {
|
||||
super(template, "handheld_worldshaper");
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.simibubi.create.content.logistics.item;
|
||||
|
||||
import com.simibubi.create.foundation.item.render.CustomRenderedItemModel;
|
||||
import com.simibubi.create.foundation.item.render.CreateCustomRenderedItemModel;
|
||||
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
|
||||
|
||||
public class LinkedControllerModel extends CustomRenderedItemModel {
|
||||
public class LinkedControllerModel extends CreateCustomRenderedItemModel {
|
||||
|
||||
public LinkedControllerModel(IBakedModel template) {
|
||||
super(template, "linked_controller");
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
package com.simibubi.create.foundation.item.render;
|
||||
|
||||
import com.simibubi.create.Create;
|
||||
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
|
||||
public abstract class CreateCustomRenderedItemModel extends CustomRenderedItemModel {
|
||||
|
||||
public CreateCustomRenderedItemModel(IBakedModel template, String basePath) {
|
||||
super(template, Create.ID, basePath);
|
||||
}
|
||||
|
||||
}
|
|
@ -6,7 +6,6 @@ import java.util.Map;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.simibubi.create.Create;
|
||||
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.model.ItemCameraTransforms;
|
||||
|
@ -18,12 +17,14 @@ import net.minecraftforge.client.model.BakedModelWrapper;
|
|||
|
||||
public abstract class CustomRenderedItemModel extends BakedModelWrapper<IBakedModel> {
|
||||
|
||||
protected String namespace;
|
||||
protected String basePath;
|
||||
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) {
|
||||
|
|
Loading…
Reference in a new issue