Skip to content

Commit 5d19c26

Browse files
committed
Fix fullbright
1 parent bb4838d commit 5d19c26

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

common/src/main/java/com/lambda/mixin/render/LightmapTextureManagerMixin.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,27 @@
2020
import com.lambda.module.modules.render.Fullbright;
2121
import com.lambda.module.modules.render.NoRender;
2222
import com.lambda.module.modules.render.XRay;
23+
import net.minecraft.client.gl.SimpleFramebuffer;
2324
import net.minecraft.client.render.LightmapTextureManager;
25+
import org.spongepowered.asm.mixin.Final;
2426
import org.spongepowered.asm.mixin.Mixin;
27+
import org.spongepowered.asm.mixin.Shadow;
2528
import org.spongepowered.asm.mixin.injection.At;
2629
import org.spongepowered.asm.mixin.injection.Inject;
2730
import org.spongepowered.asm.mixin.injection.ModifyArg;
31+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
2832
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
2933

3034
@Mixin(LightmapTextureManager.class)
3135
public class LightmapTextureManagerMixin {
32-
// TODO: Fix this
33-
/*@ModifyArg(method = "update", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/texture/NativeImage;setColor(III)V"), index = 2)
34-
private int updateModify(int color) {
36+
@Shadow @Final private SimpleFramebuffer lightmapFramebuffer;
37+
38+
@Inject(method = "update", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gl/SimpleFramebuffer;endWrite()V", shift = At.Shift.BEFORE))
39+
private void updateModify(CallbackInfo ci) {
3540
if (Fullbright.INSTANCE.isEnabled() || XRay.INSTANCE.isEnabled()) {
36-
return 0xFFFFFFFF;
41+
lightmapFramebuffer.clear();
3742
}
38-
return color;
39-
}*/
43+
}
4044

4145
@Inject(method = "getDarknessFactor(F)F", at = @At("HEAD"), cancellable = true)
4246
private void getDarknessFactor(float tickDelta, CallbackInfoReturnable<Float> info) {

0 commit comments

Comments
 (0)