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;