This commit is contained in:
Brian Neumann-Fopiano committed 2026-07-30 02:36:15 -04:00
1 parent 7ad4909518
commit 0afbfcb7a2
110 files changed
+7157 -846

No files matched your search

@@ -59,12 +59,18 @@ public class ModdedStructureHooksTest {
IllegalStateException structureKeys = assertThrows(
IllegalStateException.class, hooks::structureKeys);
IllegalStateException jigsawStructureKeys = assertThrows(
IllegalStateException.class, hooks::jigsawStructureKeys);
IllegalStateException templatePoolKeys = assertThrows(
IllegalStateException.class, hooks::templatePoolKeys);
IllegalStateException structureSetKeys = assertThrows(
IllegalStateException.class, hooks::structureSetKeys);
IllegalStateException structureBiomeKeys = assertThrows(
IllegalStateException.class, () -> hooks.structureBiomeKeys("minecraft:village"));
assertTrue(structureKeys.getMessage().contains("before the Minecraft server is available"));
assertTrue(jigsawStructureKeys.getMessage().contains("before the Minecraft server is available"));
assertTrue(templatePoolKeys.getMessage().contains("before the Minecraft server is available"));
assertTrue(structureSetKeys.getMessage().contains("before the Minecraft server is available"));
assertTrue(structureBiomeKeys.getMessage().contains("before the Minecraft server is available"));
}
@@ -34,23 +34,21 @@ public class IrisModdedStructureCommandTest {
}
@Test
public void generatorLocateUsesIrisOnlyForExplicitReplacement() throws IOException {
public void generatorLocateUsesEveryIrisPlacedNativeStructure() throws IOException {
String source = moddedSource("IrisModdedChunkGenerator.java");
int methodStart = source.indexOf("private Pair<BlockPos, Holder<Structure>> findNearestIrisStructure(");
int methodEnd = source.indexOf("private HolderSet<Structure> filterReachableNativeStructures(", methodStart);
String method = source.substring(methodStart, methodEnd);
int unexploredGuard = method.indexOf("if (findUnexplored)");
int registryLookup = method.indexOf("level.registryAccess().lookupOrThrow(Registries.STRUCTURE)");
int policyResolution = method.indexOf("NativeStructureGenerationPolicy.resolve(current,");
int replacementCheck = method.indexOf(
"decision.status() != NativeStructureGenerationStatus.REPLACED_BY_IRIS", policyResolution);
int irisLocate = method.indexOf("IrisStructureLocator.locate(", replacementCheck);
int placedCheck = method.indexOf(
"if (!IrisStructureLocator.isPlaced(current, structureId))");
int irisLocate = method.indexOf("IrisStructureLocator.locate(", placedCheck);
assertTrue(unexploredGuard >= 0);
assertTrue(registryLookup > unexploredGuard);
assertTrue(policyResolution > registryLookup);
assertTrue(replacementCheck > policyResolution);
assertTrue(irisLocate > replacementCheck);
assertTrue(placedCheck > registryLookup);
assertTrue(irisLocate > placedCheck);
assertTrue(method.contains("LocateStatus.SEARCH_LIMIT_REACHED"));
assertTrue(method.contains("new BlockPos(result.originX(), result.baseY(), result.originZ())"));
assertFalse(method.contains("NativeStructureLocateCapability"));