From f686f6f827124d74de8897b6465b701666141bfc Mon Sep 17 00:00:00 2001 From: Ruling-0 <47913168+Ruling-0@users.noreply.github.com> Date: Sun, 27 Sep 2026 12:28:50 -0500 Subject: [PATCH] Build demon village loot on first use --- .../WayofTime/alchemicalWizardry/AlchemicalWizardry.java | 3 --- .../demonVillage/loot/DemonVillageLootRegistry.java | 8 +++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index c509ed74..c619255e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -86,7 +86,6 @@ import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityM import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntGuardianWind; import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntIce; import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntWind; -import WayofTime.alchemicalWizardry.common.demonVillage.loot.DemonVillageLootRegistry; import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonChest; import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal; import WayofTime.alchemicalWizardry.common.entity.mob.EntityAirElemental; @@ -3344,8 +3343,6 @@ public class AlchemicalWizardry { BloodMagicConfiguration.blacklistRituals(); BloodMagicConfiguration.loadCustomLPValues(); - DemonVillageLootRegistry.init(); - MeteorRegistry.loadConfig(); MeteorReagentRegistry.loadConfig(); MeteorRegistry.logMaterialLibTally(); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/loot/DemonVillageLootRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/loot/DemonVillageLootRegistry.java index 60515d91..3518478f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/loot/DemonVillageLootRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/loot/DemonVillageLootRegistry.java @@ -13,8 +13,13 @@ import WayofTime.alchemicalWizardry.ModItems; public class DemonVillageLootRegistry { public static ArrayList list1 = new ArrayList<>(); + private static boolean built = false; - public static void init() { + /// Copies the dungeon and desert-pyramid loot on first use rather than while loading, so the copy carries every + /// change other mods make to those tables during loading. + private static void build() { + if (built) return; + built = true; String[] tier1Strings = new String[] { ChestGenHooks.DUNGEON_CHEST, ChestGenHooks.PYRAMID_DESERT_CHEST }; for (String str : tier1Strings) { WeightedRandomChestContent[] contents = ChestGenHooks.getItems(str, new Random()); @@ -30,6 +35,7 @@ public class DemonVillageLootRegistry { } public static void populateChest(IInventory tile, int tier) { + build(); WeightedRandomChestContent .generateChestContents(new Random(), toArray(list1), tile, tile.getSizeInventory() / 3); }