From 155f820cd102e8b20385a8dcdf61b59c07fc731e Mon Sep 17 00:00:00 2001 From: LudoCrypt <60561627+LudoCrypt@users.noreply.github.com> Date: Sat, 23 Jul 2022 12:21:57 -0500 Subject: [PATCH] model parenting stuff --- gradle.properties | 2 +- .../net/ludocrypt/limlib/access/UnbakedModelAccess.java | 2 ++ .../limlib/mixin/client/render/WorldRendererMixin.java | 8 -------- .../render/model/JsonUnbakedModelDeserializerMixin.java | 2 +- .../mixin/client/render/model/JsonUnbakedModelMixin.java | 7 ++++++- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/gradle.properties b/gradle.properties index ad82103..074d601 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,6 +8,6 @@ satin_version=1.8.0 sodium_version=mc1.19-0.4.2 iris_version=1.19.x-v1.2.5 -mod_version = 6.0.4 +mod_version = 6.0.5 maven_group = net.ludocrypt archives_base_name = limlib \ No newline at end of file diff --git a/src/main/java/net/ludocrypt/limlib/access/UnbakedModelAccess.java b/src/main/java/net/ludocrypt/limlib/access/UnbakedModelAccess.java index 5da249f..f6af138 100644 --- a/src/main/java/net/ludocrypt/limlib/access/UnbakedModelAccess.java +++ b/src/main/java/net/ludocrypt/limlib/access/UnbakedModelAccess.java @@ -11,6 +11,8 @@ public interface UnbakedModelAccess { public Map> getSubElements(); + public void putSubElements(Map> map); + public JsonUnbakedModel getParent(); } diff --git a/src/main/java/net/ludocrypt/limlib/mixin/client/render/WorldRendererMixin.java b/src/main/java/net/ludocrypt/limlib/mixin/client/render/WorldRendererMixin.java index 37fd16a..4c3ef0d 100644 --- a/src/main/java/net/ludocrypt/limlib/mixin/client/render/WorldRendererMixin.java +++ b/src/main/java/net/ludocrypt/limlib/mixin/client/render/WorldRendererMixin.java @@ -136,19 +136,11 @@ public void renderHands(Framebuffer framebuffer, float tickDelta, MatrixStack ma client.getFramebuffer().beginWrite(true); } - framebuffer.clear(MinecraftClient.IS_SYSTEM_MAC); - framebuffer.beginWrite(true); - LimlibRendering.LIMINAL_QUAD_RENDERER.forEach((renderer) -> { renderer.heldItemRenderQueue.forEach(Runnable::run); renderer.heldItemRenderQueue.clear(); }); - framebuffer.endWrite(); - client.getFramebuffer().beginWrite(true); - - framebuffer.draw(framebuffer.textureWidth, framebuffer.textureHeight); - RenderSystem.setProjectionMatrix(projectionMatrix); } diff --git a/src/main/java/net/ludocrypt/limlib/mixin/client/render/model/JsonUnbakedModelDeserializerMixin.java b/src/main/java/net/ludocrypt/limlib/mixin/client/render/model/JsonUnbakedModelDeserializerMixin.java index 47256a7..82d7076 100644 --- a/src/main/java/net/ludocrypt/limlib/mixin/client/render/model/JsonUnbakedModelDeserializerMixin.java +++ b/src/main/java/net/ludocrypt/limlib/mixin/client/render/model/JsonUnbakedModelDeserializerMixin.java @@ -35,7 +35,7 @@ public abstract class JsonUnbakedModelDeserializerMixin { } }); } - ((UnbakedModelAccess) ci.getReturnValue()).getSubElements().putAll(map); + ((UnbakedModelAccess) ci.getReturnValue()).putSubElements(map); } @Shadow diff --git a/src/main/java/net/ludocrypt/limlib/mixin/client/render/model/JsonUnbakedModelMixin.java b/src/main/java/net/ludocrypt/limlib/mixin/client/render/model/JsonUnbakedModelMixin.java index 168c84d..31cad9d 100644 --- a/src/main/java/net/ludocrypt/limlib/mixin/client/render/model/JsonUnbakedModelMixin.java +++ b/src/main/java/net/ludocrypt/limlib/mixin/client/render/model/JsonUnbakedModelMixin.java @@ -73,7 +73,7 @@ public abstract class JsonUnbakedModelMixin implements UnbakedModelAccess { subElement.forEach((modelElement) -> { for (Direction direction : modelElement.faces.keySet()) { ModelElementFace modelElementFace = modelElement.faces.get(direction); - Sprite sprite2 = textureGetter.apply(parent.resolveSprite(modelElementFace.textureId)); + Sprite sprite2 = textureGetter.apply(this.resolveSprite(modelElementFace.textureId)); if (modelElementFace.cullFace == null) { quads.add(Pair.of(createQuad(modelElement, modelElementFace, sprite2, direction, settings, id), Optional.empty())); continue; @@ -107,6 +107,11 @@ public Map> getSubElements() { return conjoinedElements; } + @Override + public void putSubElements(Map> map) { + this.subElements.putAll(map); + } + @Override public JsonUnbakedModel getParent() { return this.parent;