Skip to content

Commit 1c7927f

Browse files
authored
fix xray only shows exposed ores, compile against a newer Sodium version 0.8.7 (#6287)
1 parent 07ef82b commit 1c7927f

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ loom = "1.14-SNAPSHOT"
1313
# Baritone (https://github.com/MeteorDevelopment/baritone)
1414
baritone = "1.21.10-SNAPSHOT"
1515
# Sodium (https://github.com/CaffeineMC/sodium-fabric)
16-
sodium = "mc1.21.11-0.8.0-fabric"
16+
sodium = "mc1.21.11-0.8.7-fabric"
1717
# Lithium (https://github.com/CaffeineMC/lithium-fabric)
1818
lithium = "mc1.21.11-0.21.3-fabric"
1919
# Iris (https://github.com/IrisShaders/Iris)

src/main/java/meteordevelopment/meteorclient/mixin/sodium/SodiumBlockOcclusionCacheMixin.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,43 @@
88
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
99
import meteordevelopment.meteorclient.systems.modules.Modules;
1010
import meteordevelopment.meteorclient.systems.modules.render.Xray;
11-
import net.caffeinemc.mods.sodium.client.render.chunk.compile.pipeline.BlockOcclusionCache;
11+
import net.caffeinemc.mods.sodium.client.render.model.AbstractBlockRenderContext;
12+
import net.caffeinemc.mods.sodium.client.world.LevelSlice;
1213
import net.minecraft.block.BlockState;
1314
import net.minecraft.util.math.BlockPos;
1415
import net.minecraft.util.math.Direction;
15-
import net.minecraft.world.BlockView;
1616
import org.spongepowered.asm.mixin.Mixin;
17+
import org.spongepowered.asm.mixin.Shadow;
1718
import org.spongepowered.asm.mixin.Unique;
1819
import org.spongepowered.asm.mixin.injection.At;
1920
import org.spongepowered.asm.mixin.injection.Inject;
2021
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
2122
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
2223

23-
@Mixin(value = BlockOcclusionCache.class, remap = false)
24+
@Mixin(value = AbstractBlockRenderContext.class, remap = false)
2425
public abstract class SodiumBlockOcclusionCacheMixin {
25-
@Unique
26-
private Xray xray;
26+
27+
@Shadow protected BlockState state;
28+
@Shadow protected BlockPos pos;
29+
@Shadow protected LevelSlice slice;
30+
31+
@Unique private Xray xray;
2732

2833
@Inject(method = "<init>", at = @At("TAIL"))
2934
private void onInit(CallbackInfo info) {
3035
xray = Modules.get().get(Xray.class);
3136
}
32-
3337
// For More Culling compatibility - runs before More Culling's inject to force-render whitelisted Xray blocks
3438
@Inject(method = "shouldDrawSide", at = @At("HEAD"), cancellable = true)
35-
private void meteor$forceXrayFace(BlockState state, BlockView view, BlockPos pos, Direction facing,
36-
CallbackInfoReturnable<Boolean> cir) {
39+
private void meteor$forceXrayFace(Direction facing, CallbackInfoReturnable<Boolean> cir) {
3740
if (xray != null && xray.isActive() && !xray.isBlocked(state.getBlock(), null)) {
3841
cir.setReturnValue(true);
3942
}
4043
}
4144

4245
@ModifyReturnValue(method = "shouldDrawSide", at = @At("RETURN"))
43-
private boolean shouldDrawSide(boolean original, BlockState state, BlockView view, BlockPos pos, Direction facing) {
44-
if (xray.isActive()) {
45-
return xray.modifyDrawSide(state, view, pos, facing, original);
46-
}
47-
48-
return original;
46+
private boolean shouldDrawSide(boolean original, Direction facing) {
47+
if (!xray.isActive()) return original;
48+
return xray.modifyDrawSide(state, slice, pos, facing, original);
4949
}
5050
}

src/main/resources/fabric.mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"optifabric": "*",
5858
"feather": "*",
5959
"origins": "*",
60-
"sodium": "<0.7.0",
60+
"sodium": "<0.8.7",
6161
"morechathistory": "*",
6262
"lithium": "<0.21.3"
6363
}

0 commit comments

Comments
 (0)