From aa4d8716468bd6ce2744bb071bcc2b1da347bc12 Mon Sep 17 00:00:00 2001 From: makamys Date: Sat, 8 May 2021 23:24:33 +0200 Subject: Make far plane distance changeable on the fly --- src/main/java/makamys/lodmod/mixin/MixinEntityRenderer.java | 2 +- src/main/java/makamys/lodmod/renderer/LODRenderer.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/makamys/lodmod/mixin/MixinEntityRenderer.java b/src/main/java/makamys/lodmod/mixin/MixinEntityRenderer.java index 67be1e6..dcfcbac 100644 --- a/src/main/java/makamys/lodmod/mixin/MixinEntityRenderer.java +++ b/src/main/java/makamys/lodmod/mixin/MixinEntityRenderer.java @@ -24,7 +24,7 @@ abstract class MixinEntityRenderer { @Inject(method = "setupCameraTransform", at = @At(value = "FIELD", target = "Lnet/minecraft/client/renderer/EntityRenderer;farPlaneDistance:F", shift = At.Shift.AFTER, args = "log=true", ordinal = 0)) private void onConstructed(CallbackInfo ci) { if(LODMod.isActive()) { - farPlaneDistance *= 4; + farPlaneDistance *= LODMod.renderer.getFarPlaneDistanceMultiplier(); } } diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java index 6aac74a..5454352 100644 --- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java +++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java @@ -143,6 +143,10 @@ public class LODRenderer { } } } + + public int getFarPlaneDistanceMultiplier() { + return 4; + } private void handleKeyboard() { if(Keyboard.isKeyDown(Keyboard.KEY_F) && !wasDown[Keyboard.KEY_F]) { -- cgit