Skip to content

Commit

Permalink
Correct support for Forge RenderTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
Asek3 committed Sep 5, 2023
1 parent 39618dd commit 063f75c
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,15 @@ public class MixinItemBlockRenderTypes {
}
}
}

@Inject(method = "canRenderInLayer(Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/client/renderer/RenderType;)Z", at = @At("HEAD"), cancellable = true)
private static void iris$checkCustomRenderType(BlockState arg, RenderType type, CallbackInfoReturnable<Boolean> cir) {
Map<Block, RenderType> idMap = BlockRenderingSettings.INSTANCE.getBlockTypeIds();
if (idMap != null) {
RenderType irisType = idMap.get(arg.getBlock());
if (type.equals(irisType)) {
cir.setReturnValue(true);
}
}
}
}

0 comments on commit 063f75c

Please sign in to comment.