diff --git a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/shadow_map/MixinSodiumWorldRenderer.java b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/shadow_map/MixinSodiumWorldRenderer.java index 8a3860d5c8..c807a7ae68 100644 --- a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/shadow_map/MixinSodiumWorldRenderer.java +++ b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/shadow_map/MixinSodiumWorldRenderer.java @@ -14,12 +14,14 @@ import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.blockentity.BlockEntityRenderDispatcher; import net.minecraft.server.level.BlockDestructionProgress; +import net.minecraft.world.entity.Entity; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import java.util.SortedSet; @@ -47,6 +49,11 @@ private void addToList2(PoseStack matrices, RenderBuffers bufferBuilders, Long2O beList++; } + @Inject(method = "isEntityVisible", at = @At("HEAD"), cancellable = true) + private void iris$overrideEntityCulling(Entity entity, CallbackInfoReturnable cir) { + if (ShadowRenderingState.areShadowsCurrentlyBeingRendered()) cir.setReturnValue(true); + } + private static int beList = 0; static {