Skip to content

Commit

Permalink
Updated to v17.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Hex27 committed Nov 17, 2024
1 parent ca274b8 commit 7f30f9c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<TerraformWorld,int[][]> POSITIONS = new HashMap<>();

/**
* @return x, z coords on the circumference of
Expand All @@ -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);
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion common/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion implementation/v1_21_R1/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion implementation/v1_21_R2/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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")
}
Expand Down

0 comments on commit 7f30f9c

Please sign in to comment.