From bdd3bc26af843c0a7f36066fdeb1410c5619caca Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Tue, 11 May 2021 20:15:24 -0400 Subject: [PATCH] Replaced hardcoded values of Pi with Math.PI --- .../com/sk89q/worldedit/function/generator/CavesGen.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/CavesGen.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/CavesGen.java index 9407f6de3..4dbbac42a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/CavesGen.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/CavesGen.java @@ -97,9 +97,9 @@ public class CavesGen extends GenBase { if (!isLargeCave && angle == j && paramdouble1 > 1.0F && maxAngle > 0) { generateCaveNode(ThreadLocalRandom.current().nextLong(), chunkPos, chunk, x, y, z, ThreadLocalRandom - .current().nextDouble() * 0.5F + 0.5F, paramdouble2 - 1.570796F, paramdouble3 / 3.0F, angle, maxAngle, 1.0D); + .current().nextDouble() * 0.5F + 0.5F, paramdouble2 - (Math.PI/2), paramdouble3 / 3.0F, angle, maxAngle, 1.0D); generateCaveNode(ThreadLocalRandom.current().nextLong(), chunkPos, chunk, x, y, z, ThreadLocalRandom - .current().nextDouble() * 0.5F + 0.5F, paramdouble2 + 1.570796F, paramdouble3 / 3.0F, angle, maxAngle, 1.0D); + .current().nextDouble() * 0.5F + 0.5F, paramdouble2 + (Math.PI/2), paramdouble3 / 3.0F, angle, maxAngle, 1.0D); return; } if (!isLargeCave && ThreadLocalRandom.current().nextInt(4) == 0) { @@ -273,7 +273,7 @@ public class CavesGen extends GenBase { } while (count > 0) { count--; - double f1 = ThreadLocalRandom.current().nextDouble() * 3.141593F * 2.0F; + double f1 = ThreadLocalRandom.current().nextDouble() * Math.PI * 2.0F; double f2 = (ThreadLocalRandom.current().nextDouble() - 0.5F) * 2.0F / 8.0F; double f3 = ThreadLocalRandom.current().nextDouble() * 2.0F + ThreadLocalRandom .current().nextDouble();