mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-12-01 10:14:36 +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
+1
-1
@@ -91,7 +91,7 @@ final class ModdedCommandSuggestions {
|
||||
try {
|
||||
Engine engine = IrisModdedCommands.engineFor(context.getSource().getLevel());
|
||||
if (engine != null) {
|
||||
return SharedSuggestionProvider.suggest(engine.getDimension().getRegions(), builder);
|
||||
return SharedSuggestionProvider.suggest(engine.getDimension().getRegionKeys(), builder);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
warnTabFailure("region keys", context.getSource(), e);
|
||||
|
||||
+2
-4
@@ -788,7 +788,7 @@ public final class ModdedStudioCommands {
|
||||
int diameter = radius * 2;
|
||||
int totalTasks = diameter * diameter;
|
||||
KMap<String, AtomicInteger> counts = new KMap<>();
|
||||
engine.getDimension().getRegions().forEach((String key) -> counts.put(key, new AtomicInteger(0)));
|
||||
engine.getDimension().getRegionKeys().forEach((String key) -> counts.put(key, new AtomicInteger(0)));
|
||||
// finally-scoped: a throw mid-scan previously leaked the sampler's whole
|
||||
// ForkJoinPool (close() is the only thing that shuts it down).
|
||||
MultiBurst burst = new MultiBurst("Region Sampler");
|
||||
@@ -803,9 +803,7 @@ public final class ModdedStudioCommands {
|
||||
burst.close();
|
||||
}
|
||||
server.execute(() -> counts.forEach((String key, AtomicInteger count) -> {
|
||||
IrisRegion region = engine.getData().getRegionLoader().load(key);
|
||||
String rarity = region == null ? "?" : String.valueOf(region.getRarity());
|
||||
IrisModdedCommands.ok(source, IrisLanguage.plain(ModdedCommandMessages.MODDED_STUDIO_COMMANDS_RARITY, MessageArgument.untrusted("key", key), MessageArgument.untrusted("rarity", rarity), MessageArgument.untrusted("value", Form.f((double) count.get() / totalTasks * 100, 2))));
|
||||
IrisModdedCommands.ok(source, IrisLanguage.plain(ModdedCommandMessages.MODDED_STUDIO_COMMANDS_RARITY, MessageArgument.untrusted("key", key), MessageArgument.untrusted("rarity", engine.getDimension().getRegionWeight(key)),MessageArgument.untrusted("value", Form.f((double) count.get() / totalTasks * 100, 2))));
|
||||
}));
|
||||
} catch (Throwable e) {
|
||||
ModdedIrisLog.error("Iris region sampling failed", e);
|
||||
|
||||
Reference in new issue
Block a user