Skip to content

Commit

Permalink
fix: tweakRenderEdgeChunks
Browse files Browse the repository at this point in the history
  • Loading branch information
zly2006 committed Dec 7, 2024
1 parent 583f795 commit 98c88fa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,13 @@ private void allowEdgeChunksToRender(BlockPos pos, CallbackInfoReturnable<Boolea
cir.setReturnValue(true);
}
}

@Inject(method = "shouldBuild", at = @At("HEAD"), cancellable = true)
private void shouldBuild(CallbackInfoReturnable<Boolean> cir)
{
if (FeatureToggle.TWEAK_RENDER_EDGE_CHUNKS.getBooleanValue())
{
cir.setReturnValue(true);
}
}
}
11 changes: 11 additions & 0 deletions src/main/java/fi/dy/masa/tweakeroo/mixin/MixinWorldRenderer.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package fi.dy.masa.tweakeroo.mixin;

import net.minecraft.client.option.GameOptions;
import org.joml.Matrix4f;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
Expand Down Expand Up @@ -110,4 +111,14 @@ private void rebuildChunksAroundCamera2(
// Could send this to ServuX in the future
}
}

@Redirect(
method = "*",
require = 0,
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/option/GameOptions;getClampedViewDistance()I")
)
private int getViewDistance(GameOptions options)
{
return options.getClampedViewDistance() + 8;
}
}

0 comments on commit 98c88fa

Please sign in to comment.