Skip to content

Commit

Permalink
Fix entity shadows
Browse files Browse the repository at this point in the history
  • Loading branch information
IMS212 committed Aug 15, 2023
1 parent b7cc1d6 commit 1b9467b
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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<Boolean> cir) {
if (ShadowRenderingState.areShadowsCurrentlyBeingRendered()) cir.setReturnValue(true);
}

private static int beList = 0;

static {
Expand Down

0 comments on commit 1b9467b

Please sign in to comment.