From bbe011d88a2cdba3b3641a4ad4e33202185e5c65 Mon Sep 17 00:00:00 2001 From: djpadbit Date: Wed, 15 May 2019 22:21:09 +0200 Subject: [PATCH] Added config for ray max distance Signed-off-by: djpadbit --- src/main/java/com/sonicether/soundphysics/Config.java | 3 +++ src/main/java/com/sonicether/soundphysics/SoundPhysics.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sonicether/soundphysics/Config.java b/src/main/java/com/sonicether/soundphysics/Config.java index dbf6bf8d..26cd34b4 100644 --- a/src/main/java/com/sonicether/soundphysics/Config.java +++ b/src/main/java/com/sonicether/soundphysics/Config.java @@ -28,6 +28,7 @@ public class Config { public static float snowAirAbsorptionFactor; public static float underwaterFilter; public static boolean noteBlockEnable; + public static float maxDistance; // performance public static boolean skipRainOcclusionTracing; @@ -123,6 +124,8 @@ private void syncConfig() { "How much sound is filtered when the player is underwater. 0.0 means no filter. 1.0 means fully filtered."); noteBlockEnable = this.forgeConfig.getBoolean("Affect Note Blocks", categoryGeneral, true, "If true, note blocks will be processed."); + maxDistance = this.forgeConfig.getFloat("Max ray distance", categoryGeneral, 256.0f, 1.0f, 8192.0f, + "How far the rays should be traced."); // performance skipRainOcclusionTracing = this.forgeConfig.getBoolean("Skip Rain Occlusion Tracing", categoryPerformance, true, diff --git a/src/main/java/com/sonicether/soundphysics/SoundPhysics.java b/src/main/java/com/sonicether/soundphysics/SoundPhysics.java index 154c1d0e..63404046 100644 --- a/src/main/java/com/sonicether/soundphysics/SoundPhysics.java +++ b/src/main/java/com/sonicether/soundphysics/SoundPhysics.java @@ -676,7 +676,7 @@ public void run() { // Shoot rays around sound final float phi = 1.618033988f; final float gAngle = phi * (float) Math.PI * 2.0f; - final float maxDistance = 256.0f; + final float maxDistance = Config.maxDistance; final int numRays = Config.environmentEvaluationRays; final int rayBounces = Config.environmentEvaluationRaysBounces;