mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-29 09:15:27 +00:00
Pick regions, biomes and children by weight
Rarity gave every list entry a share of 1 / rarity and children rounded slots; a weight on the list entry says what a pack author means. Dimension regions, region biome lists, biome children and carving children are now entries with a weight (1 to 1000), picked along the list in the order written, region and biome lists giving the edge to the earlier entry and children to the later. A biome keeps itself among its children only where it lists itself. PackBiome and PackRegion carry the weighted lists, and the carving module picks with the API's Weighted.pick. Rarity is gone from biomes and regions, and the three fixture packs are rewritten to the entry format. No pin or golden moved: the changed generator seed only touches biomes of rarity other than 1, and no pinned world reads one. The fixture packs now have weights where their regions had rarities: pack-before-the-port forests 15, magnetics 1; pack-before-loot-and-spawn hot 10, terralost 6, mushroom 2, swamp 15, the rest 1. v3: 0fbce6ba2 a598b4323 96beb86e0
This commit is contained in:
1 parent
d705dee379
commit
3d55236f97
90 files changed
+1022
-1183
No files matched your search
@@ -160,24 +160,20 @@ class ApiValuesTest {
|
||||
|
||||
@Test
|
||||
void packBiomesAndRegionsAreImmutableValues() {
|
||||
var children = new ArrayList<>(List.of(ResourceId.parse("pack:dunes")));
|
||||
var desert = new PackBiome(ResourceId.parse("pack:desert"), "Desert", ResourceId.parse("minecraft:desert"), 2, children);
|
||||
var children = new ArrayList<>(List.of(new Weighted<>(ResourceId.parse("pack:dunes"), 2)));
|
||||
var desert = new PackBiome(ResourceId.parse("pack:desert"), "Desert", ResourceId.parse("minecraft:desert"), children);
|
||||
children.clear();
|
||||
assertEquals(List.of(ResourceId.parse("pack:dunes")), desert.children());
|
||||
assertEquals(List.of(new Weighted<>(ResourceId.parse("pack:dunes"), 2)), desert.children());
|
||||
assertThrows(UnsupportedOperationException.class, () -> desert.children().clear());
|
||||
assertThrows(IllegalArgumentException.class,
|
||||
() -> new PackBiome(desert.id(), "Desert", desert.platformBiome(), 0, List.of()));
|
||||
assertEquals(desert.platformBiome(), desert.vanillaBiome(), "vanilla sees the platform biome unless a pack says otherwise");
|
||||
var mesa = new PackBiome(ResourceId.parse("pack:mesa"), "Mesa", ResourceId.parse("minecraft:desert"),
|
||||
ResourceId.parse("minecraft:badlands"), 1, List.of());
|
||||
ResourceId.parse("minecraft:badlands"), List.of());
|
||||
assertEquals(ResourceId.parse("minecraft:badlands"), mesa.vanillaBiome());
|
||||
|
||||
var land = List.of(desert.id());
|
||||
var arid = new PackRegion(ResourceId.parse("pack:arid"), "Arid", 1, land, List.of(), List.of(), List.of());
|
||||
var land = List.of(new Weighted<>(desert.id(), 1));
|
||||
var arid = new PackRegion(ResourceId.parse("pack:arid"), "Arid", land, List.of(), List.of(), List.of());
|
||||
assertEquals(land, arid.landBiomes());
|
||||
assertThrows(UnsupportedOperationException.class, () -> arid.caveBiomes().add(desert.id()));
|
||||
assertThrows(IllegalArgumentException.class,
|
||||
() -> new PackRegion(arid.id(), "Arid", 0, land, List.of(), List.of(), List.of()));
|
||||
assertThrows(UnsupportedOperationException.class, () -> arid.caveBiomes().add(new Weighted<>(desert.id(), 1)));
|
||||
}
|
||||
|
||||
static final class Keep {}
|
||||
|
||||
Reference in new issue
Block a user