Skip to content

Commit

Permalink
model parenting stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
LudoCrypt committed Jul 23, 2022
1 parent 188cd09 commit 155f820
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public interface UnbakedModelAccess {

public Map<Identifier, List<ModelElement>> getSubElements();

public void putSubElements(Map<Identifier, List<ModelElement>> map);

public JsonUnbakedModel getParent();

}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public abstract class JsonUnbakedModelDeserializerMixin {
}
});
}
((UnbakedModelAccess) ci.getReturnValue()).getSubElements().putAll(map);
((UnbakedModelAccess) ci.getReturnValue()).putSubElements(map);
}

@Shadow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -107,6 +107,11 @@ public Map<Identifier, List<ModelElement>> getSubElements() {
return conjoinedElements;
}

@Override
public void putSubElements(Map<Identifier, List<ModelElement>> map) {
this.subElements.putAll(map);
}

@Override
public JsonUnbakedModel getParent() {
return this.parent;
Expand Down

0 comments on commit 155f820

Please sign in to comment.