Drop the legacy structure index cleanup

structures/structure-index.json is no longer removed or skipped by validation.
Nothing is released, so an old pack that still has the file sees it reported as
a structure without a start pool.
This commit is contained in:
piexel committed 2026-11-06 10:07:32 +01:00
1 parent ab32568550
commit 4e7a46fb2d
3 files changed
+3 -74

No files matched your search

@@ -37,8 +37,6 @@ import java.util.concurrent.ConcurrentHashMap;
public final class StructureIndexService {
private static final String INDEX_PATH = ".iris/structure-index.json";
private static final String LEGACY_INDEX_PATH = "structures/structure-index.json";
private static final String LEGACY_INDEX_KEY = "structure-index";
private static final Set<String> GENERATED = ConcurrentHashMap.newKeySet();
private StructureIndexService() {
@@ -65,7 +63,6 @@ public final class StructureIndexService {
}
public static File write(IrisData data) {
removeLegacyIndex(data);
List<String> structures = IrisPlatforms.get().structureHooks().structureKeys();
List<String> sets = IrisPlatforms.get().structureHooks().structureSetKeys();
@@ -90,7 +87,6 @@ public final class StructureIndexService {
}
List<String> iris = new ArrayList<>(ModuleServices.structureKeys(data));
iris.removeIf(LEGACY_INDEX_KEY::equals);
Collections.sort(vanilla);
Collections.sort(datapack);
@@ -133,20 +129,4 @@ public final class StructureIndexService {
static File indexFile(File dataFolder) {
return new File(dataFolder, INDEX_PATH);
}
static File legacyIndexFile(File dataFolder) {
return new File(dataFolder, LEGACY_INDEX_PATH);
}
static void removeLegacyIndex(IrisData data) {
File legacyFile = legacyIndexFile(data.getDataFolder());
try {
if (Files.deleteIfExists(legacyFile.toPath())) {
data.invalidateStructureResources();
}
} catch (Throwable e) {
IrisLogging.reportError("Failed to remove legacy structure index '"
+ legacyFile.getAbsolutePath() + "'", e);
}
}
}
@@ -58,7 +58,6 @@ public final class StructureGraphValidation {
private static final List<Long> GEOMETRY_SAMPLE_SEEDS = List.of(
0L, 1L, 2L, 3L, 5L, 8L, 13L, 21L, 34L, 55L, 89L, 144L, 233L, 377L, 610L, 987L);
private static final int GEOMETRY_SAMPLE_ORIGIN_Y = 64;
private static final String LEGACY_INDEX_KEY = "structure-index";
private static final String OBJECTS_FOLDER = "objects";
private static final String OBJECT_EXTENSION = ".iob";
private static final String JSON_EXTENSION = ".json";
@@ -79,7 +78,7 @@ public final class StructureGraphValidation {
PackStructureResolver resolver = new PackStructureResolver(data);
for (ResourceId id : data.getPackResources().ids(StructureResources.STRUCTURES)) {
String structureKey = id.path();
if (structureKey.equals(LEGACY_INDEX_KEY) || (activeStructureKeys != null && !activeStructureKeys.contains(structureKey))) {
if (activeStructureKeys != null && !activeStructureKeys.contains(structureKey)) {
continue;
}
IrisStructure structure = StructureResources.structure(data.getPackResources(), structureKey);