Build demon village loot on first use

This commit is contained in:
Ruling-0 committed 2026-09-27 12:28:50 -05:00
1 parent 77969bb205
commit f686f6f827
2 files changed
+7 -4

No files matched your search

@@ -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();
@@ -13,8 +13,13 @@ import WayofTime.alchemicalWizardry.ModItems;
public class DemonVillageLootRegistry {
public static ArrayList<WeightedRandomChestContent> 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);
}