Skip to content

Commit aa5e30f

Browse files
committed
Fix xray not drawing block faces correctly when using the fabric api
1 parent 6dabd71 commit aa5e30f

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
3+
* Copyright (c) Meteor Development.
4+
*/
5+
6+
package meteordevelopment.meteorclient.mixin.indigo;
7+
8+
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
9+
import meteordevelopment.meteorclient.systems.modules.Modules;
10+
import meteordevelopment.meteorclient.systems.modules.render.Xray;
11+
import net.fabricmc.fabric.impl.client.indigo.renderer.render.BlockRenderInfo;
12+
import net.minecraft.block.BlockState;
13+
import net.minecraft.util.math.BlockPos;
14+
import net.minecraft.util.math.Direction;
15+
import net.minecraft.world.BlockRenderView;
16+
import org.spongepowered.asm.mixin.Mixin;
17+
import org.spongepowered.asm.mixin.Shadow;
18+
import org.spongepowered.asm.mixin.injection.At;
19+
20+
@Mixin(BlockRenderInfo.class)
21+
public class BlockRenderInfoMixin {
22+
@Shadow
23+
public BlockState blockState;
24+
25+
@Shadow
26+
public BlockRenderView blockView;
27+
28+
@Shadow
29+
public BlockPos blockPos;
30+
31+
@ModifyReturnValue(method = "shouldDrawSide", at = @At("RETURN"))
32+
private boolean modifyShouldDrawSide(boolean original, Direction side) {
33+
Xray xray = Modules.get().get(Xray.class);
34+
35+
if (xray.isActive()) {
36+
return xray.modifyDrawSide(blockState, blockView, blockPos, side, original);
37+
}
38+
39+
return original;
40+
}
41+
}

src/main/resources/meteor-client-indigo.mixins.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"compatibilityLevel": "JAVA_21",
55
"plugin": "meteordevelopment.meteorclient.MixinPlugin",
66
"client": [
7-
"AbstractTerrainRenderContextMixin"
7+
"AbstractTerrainRenderContextMixin",
8+
"BlockRenderInfoMixin"
89
],
910
"injectors": {
1011
"defaultRequire": 1

0 commit comments

Comments
 (0)