-
-
Notifications
You must be signed in to change notification settings - Fork 641
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2463 from Plastoid501/1.20.3
fix chunk border rendering
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
common/src/main/java/net/irisshaders/iris/mixin/MixinChunkBorderRenderer.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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package net.irisshaders.iris.mixin; | ||
|
||
import com.llamalad7.mixinextras.injector.WrapWithCondition; | ||
import com.llamalad7.mixinextras.sugar.Local; | ||
import com.mojang.blaze3d.vertex.VertexConsumer; | ||
import net.minecraft.client.renderer.debug.ChunkBorderRenderer; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Slice; | ||
|
||
@Mixin(ChunkBorderRenderer.class) | ||
public class MixinChunkBorderRenderer { | ||
@WrapWithCondition( | ||
method = "render", | ||
at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/vertex/VertexConsumer;endVertex()V"), | ||
slice = @Slice( | ||
from = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/vertex/PoseStack$Pose;pose()Lorg/joml/Matrix4f;"), | ||
to = @At(value = "FIELD", target = "Lnet/minecraft/client/renderer/debug/ChunkBorderRenderer;CELL_BORDER:I", ordinal = 0) | ||
) | ||
) | ||
private boolean isCameraChunk(VertexConsumer instance, @Local(ordinal = 0) int k, @Local(ordinal = 1) int l) { | ||
return !((k == 0 || k == 16) && (l == 0 || l == 16)); | ||
} | ||
|
||
@WrapWithCondition( | ||
method = "render", | ||
at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/vertex/VertexConsumer;endVertex()V"), | ||
slice = @Slice( | ||
from = @At(value = "INVOKE", target = "Lnet/minecraft/client/multiplayer/ClientLevel;getMinBuildHeight()I", ordinal = 1), | ||
to = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/MultiBufferSource;getBuffer(Lnet/minecraft/client/renderer/RenderType;)Lcom/mojang/blaze3d/vertex/VertexConsumer;", ordinal = 1) | ||
) | ||
) | ||
private boolean isSubChunkBorder(VertexConsumer instance, @Local(ordinal = 0) int k) { | ||
return k % 16 != 0; | ||
} | ||
} |
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