Created
June 1, 2021 09:02
-
-
Save mdashlw/5d14bb99a7fc86136632b193155ee373 to your computer and use it in GitHub Desktop.
water smooth lighting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Mixin(value = BlockInfo.class, remap = false) | |
public class MixinBlockInfo { | |
@Redirect( | |
method = "updateLightMatrix", | |
at = @At( | |
value = "INVOKE", | |
target = "Lnet/minecraft/block/Block;isTranslucent()Z", | |
opcode = Opcodes.INVOKEVIRTUAL | |
) | |
) | |
public boolean updateLightMatrix__isTranslucent(final Block block) { | |
return !block.isVisuallyOpaque() || block.getLightOpacity() == 0; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Mixin(targets = "net.minecraft.client.renderer.BlockModelRenderer.AmbientOcclusionFace") | |
public class MixinBlockModelRenderer { | |
@Redirect( | |
method = "updateVertexBrightness", | |
at = @At( | |
value = "INVOKE", | |
target = "Lnet/minecraft/block/Block;isTranslucent()Z", | |
opcode = Opcodes.INVOKEVIRTUAL | |
) | |
) | |
public boolean updateVertexBrightness__isTranslucent(final Block block) { | |
return !block.isVisuallyOpaque() || block.getLightOpacity() == 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment