aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/lodmod/mixin/MixinRenderBlocks.java
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2021-05-09 07:17:04 +0200
committermakamys <makamys@outlook.com>2021-05-09 07:17:04 +0200
commit0931696d367063a547f1e30be7fa4ac968070f76 (patch)
tree7ae600f619951a8097d44c47ddddf07cdbfe4f75 /src/main/java/makamys/lodmod/mixin/MixinRenderBlocks.java
parent7ee84793385544d646be3d18dd3da8904e917939 (diff)
downloadNeodymium-0931696d367063a547f1e30be7fa4ac968070f76.tar.gz
Neodymium-0931696d367063a547f1e30be7fa4ac968070f76.tar.bz2
Neodymium-0931696d367063a547f1e30be7fa4ac968070f76.zip
Patch RenderBlocks to not render sides of water on the edge of the world
Diffstat (limited to 'src/main/java/makamys/lodmod/mixin/MixinRenderBlocks.java')
-rw-r--r--src/main/java/makamys/lodmod/mixin/MixinRenderBlocks.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main/java/makamys/lodmod/mixin/MixinRenderBlocks.java b/src/main/java/makamys/lodmod/mixin/MixinRenderBlocks.java
new file mode 100644
index 0000000..2812eff
--- /dev/null
+++ b/src/main/java/makamys/lodmod/mixin/MixinRenderBlocks.java
@@ -0,0 +1,29 @@
+package makamys.lodmod.mixin;
+
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.Redirect;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import makamys.lodmod.LODMod;
+import makamys.lodmod.renderer.FarChunkCache;
+import net.minecraft.block.Block;
+import net.minecraft.client.renderer.RenderBlocks;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import net.minecraft.world.chunk.Chunk;
+
+@Mixin(RenderBlocks.class)
+abstract class MixinRenderBlocks {
+
+ @Redirect(method = "renderBlockLiquid", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/Block;shouldSideBeRendered(Lnet/minecraft/world/IBlockAccess;IIII)Z"))
+ public boolean shouldSideBeRendered(Block block, IBlockAccess ba, int x, int y, int z, int w) {
+ if(LODMod.isActive()) {
+ return LODMod.renderer.shouldSideBeRendered(block, ba, x, y, z, w);
+ } else {
+ return block.shouldSideBeRendered(ba, x, y, z, w);
+ }
+ }
+
+}