|
20 | 20 | import com.lambda.module.modules.render.Fullbright; |
21 | 21 | import com.lambda.module.modules.render.NoRender; |
22 | 22 | import com.lambda.module.modules.render.XRay; |
| 23 | +import net.minecraft.client.gl.SimpleFramebuffer; |
23 | 24 | import net.minecraft.client.render.LightmapTextureManager; |
| 25 | +import org.spongepowered.asm.mixin.Final; |
24 | 26 | import org.spongepowered.asm.mixin.Mixin; |
| 27 | +import org.spongepowered.asm.mixin.Shadow; |
25 | 28 | import org.spongepowered.asm.mixin.injection.At; |
26 | 29 | import org.spongepowered.asm.mixin.injection.Inject; |
27 | 30 | import org.spongepowered.asm.mixin.injection.ModifyArg; |
| 31 | +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; |
28 | 32 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; |
29 | 33 |
|
30 | 34 | @Mixin(LightmapTextureManager.class) |
31 | 35 | 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) { |
35 | 40 | if (Fullbright.INSTANCE.isEnabled() || XRay.INSTANCE.isEnabled()) { |
36 | | - return 0xFFFFFFFF; |
| 41 | + lightmapFramebuffer.clear(); |
37 | 42 | } |
38 | | - return color; |
39 | | - }*/ |
| 43 | + } |
40 | 44 |
|
41 | 45 | @Inject(method = "getDarknessFactor(F)F", at = @At("HEAD"), cancellable = true) |
42 | 46 | private void getDarknessFactor(float tickDelta, CallbackInfoReturnable<Float> info) { |
|
0 commit comments