Skip to content

Commit

Permalink
fixed no shader thing bug thing yk
Browse files Browse the repository at this point in the history
  • Loading branch information
LudoCrypt committed Jul 23, 2022
1 parent c162506 commit ac8a284
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 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.1.0
mod_version = 6.1.1
maven_group = net.ludocrypt
archives_base_name = limlib
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ public void renderBlocks(Framebuffer framebuffer, float tickDelta, MatrixStack m
matrices.translate(pos.getX() - camera.getPos().getX(), pos.getY() - camera.getPos().getY(), pos.getZ() - camera.getPos().getZ());

BakedModel model = MinecraftClient.getInstance().getBlockRenderManager().getModel(state);
LimlibRendering.LIMINAL_QUAD_RENDERER.get(((ModelAccess) model).getLiminalQuadRenderer().get()).renderModel(model, world, pos, state, matrices, camera);
if (((ModelAccess) model).getLiminalQuadRenderer().isPresent()) {
LimlibRendering.LIMINAL_QUAD_RENDERER.get(((ModelAccess) model).getLiminalQuadRenderer().get()).renderModel(model, world, pos, state, matrices, camera);
}

matrices.pop();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,20 @@ public class ItemRendererMixin implements ItemRendererAccess {

@Inject(method = "Lnet/minecraft/client/render/item/ItemRenderer;renderBakedItemModel(Lnet/minecraft/client/render/model/BakedModel;Lnet/minecraft/item/ItemStack;IILnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;)V", at = @At("HEAD"))
private void limlib$renderBakedItemModel(BakedModel model, ItemStack stack, int light, int overlay, MatrixStack matrices, VertexConsumer vertices, CallbackInfo ci) {
MinecraftClient client = MinecraftClient.getInstance();
if (((ModelAccess) model).getLiminalQuadRenderer().isPresent()) {
MinecraftClient client = MinecraftClient.getInstance();

boolean isHandRendering = ((WorldRendererAccess) client.worldRenderer).isRenderingHands() || (FabricLoader.getInstance().isModLoaded("iris") && ((IrisClientAccess) client).isHandRenderingActive());
boolean isItemRendering = ((WorldRendererAccess) client.worldRenderer).isRenderingItems();
boolean isHandRendering = ((WorldRendererAccess) client.worldRenderer).isRenderingHands() || (FabricLoader.getInstance().isModLoaded("iris") && ((IrisClientAccess) client).isHandRenderingActive());
boolean isItemRendering = ((WorldRendererAccess) client.worldRenderer).isRenderingItems();

if (isHandRendering || isItemRendering || inGui) {
MatrixStack matrixStack = new MatrixStack();
matrixStack.multiplyPositionMatrix(matrices.peek().getPositionMatrix().copy());
List<Runnable> immediateRenderer = Lists.newArrayList();
LimlibRendering.LIMINAL_QUAD_RENDERER.get(((ModelAccess) model).getLiminalQuadRenderer().get()).renderItemModel(model, client.world, stack.copy(), matrixStack, client.gameRenderer.getCamera(), inGui);
immediateRenderer.forEach(Runnable::run);
immediateRenderer.clear();
if (isHandRendering || isItemRendering || inGui) {
MatrixStack matrixStack = new MatrixStack();
matrixStack.multiplyPositionMatrix(matrices.peek().getPositionMatrix().copy());
List<Runnable> immediateRenderer = Lists.newArrayList();
LimlibRendering.LIMINAL_QUAD_RENDERER.get(((ModelAccess) model).getLiminalQuadRenderer().get()).renderItemModel(model, client.world, stack.copy(), matrixStack, client.gameRenderer.getCamera(), inGui);
immediateRenderer.forEach(Runnable::run);
immediateRenderer.clear();
}
}
}

Expand Down

0 comments on commit ac8a284

Please sign in to comment.