diff --git a/common/src/main/java/org/terraform/structure/stronghold/StrongholdPopulator.java b/common/src/main/java/org/terraform/structure/stronghold/StrongholdPopulator.java index b4a410e4..8467c0f5 100644 --- a/common/src/main/java/org/terraform/structure/stronghold/StrongholdPopulator.java +++ b/common/src/main/java/org/terraform/structure/stronghold/StrongholdPopulator.java @@ -15,11 +15,12 @@ import org.terraform.utils.GenUtils; import org.terraform.utils.MazeSpawner; +import java.util.HashMap; import java.util.Random; public class StrongholdPopulator extends SingleMegaChunkStructurePopulator { private static boolean debugSpawnMessage = false; - private int[][] POSITIONS; + private static HashMap POSITIONS = new HashMap<>(); /** * @return x, z coords on the circumference of @@ -37,8 +38,8 @@ private static boolean areCoordsEqual(int @NotNull [] a, int x, int z) { } public int[][] strongholdPositions(@NotNull TerraformWorld tw) { - if (POSITIONS == null) { - POSITIONS = new int[3 + 6 + 10 + 15 + 21 + 28 + 36 + 9][2]; + if (!POSITIONS.containsKey(tw)) { + int[][] positions = new int[3 + 6 + 10 + 15 + 21 + 28 + 36 + 9][2]; int pos = 0; int radius = 1408; Random rand = tw.getHashedRand(1, 1, 1); @@ -48,47 +49,47 @@ public int[][] strongholdPositions(@NotNull TerraformWorld tw) { TerraformGeneratorPlugin.logger.info("Will spawn stronghold at: " + coords[0] + ", " + coords[1]); debugSpawnMessage = true; } - POSITIONS[pos++] = coords; + positions[pos++] = coords; } radius += 3072; // TerraformGeneratorPlugin.logger.debug("sp-1"); for (int i = 0; i < 6; i++) { - POSITIONS[pos++] = randomCircleCoords(rand, radius); + positions[pos++] = randomCircleCoords(rand, radius); } radius += 3072; // TerraformGeneratorPlugin.logger.debug("sp-2"); for (int i = 0; i < 10; i++) { - POSITIONS[pos++] = randomCircleCoords(rand, radius); + positions[pos++] = randomCircleCoords(rand, radius); } radius += 3072; // TerraformGeneratorPlugin.logger.debug("sp-3"); for (int i = 0; i < 15; i++) { - POSITIONS[pos++] = randomCircleCoords(rand, radius); + positions[pos++] = randomCircleCoords(rand, radius); } radius += 3072; // TerraformGeneratorPlugin.logger.debug("s-pop-4"); for (int i = 0; i < 21; i++) { - POSITIONS[pos++] = randomCircleCoords(rand, radius); + positions[pos++] = randomCircleCoords(rand, radius); } radius += 3072; // TerraformGeneratorPlugin.logger.debug("s-pop-5"); for (int i = 0; i < 28; i++) { - POSITIONS[pos++] = randomCircleCoords(rand, radius); + positions[pos++] = randomCircleCoords(rand, radius); } radius += 3072; // TerraformGeneratorPlugin.logger.debug("s-pop-6"); for (int i = 0; i < 36; i++) { - POSITIONS[pos++] = randomCircleCoords(rand, radius); + positions[pos++] = randomCircleCoords(rand, radius); } radius += 3072; // TerraformGeneratorPlugin.logger.debug("s-pop-7"); for (int i = 0; i < 9; i++) { - POSITIONS[pos++] = randomCircleCoords(rand, radius); + positions[pos++] = randomCircleCoords(rand, radius); } // TerraformGeneratorPlugin.logger.debug("s-pop-8"); - + POSITIONS.put(tw,positions); } - return POSITIONS; + return POSITIONS.get(tw); } @Override diff --git a/common/src/main/java/org/terraform/tree/FractalTreeBuilder.java b/common/src/main/java/org/terraform/tree/FractalTreeBuilder.java index 95b3a58c..a11f4b54 100644 --- a/common/src/main/java/org/terraform/tree/FractalTreeBuilder.java +++ b/common/src/main/java/org/terraform/tree/FractalTreeBuilder.java @@ -1031,6 +1031,11 @@ private void replaceSphere(float rX, float rY, float rZ, @NotNull SimpleBlock bl if (GenUtils.chance(2, 10)) { dangleLeavesDown(rel, vines / 2, vines); } + else if (GenUtils.chance(1, 10)) + { + rel.rsetType(BlockUtils.replacableByTrees, this.trunkType); + BlockUtils.vineUp(rel, 4); + } } } } diff --git a/common/src/main/resources/plugin.yml b/common/src/main/resources/plugin.yml index a33a4c22..86bfc46c 100644 --- a/common/src/main/resources/plugin.yml +++ b/common/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: TerraformGenerator author: Hex_27 -version: 17.0.0 +version: 17.0.1 api-version: 1.18 description: World Generator main: org.terraform.main.TerraformGeneratorPlugin diff --git a/implementation/v1_21_R1/build.gradle.kts b/implementation/v1_21_R1/build.gradle.kts index 82ec1fe4..4f4f1739 100644 --- a/implementation/v1_21_R1/build.gradle.kts +++ b/implementation/v1_21_R1/build.gradle.kts @@ -1,6 +1,6 @@ dependencies { implementation(project(":common")) - compileOnly(group = "org.spigotmc", name = "spigot", version = "1.21-R0.1-SNAPSHOT") + compileOnly(group = "org.spigotmc", name = "spigot", version = "1.21.1-R0.1-SNAPSHOT") compileOnly("org.jetbrains:annotations:20.1.0") compileOnly("com.github.AvarionMC:yaml:1.1.3") } diff --git a/implementation/v1_21_R2/build.gradle.kts b/implementation/v1_21_R2/build.gradle.kts index e281165a..594a2a5e 100644 --- a/implementation/v1_21_R2/build.gradle.kts +++ b/implementation/v1_21_R2/build.gradle.kts @@ -1,6 +1,6 @@ dependencies { implementation(project(":common")) - compileOnly(group = "org.spigotmc", name = "spigot", version = "1.21.2-R0.1-SNAPSHOT") + compileOnly(group = "org.spigotmc", name = "spigot", version = "1.21.3-R0.1-SNAPSHOT") compileOnly("org.jetbrains:annotations:20.1.0") compileOnly("com.github.AvarionMC:yaml:1.1.3") }