Audited datapack priority mixin

- The modded mixin audit checks that the pack selection mixin keeping the Iris forced datapack last is applied
- Ordering tests cover a world datapack saved after the Iris pack and already-ordered selections
This commit is contained in:
Brian Neumann-Fopiano
2026-10-14 21:41:41 -04:00
parent c9786f2d23
commit d5796b275e
2 changed files with 56 additions and 1 deletions
@@ -61,6 +61,10 @@ public final class ModdedMixinAudit {
NativeMixinTarget.STRUCTURE_PALETTE,
"iris$installConcurrentBlockCache",
false, NativeMixinFlags::structureTemplatePaletteRan),
new ExpectedMixin(ENTITY_CONFIG, "PackRepositorySelectionMixin",
NativeMixinTarget.PACK_REPOSITORY,
"volmlib$keepNativeDatapacksLast",
false, NativeMixinFlags::packSelectionRan),
new ExpectedMixin(CLIENT_CONFIG, "NativeWorldOpenFlowsMixin",
NativeMixinTarget.WORLD_OPEN_FLOWS,
"volmlib$openWorldCheckWorldStemCompatibility",
@@ -111,7 +115,7 @@ public final class ModdedMixinAudit {
ModdedIrisLog.error(" missing: {}", entry);
}
ModdedIrisLog.error("The mixin config was not registered for this loader (fabric.mod.json mixins, neoforge.mods.toml [[mixins]], forge MixinConfigs manifest attribute).");
ModdedIrisLog.error("Entity persistence, custom mob loot, parallel structure safety, readable biome identifiers, or Iris world-type labels are disabled until this is fixed.");
ModdedIrisLog.error("Entity persistence, custom mob loot, parallel structure safety, Iris datapack priority, readable biome identifiers, or Iris world-type labels are disabled until this is fixed.");
ModdedIrisLog.error("===============================================================");
}
@@ -0,0 +1,51 @@
/*
* Iris is a World Generator for Minecraft Servers
* Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.modded;
import art.arcane.volmlib.nativelib.minecraft26_2.modded.NativeDatapackSource;
import org.junit.Test;
import java.util.List;
import java.util.Set;
import java.util.function.Function;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
public class ModdedDatapackOrderTest {
private static final Set<String> PINNED = Set.of("iris_worldgen");
@Test
public void worldDatapacksSavedAfterTheIrisPackNoLongerOverrideIt() {
List<String> saved = List.of("vanilla", "mod_data", "iris_worldgen", "file/iristest");
assertEquals(List.of("vanilla", "mod_data", "file/iristest", "iris_worldgen"),
NativeDatapackSource.orderPinnedLast(saved, Function.identity(), PINNED));
}
@Test
public void alreadyLastOrUnpinnedSelectionsAreReturnedUnchanged() {
List<String> ordered = List.of("vanilla", "file/iristest", "iris_worldgen");
List<String> withoutIris = List.of("vanilla", "file/iristest");
assertSame(ordered, NativeDatapackSource.orderPinnedLast(ordered, Function.identity(), PINNED));
assertSame(withoutIris, NativeDatapackSource.orderPinnedLast(withoutIris, Function.identity(), PINNED));
assertSame(withoutIris, NativeDatapackSource.orderPinnedLast(withoutIris, Function.identity(), Set.of()));
}
}