From 8261be3d80dec8c4fd44553a466dcbb1c66e7783 Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Mon, 8 Nov 2021 20:48:02 -0800 Subject: [PATCH] Named models --- .../components/structureMovement/glue/GlueInstance.java | 6 ++++++ .../structureMovement/render/RenderedContraption.java | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/GlueInstance.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/GlueInstance.java index df3b43344..4bb0cf025 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/GlueInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/GlueInstance.java @@ -96,6 +96,12 @@ public class GlueInstance extends EntityInstance implements ITi } public static class GlueModel implements IModel { + + @Override + public String name() { + return "glue"; + } + @Override public void buffer(VecBuffer buffer) { Vec3 diff = Vec3.atLowerCornerOf(Direction.SOUTH.getNormal()); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/RenderedContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/RenderedContraption.java index 8c090b7b4..d459d30e9 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/RenderedContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/RenderedContraption.java @@ -41,6 +41,7 @@ public class RenderedContraption extends ContraptionRenderInfo { private final Matrix4f modelViewPartial = new Matrix4f(); private boolean modelViewPartialReady; + // floats because we're uploading this to the gpu private AABB lightBox; public RenderedContraption(Contraption contraption, PlacementSimulationWorld renderWorld) { @@ -125,7 +126,7 @@ public class RenderedContraption extends ContraptionRenderInfo { List blockLayers = RenderType.chunkBufferLayers(); for (RenderType layer : blockLayers) { - Supplier layerModel = () -> new WorldModel(renderWorld, layer, contraption.getBlocks().values()); + Supplier layerModel = () -> new WorldModel(renderWorld, layer, contraption.getBlocks().values(), layer + "_" + contraption.entity.getId()); ModelRenderer renderer; if (Backend.getInstance().compat.vertexArrayObjectsSupported())