diff --git a/EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/mixin/BlockEntityRenderDispatcherMixin.java b/EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/mixin/BlockEntityRenderDispatcherMixin.java index c06ea22..e892394 100644 --- a/EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/mixin/BlockEntityRenderDispatcherMixin.java +++ b/EntityCulling-Shared/src/main/java/dev/tr7zw/entityculling/mixin/BlockEntityRenderDispatcherMixin.java @@ -22,5 +22,13 @@ public void renderTileEntityAt(TileEntity blockEntity, double x, double y, doubl } EntityCullingModBase.instance.renderedBlockEntities++; } + + @Inject(method = "Lnet/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher;render(Lnet/minecraft/tileentity/TileEntity;FI)V", at = @At("HEAD"), cancellable = true) + public void render(TileEntity blockEntity, float partialTicks, int destroyStage, CallbackInfo info) { + if (!((Cullable) blockEntity).isForcedVisible() && ((Cullable) blockEntity).isCulled()) { + EntityCullingModBase.instance.skippedBlockEntities++; + info.cancel(); + } + } }