-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix no-shadow shader incompatibility
- Loading branch information
1 parent
5b50189
commit 91368b8
Showing
1 changed file
with
7 additions
and
11 deletions.
There are no files selected for viewing
18 changes: 7 additions & 11 deletions
18
src/main/java/me/senseiwells/chunkdebug/client/mixins/GuiMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |