diff --git a/DuneTerrain/README.md b/DuneTerrain/README.md index 3c38ea17..1535916e 100644 --- a/DuneTerrain/README.md +++ b/DuneTerrain/README.md @@ -10,7 +10,7 @@ DuneRealms terrain runs on Java 21. Build with `gradle build`; install `build/li - **Desert villages**: custom four-house sandstone settlements, with cut-sandstone lanes, villagers, beds, non-farming workstations, lanterns and finite shared supply chests. No farmland, crops or hay bales enter the structure palette. Chests use `dunerealms:chests/desert-village`: bread, dried kelp, apples and raw iron. Placement regions default to 768 blocks, with terrain suitability checks. - **Old Harkonnen Fortress**: a custom jungle-temple-style Arrakis adaptation with sandstone walls, darkstone pillars, a stepped roof, red banner, stair and underground loot vault. It is a custom layout, not a replacement of Minecraft's built-in jungle temple structure definition. The default attempt rate is one per 1,000 Arrakis chunks, matching the Java desert-well-style chance; uneven terrain can reject an attempt. Its finite chest uses `dunerealms:chests/old-harkonnen-fortress`. When loot is generated, DuneTerrain appends a complete Harkonnen kit from the updated DuneCore kit factory: red faction stillsuit, native equipment attributes and trim, and the enchanted spice shovel. Food and raw iron also come from the loot table. Install updated Core and Terrain together; without the updated Core API, fortress rewards fall back to basic sword/food rather than fabricated faction equipment. -Dune-highlands receive three naturally generated compact cave sietches per region by default (three times the one-site regional baseline, with a minimum of three). Each has a cave mouth, sleeping and kitchen chambers, a reservoir, and an independent personal supply cache using the existing loot/claim rules. The existing 2,000-block open-desert sietch placement algorithm and large cave template are unchanged. Configure only the new `sietches.highlands` section to tune or disable highland sites; `sietches.spacing` still controls the original desert grid. These extra caves apply only to new chunks; previously generated highlands are not retrofitted. +Arrakis generates small, medium, and large sietches on separate grids with default spacing of 600, 900, and 2,000 blocks. Larger tiers take priority when footprints overlap. Each tier has independent `enabled` and `spacing` settings under `sietches`. Placement applies as chunks generate. Oasis trees, personal cave sietch supplies, regular suspicious-sand spice deposits and magma-marked spice blows remain enabled. Custom structures are generated only on the Arrakis world. diff --git a/DuneTerrain/src/main/java/com/example/duneterrain/DuneTerrain.java b/DuneTerrain/src/main/java/com/example/duneterrain/DuneTerrain.java index 754a6bc4..eb054ca8 100644 --- a/DuneTerrain/src/main/java/com/example/duneterrain/DuneTerrain.java +++ b/DuneTerrain/src/main/java/com/example/duneterrain/DuneTerrain.java @@ -720,8 +720,7 @@ public final class DuneTerrain extends JavaPlugin implements Listener { } private int spacing(SietchLayout.Tier tier) { - int fallback = tier == SietchLayout.Tier.LARGE ? plugin.getConfig().getInt("sietches.spacing", tier.spacing) : tier.spacing; - return Math.max(128, plugin.getConfig().getInt("sietches." + tier.key() + ".spacing", fallback)); + return Math.max(128, plugin.getConfig().getInt("sietches." + tier.key() + ".spacing", tier.spacing)); } @Override public void populate(WorldInfo world, Random random, int cx, int cz, LimitedRegion region) { diff --git a/DuneTerrain/src/main/java/com/example/duneterrain/HighlandSietches.java b/DuneTerrain/src/main/java/com/example/duneterrain/HighlandSietches.java deleted file mode 100644 index 2b015475..00000000 --- a/DuneTerrain/src/main/java/com/example/duneterrain/HighlandSietches.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.example.duneterrain; - -import java.util.*; - -/** Threefold regional placement, independent of the legacy open-desert sietch grid. */ -final class HighlandSietches { - record Site(int x,int z,long cacheId) {} - static List sites(RockPlateaus.Shape shape,int multiplier,int minimum) { - int target=Math.max(3,Math.min(12,Math.max(minimum,multiplier))); - List candidates=new ArrayList<>(); - int extent=(int)Math.ceil(shape.radius()*1.6); - for(int dx=-extent;dx<=extent;dx+=2)for(int dz=-extent;dz<=extent;dz+=2) { - int x=(int)shape.centerX()+dx,z=(int)shape.centerZ()+dz; - if(shape.depth(x,z)<.25)continue; - candidates.add(new Site(x,z,DenseSpice.mix(shape.seed()^x*341873128712L^z*132897987541L^0x5349455443484849L))); - } - List result=new ArrayList<>(); - // Start at one end, then choose the farthest remaining sites, keeping compact caves apart. - Site center=new Site((int)shape.centerX(),(int)shape.centerZ(),0); - candidates.sort(Comparator.comparingLong(s->distance(s,center)).reversed().thenComparingLong(Site::cacheId)); - while(result.size()distance(s,candidate)).min().orElse(0); - if(nearest>distance){distance=nearest;best=candidate;} - } - if(!result.isEmpty()&&distance<26L*26)break; - result.add(best);candidates.remove(best); - } - return List.copyOf(result); - } - private static long distance(Site a,Site b) {long dx=a.x()-b.x(),dz=a.z()-b.z();return dx*dx+dz*dz;} -} diff --git a/DuneTerrain/src/test/java/com/example/duneterrain/HighlandSietchesTest.java b/DuneTerrain/src/test/java/com/example/duneterrain/HighlandSietchesTest.java deleted file mode 100644 index fbcffd29..00000000 --- a/DuneTerrain/src/test/java/com/example/duneterrain/HighlandSietchesTest.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.example.duneterrain; -import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; -class HighlandSietchesTest { - @Test void everyDefaultHighlandHasThreeDistinctSpacedCavesInsideItsFootprint() { - for(int cx=-10;cx<=10;cx++)for(int cz=-10;cz<=10;cz++) { - long seed=RockPlateaus.formationSeed(cx,cz); - var shape=RockPlateaus.shape(seed,RockPlateaus.centerX(cx,300,500),RockPlateaus.centerZ(cz,300,500),RockPlateaus.radius(seed,45,55),.02); - var sites=HighlandSietches.sites(shape,3,3);assertEquals(3,sites.size(),"region "+cx+","+cz); - assertEquals(sites,HighlandSietches.sites(shape,3,3)); - assertEquals(3,sites.stream().map(HighlandSietches.Site::cacheId).distinct().count()); - for(var a:sites){assertTrue(shape.depth(a.x(),a.z())>=.25);for(var b:sites)if(a!=b){int dx=a.x()-b.x(),dz=a.z()-b.z();assertTrue(dx*dx+dz*dz>=676);}} - } - } -} diff --git a/DuneTerrain/src/test/resources/retained-arrakis-terrain.json b/DuneTerrain/src/test/resources/retained-arrakis-terrain.json index 4b1dd39f..da61f8ef 100644 --- a/DuneTerrain/src/test/resources/retained-arrakis-terrain.json +++ b/DuneTerrain/src/test/resources/retained-arrakis-terrain.json @@ -248,39 +248,6 @@ ], "fields": [] }, - "com/example/duneterrain/HighlandSietches$Site": { - "methods": [ - [ - "toString", - "()Ljava/lang/String;" - ], - [ - "hashCode", - "()I" - ], - [ - "equals", - "(Ljava/lang/Object;)Z" - ], - [ - "x", - "()I" - ], - [ - "z", - "()I" - ], - [ - "cacheId", - "()J" - ] - ], - "fields": [] - }, - "com/example/duneterrain/HighlandSietches": { - "methods": [], - "fields": [] - }, "com/example/duneterrain/RockPlateaus$Shape": { "methods": [ [