From 5e2eaba07e93f5509992439b51e9fa975e8a108a Mon Sep 17 00:00:00 2001 From: piexel Date: Wed, 28 Oct 2026 04:16:10 +0100 Subject: [PATCH] Follow the loot source id and the explicit jigsaw overrides Debug lore names the table by its path. The native structure start plan keeps SOURCE for an option the pack left out, as before. --- .../arcane/iris/core/modules/ModuleVanillaStructures.java | 4 ++-- .../iris/engine/framework/NativeJigsawOverrides.java | 3 ++- .../art/arcane/iris/platform/bukkit/BukkitItemStacks.java | 2 +- .../iris/core/modules/ModuleSettingsDecoderTest.java | 2 +- .../java/art/arcane/iris/engine/loot/LootItemsTest.java | 8 +++++--- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/art/arcane/iris/core/modules/ModuleVanillaStructures.java b/core/src/main/java/art/arcane/iris/core/modules/ModuleVanillaStructures.java index f44db2554..85bd455d9 100644 --- a/core/src/main/java/art/arcane/iris/core/modules/ModuleVanillaStructures.java +++ b/core/src/main/java/art/arcane/iris/core/modules/ModuleVanillaStructures.java @@ -230,10 +230,10 @@ public final class ModuleVanillaStructures { boxed(overrides.maxDistanceHorizontal()), boxed(overrides.maxDistanceVertical()), overrides.useExpansionHack().orElse(null), - overrides.projectStartToHeightmap().name(), + overrides.projectStartToHeightmap().map(Enum::name).orElse(NativeJigsawOverrides.SOURCE), boxed(overrides.dimensionPaddingBottom()), boxed(overrides.dimensionPaddingTop()), - overrides.liquidSettings().name()); + overrides.liquidSettings().map(Enum::name).orElse(NativeJigsawOverrides.SOURCE)); } private static Integer boxed(OptionalInt value) { diff --git a/core/src/main/java/art/arcane/iris/engine/framework/NativeJigsawOverrides.java b/core/src/main/java/art/arcane/iris/engine/framework/NativeJigsawOverrides.java index 17c4a25b1..6f820a4a6 100644 --- a/core/src/main/java/art/arcane/iris/engine/framework/NativeJigsawOverrides.java +++ b/core/src/main/java/art/arcane/iris/engine/framework/NativeJigsawOverrides.java @@ -3,7 +3,8 @@ package art.arcane.iris.engine.framework; /** * Changes a module makes to a jigsaw structure's registered definition before the platform assembles a start of it, * as the platform code applies them: a blank text or a null value keeps the definition's own. The heightmap and liquid - * settings are the names of the API's {@code JigsawOverrides} constants ({@code SOURCE} keeps the definition's). + * settings are the names of the API's {@code JigsawOverrides} constants, or {@code SOURCE} to keep the definition's (the + * API leaves such an option out instead). */ public record NativeJigsawOverrides( String startPool, diff --git a/core/src/main/java/art/arcane/iris/platform/bukkit/BukkitItemStacks.java b/core/src/main/java/art/arcane/iris/platform/bukkit/BukkitItemStacks.java index bf975b71c..17108092c 100644 --- a/core/src/main/java/art/arcane/iris/platform/bukkit/BukkitItemStacks.java +++ b/core/src/main/java/art/arcane/iris/platform/bukkit/BukkitItemStacks.java @@ -205,7 +205,7 @@ public final class BukkitItemStacks { return; } long combined = (long) source.tableRarity() * source.entryRarity(); - lore.add(C.GRAY + "From: " + source.table().get() + " (" + Form.pc(1D / source.tableRarity(), CHANCE_DIGITS) + ")"); + lore.add(C.GRAY + "From: " + source.table().get().path() + " (" + Form.pc(1D / source.tableRarity(), CHANCE_DIGITS) + ")"); lore.add(C.GRAY + "1 in " + combined + " Chance (" + Form.pc(1D / combined, CHANCE_DIGITS) + ")"); } } diff --git a/core/src/test/java/art/arcane/iris/core/modules/ModuleSettingsDecoderTest.java b/core/src/test/java/art/arcane/iris/core/modules/ModuleSettingsDecoderTest.java index 3395a08cc..476168bb7 100644 --- a/core/src/test/java/art/arcane/iris/core/modules/ModuleSettingsDecoderTest.java +++ b/core/src/test/java/art/arcane/iris/core/modules/ModuleSettingsDecoderTest.java @@ -241,7 +241,7 @@ public class ModuleSettingsDecoderTest { () -> values("{\"mossValues\": {\"jigsaw\": {\"liquidSettings\": \"WET\"}}}")); assertTrue(failure.getMessage(), failure.getMessage().contains( - "\"WET\" is not one of [SOURCE, IGNORE_WATERLOGGING, APPLY_WATERLOGGING]")); + "\"WET\" is not one of [IGNORE_WATERLOGGING, APPLY_WATERLOGGING]")); } private ValuesSettings values(String json) { diff --git a/core/src/test/java/art/arcane/iris/engine/loot/LootItemsTest.java b/core/src/test/java/art/arcane/iris/engine/loot/LootItemsTest.java index fc710eed3..10327bdff 100644 --- a/core/src/test/java/art/arcane/iris/engine/loot/LootItemsTest.java +++ b/core/src/test/java/art/arcane/iris/engine/loot/LootItemsTest.java @@ -127,12 +127,14 @@ public class LootItemsTest { public void debugItemsSayWhereTheyCameFrom() { LootTable table = table("{\"name\": \"dungeon\", \"rarity\": 4, \"minPicked\": 1, \"maxPicked\": 1, \"loot\": [{\"type\": \"diamond\", \"rarity\": 3}]}"); - List drops = new LootItems(registry, true, ModuleLogs.discarding()).draw("dungeon", table, LOOT_SEED, 0, 64, 0); + ResourceId dungeon = ResourceId.parse("test:dungeon"); + + List drops = new LootItems(registry, true, ModuleLogs.discarding()).draw(dungeon, table, LOOT_SEED, 0, 64, 0); for (ItemDrop drop : drops) { - assertEquals(Optional.of(new ItemDrop.Source(Optional.of("dungeon"), 4, 3)), drop.source()); + assertEquals(Optional.of(new ItemDrop.Source(Optional.of(dungeon), 4, 3)), drop.source()); } - assertTrue(new LootItems(registry, false, ModuleLogs.discarding()).draw("dungeon", table, LOOT_SEED, 0, 64, 0).stream().allMatch(drop -> drop.source().isEmpty())); + assertTrue(new LootItems(registry, false, ModuleLogs.discarding()).draw(dungeon, table, LOOT_SEED, 0, 64, 0).stream().allMatch(drop -> drop.source().isEmpty())); } @Test