Skip to content

Commit

Permalink
Fix no-shadow shader incompatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
senseiwells committed Sep 4, 2024
1 parent 5b50189 commit 91368b8
Showing 1 changed file with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
package me.senseiwells.chunkdebug.client.mixins;

import com.llamalad7.mixinextras.sugar.Local;
import me.senseiwells.chunkdebug.client.ChunkDebugClient;
import net.minecraft.client.Minecraft;
import net.minecraft.client.DeltaTracker;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.LayeredDraw;
import net.minecraft.client.gui.GuiGraphics;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(Gui.class)
public class GuiMixin {
// We do this instead of adding a new layer for shader compatability reasons
@Inject(
method = "<init>",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/gui/LayeredDraw;add(Lnet/minecraft/client/gui/LayeredDraw;Ljava/util/function/BooleanSupplier;)Lnet/minecraft/client/gui/LayeredDraw;",
ordinal = 0
)
method = "renderEffects",
at = @At("TAIL")
)
private void addChunkDebugMinimapLayer(Minecraft minecraft, CallbackInfo ci, @Local(ordinal = 0) LayeredDraw layered) {
layered.add(ChunkDebugClient.getInstance()::onGuiRender);
private void renderChunkDebugMinimap(GuiGraphics graphics, DeltaTracker tracker, CallbackInfo ci) {
ChunkDebugClient.getInstance().onGuiRender(graphics, tracker);
}
}

0 comments on commit 91368b8

Please sign in to comment.