mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-30 09:44:24 +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
+2
-3
@@ -334,7 +334,7 @@ public class CommandStudio implements DirectorExecutor {
|
||||
boolean progressShown = false;
|
||||
int c = -1;
|
||||
try {
|
||||
engine.getDimension().getRegions().forEach(key -> data.put(key, new AtomicInteger(0)));
|
||||
engine.getDimension().getRegionKeys().forEach(key -> data.put(key, new AtomicInteger(0)));
|
||||
multiBurst = new MultiBurst("Region Sampler");
|
||||
var executor = multiBurst.burst(Math.min(radius * radius, 1 << 20));
|
||||
sender.sendMessage(IrisLanguage.text(BukkitCommandMessages.COMMAND_STUDIO_GENERATING_DATA));
|
||||
@@ -356,8 +356,7 @@ public class CommandStudio implements DirectorExecutor {
|
||||
executor.complete();
|
||||
|
||||
sender.sendMessage(IrisLanguage.text(BukkitCommandMessages.COMMAND_STUDIO_DONE));
|
||||
var loader = engine.getData().getRegionLoader();
|
||||
data.forEach((k, v) -> sender.sendMessage(IrisLanguage.text(BukkitCommandMessages.COMMAND_STUDIO_MESSAGE, MessageArgument.untrusted("k", k), MessageArgument.untrusted("value", loader.load(k).getRarity()), MessageArgument.untrusted("value2", Form.f((double) v.get() / totalTasks * 100, 2)))));
|
||||
data.forEach((k, v) -> sender.sendMessage(IrisLanguage.text(BukkitCommandMessages.COMMAND_STUDIO_MESSAGE, MessageArgument.untrusted("k", k), MessageArgument.untrusted("value", engine.getDimension().getRegionWeight(k)),MessageArgument.untrusted("value2", Form.f((double) v.get() / totalTasks * 100, 2)))));
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
sender.sendMessage(IrisLanguage.text(BukkitCommandMessagesExtended.COMMAND_STUDIO_REGIONS_SCAN_FAILED,
|
||||
|
||||
+2
-2
@@ -526,11 +526,11 @@ public class IrisWorldGeneratorResolverTest {
|
||||
Files.createDirectories(packRoot.resolve("biomes"));
|
||||
Files.writeString(
|
||||
packRoot.resolve("dimensions/main.json"),
|
||||
"{\"regions\":[\"region\"]}",
|
||||
"{\"regions\":[{\"region\":\"region\"}]}",
|
||||
StandardCharsets.UTF_8);
|
||||
Files.writeString(
|
||||
packRoot.resolve("regions/region.json"),
|
||||
"{\"landBiomes\":[\"biome\"]}",
|
||||
"{\"landBiomes\":[{\"biome\":\"biome\"}]}",
|
||||
StandardCharsets.UTF_8);
|
||||
Files.writeString(
|
||||
packRoot.resolve("biomes/biome.json"),
|
||||
|
||||
Reference in new issue
Block a user