From a7c96a61daf167ea82293853f1a7bc71b91534ac Mon Sep 17 00:00:00 2001 From: OnlyRain233 Date: Sun, 6 Aug 2023 22:15:54 +0800 Subject: [PATCH 1/2] Fix Luminous in FullBright closed in my sodium pr :sob: --- .../mixin/sodium/SodiumLightDataAccessMixin.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/sodium/SodiumLightDataAccessMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/sodium/SodiumLightDataAccessMixin.java index 33efad5aff..f659bce68f 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/sodium/SodiumLightDataAccessMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/sodium/SodiumLightDataAccessMixin.java @@ -7,6 +7,7 @@ import me.jellysquid.mods.sodium.client.model.light.data.LightDataAccess; import meteordevelopment.meteorclient.systems.modules.Modules; +import meteordevelopment.meteorclient.systems.modules.render.Fullbright; import meteordevelopment.meteorclient.systems.modules.render.Xray; import net.minecraft.block.BlockState; import net.minecraft.util.math.BlockPos; @@ -23,7 +24,7 @@ @Mixin(value = LightDataAccess.class, remap = false) public class SodiumLightDataAccessMixin { @Unique - private static final int FULL_LIGHT = 15 << 20 | 15 << 4; + private static final int FULL_LIGHT = 15 | 15 << 4 | 15 << 8; @Shadow protected BlockRenderView world; @@ -39,7 +40,7 @@ private void onInit(CallbackInfo info) { } @ModifyVariable(method = "compute", at = @At(value = "TAIL"), name = "bl") - private int compute_modifyAO(int light) { + private int compute_modifyBL(int light) { if (xray.isActive()) { BlockState state = world.getBlockState(pos); if (!xray.isBlocked(state.getBlock(), pos)) return FULL_LIGHT; @@ -47,4 +48,9 @@ private int compute_modifyAO(int light) { return light; } + + @ModifyVariable(method = "compute", at = @At(value = "TAIL"), name = "sl") + private int compute_modifySL(int light) { + return Math.max(Modules.get().get(Fullbright.class).getLuminance(), blockLight); + } } From c02c369667e3998f161711b42ce82d55b4feacf3 Mon Sep 17 00:00:00 2001 From: OnlyRain233 Date: Sun, 6 Aug 2023 22:39:51 +0800 Subject: [PATCH 2/2] Fix Issues --- .../meteorclient/mixin/sodium/SodiumLightDataAccessMixin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/sodium/SodiumLightDataAccessMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/sodium/SodiumLightDataAccessMixin.java index f659bce68f..e70755b1f8 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/sodium/SodiumLightDataAccessMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/sodium/SodiumLightDataAccessMixin.java @@ -51,6 +51,6 @@ private int compute_modifyBL(int light) { @ModifyVariable(method = "compute", at = @At(value = "TAIL"), name = "sl") private int compute_modifySL(int light) { - return Math.max(Modules.get().get(Fullbright.class).getLuminance(), blockLight); + return Math.max(Modules.get().get(Fullbright.class).getLuminance(), light); } }