diff --git a/adapters/fabric/build.gradle b/adapters/fabric/build.gradle
index 890b776d9..40aa83e27 100644
--- a/adapters/fabric/build.gradle
+++ b/adapters/fabric/build.gradle
@@ -140,6 +140,8 @@ dependencies {
add('implementation', notation)
}
compileOnly('org.slf4j:slf4j-api:2.0.17')
+ compileOnly('com.volmit:iris-api')
+ testImplementation('com.volmit:iris-api')
compileOnly(libs.spigot) {
transitive = false
}
diff --git a/adapters/fabric/settings.gradle b/adapters/fabric/settings.gradle
index c46bcfa7c..02f53802e 100644
--- a/adapters/fabric/settings.gradle
+++ b/adapters/fabric/settings.gradle
@@ -43,6 +43,8 @@ dependencyResolutionManagement {
// Shared VolmLib source resolution; see gradle/volmlib-resolution.settings.gradle.
apply from: new File(settingsDir, '../../gradle/volmlib-resolution.settings.gradle').canonicalFile
+// Core's own dependencies on IrisApi must resolve here too, and the adapter reads IrisApi types (ResourceId, BlockTurn).
+apply from: new File(settingsDir, '../../gradle/irisapi-resolution.settings.gradle').canonicalFile
includeBuild('../..') {
dependencySubstitution {
diff --git a/adapters/forge/build.gradle b/adapters/forge/build.gradle
index 7991cfed5..ddd03d5f6 100644
--- a/adapters/forge/build.gradle
+++ b/adapters/forge/build.gradle
@@ -133,6 +133,8 @@ dependencies {
testImplementation('junit:junit:4.13.2')
testImplementation('org.mockito:mockito-core:5.23.0')
compileOnly('org.slf4j:slf4j-api:2.0.17')
+ compileOnly('com.volmit:iris-api')
+ testImplementation('com.volmit:iris-api')
compileOnly(libs.spigot) {
transitive = false
}
diff --git a/adapters/forge/settings.gradle b/adapters/forge/settings.gradle
index d24d880c0..d5d9c90dc 100644
--- a/adapters/forge/settings.gradle
+++ b/adapters/forge/settings.gradle
@@ -43,6 +43,8 @@ dependencyResolutionManagement {
// Shared VolmLib source resolution; see gradle/volmlib-resolution.settings.gradle.
apply from: new File(settingsDir, '../../gradle/volmlib-resolution.settings.gradle').canonicalFile
+// Core's own dependencies on IrisApi must resolve here too, and the adapter reads IrisApi types (ResourceId, BlockTurn).
+apply from: new File(settingsDir, '../../gradle/irisapi-resolution.settings.gradle').canonicalFile
includeBuild('../..') {
dependencySubstitution {
diff --git a/adapters/modded-common/src/test/java/art/arcane/iris/nativegen/NativeStructureReferenceRepairTest.java b/adapters/modded-common/src/test/java/art/arcane/iris/nativegen/NativeStructureReferenceRepairTest.java
index faff9f564..97e447eba 100644
--- a/adapters/modded-common/src/test/java/art/arcane/iris/nativegen/NativeStructureReferenceRepairTest.java
+++ b/adapters/modded-common/src/test/java/art/arcane/iris/nativegen/NativeStructureReferenceRepairTest.java
@@ -61,7 +61,6 @@ import static org.mockito.Mockito.mockStatic;
import static org.mockito.Mockito.when;
public class NativeStructureReferenceRepairTest {
- private static final long MONUMENT_PLACEMENT_IDENTITY = 0x4D4F4E554D454E54L;
@BeforeClass
public static void bootstrapMinecraftRegistries() {
@@ -192,7 +191,7 @@ public class NativeStructureReferenceRepairTest {
private static NativeStructureStartPlan plan(ChunkPos origin, int baseY) {
return new NativeStructureStartPlan("minecraft:monument", origin.x(), origin.z(), baseY, false, false,
- MONUMENT_PLACEMENT_IDENTITY, null, null);
+ null, null);
}
private static ChunkPos outsideLiveBounds(NativeStructureOwnershipRecord ownership,
diff --git a/adapters/neoforge/build.gradle b/adapters/neoforge/build.gradle
index 8f256eda9..5113e49d0 100644
--- a/adapters/neoforge/build.gradle
+++ b/adapters/neoforge/build.gradle
@@ -109,6 +109,8 @@ dependencies {
testRuntimeOnly('org.junit.platform:junit-platform-launcher:6.1.2')
testRuntimeOnly('org.junit.vintage:junit-vintage-engine:6.1.2')
compileOnly('org.slf4j:slf4j-api:2.0.17')
+ compileOnly('com.volmit:iris-api')
+ testImplementation('com.volmit:iris-api')
compileOnly(libs.spigot) {
transitive = false
}
diff --git a/adapters/neoforge/settings.gradle b/adapters/neoforge/settings.gradle
index e8ebcffd5..6409d443b 100644
--- a/adapters/neoforge/settings.gradle
+++ b/adapters/neoforge/settings.gradle
@@ -43,6 +43,8 @@ dependencyResolutionManagement {
// Shared VolmLib source resolution; see gradle/volmlib-resolution.settings.gradle.
apply from: new File(settingsDir, '../../gradle/volmlib-resolution.settings.gradle').canonicalFile
+// Core's own dependencies on IrisApi must resolve here too, and the adapter reads IrisApi types (ResourceId, BlockTurn).
+apply from: new File(settingsDir, '../../gradle/irisapi-resolution.settings.gradle').canonicalFile
includeBuild('../..') {
dependencySubstitution {
diff --git a/core/src/main/java/art/arcane/iris/core/modules/ObjectPlacementSettingsReader.java b/core/src/main/java/art/arcane/iris/core/modules/ObjectPlacementSettingsReader.java
deleted file mode 100644
index 41080df51..000000000
--- a/core/src/main/java/art/arcane/iris/core/modules/ObjectPlacementSettingsReader.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * 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 .
- */
-
-package art.arcane.iris.core.modules;
-
-import art.arcane.iris.builtin.objects.ObjectPlacement;
-import com.google.gson.Gson;
-import com.google.gson.JsonElement;
-import com.google.gson.TypeAdapter;
-import com.google.gson.TypeAdapterFactory;
-import com.google.gson.reflect.TypeToken;
-import com.google.gson.stream.JsonReader;
-import com.google.gson.stream.JsonWriter;
-
-import java.io.IOException;
-import java.util.function.Supplier;
-
-/**
- * Reads the object placements an Iris resource nests, such as a mod's placement injectors, the way {@code iris:objects}
- * reads its own: with the modules' Gson, keeping the JSON that declares the placement's module settings. Register it
- * before the factory that resolves snippets: Gson asks later registrations first, so that factory reads a snippet
- * reference and this one decodes the snippet's JSON.
- */
-public final class ObjectPlacementSettingsReader implements TypeAdapterFactory {
- private final Supplier decoder;
-
- /** {@code decoder} is asked for on the first placement read, so reading no placement loads no modules. */
- public ObjectPlacementSettingsReader(Supplier decoder) {
- this.decoder = decoder;
- }
-
- @Override
- @SuppressWarnings("unchecked") // The type is checked to be ObjectPlacement.
- public TypeAdapter create(Gson gson, TypeToken type) {
- if (type.getRawType() != ObjectPlacement.class) {
- return null;
- }
- TypeAdapter elements = gson.getAdapter(JsonElement.class);
- return (TypeAdapter) new TypeAdapter() {
- @Override
- public void write(JsonWriter out, ObjectPlacement placement) throws IOException {
- if (placement == null || placement.json() == null) {
- out.nullValue();
- return;
- }
- out.jsonValue(placement.json());
- }
-
- @Override
- public ObjectPlacement read(JsonReader in) throws IOException {
- JsonElement json = elements.read(in);
- if (json == null || json.isJsonNull()) {
- return null;
- }
- return decoder.get().decodeResource(ObjectPlacement.class, json.toString());
- }
- };
- }
-}
diff --git a/core/src/main/java/art/arcane/iris/core/pack/PackCaveProfileValidator.java b/core/src/main/java/art/arcane/iris/core/pack/PackCaveProfileValidator.java
deleted file mode 100644
index b2765a01d..000000000
--- a/core/src/main/java/art/arcane/iris/core/pack/PackCaveProfileValidator.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 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 .
- */
-
-package art.arcane.iris.core.pack;
-
-import art.arcane.volmlib.util.json.JSONObject;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-
-final class PackCaveProfileValidator {
- private static final String CAVE_PROFILE_SNIPPET_FOLDER = "snippet/iris/carve/cave-profile";
- private static final List LEGACY_FIELDS = List.of(
- new LegacyField("allowWater", "allowFluid"),
- new LegacyField("waterMinDepthBelowSurface", "fluidMinDepthBelowSurface"),
- new LegacyField("waterRequiresFloor", "fluidRequiresFloor")
- );
-
- private PackCaveProfileValidator() {
- }
-
- static List validateLegacyFields(File packFolder) {
- List blockingErrors = new ArrayList<>();
- if (packFolder == null || !packFolder.isDirectory()) {
- return blockingErrors;
- }
-
- for (String folderName : PackValidator.STRUCTURE_HOST_FOLDERS) {
- File resourceFolder = new File(packFolder, folderName);
- if (!resourceFolder.isDirectory()) {
- continue;
- }
- List resourceFiles = PackValidationIo.listJsonRecursive(resourceFolder);
- resourceFiles.sort(Comparator.comparing(File::getPath));
- String resourceType = PackStructurePlacementValidator.structureHostType(folderName);
- for (File resourceFile : resourceFiles) {
- JSONObject resource = PackValidationIo.readJson(resourceFile);
- if (resource == null) {
- continue;
- }
- JSONObject caveProfile = resource.optJSONObject("caveProfile");
- if (caveProfile == null) {
- continue;
- }
- String resourceKey = PackValidationIo.deriveKey(resourceFolder, resourceFile);
- validateFields(resourceType + " '" + resourceKey + "' caveProfile.", "caveProfile.", caveProfile,
- blockingErrors);
- }
- }
-
- File snippetFolder = new File(packFolder, CAVE_PROFILE_SNIPPET_FOLDER);
- if (!snippetFolder.isDirectory()) {
- return blockingErrors;
- }
- List snippetFiles = PackValidationIo.listJsonRecursive(snippetFolder);
- snippetFiles.sort(Comparator.comparing(File::getPath));
- for (File snippetFile : snippetFiles) {
- JSONObject caveProfile = PackValidationIo.readJson(snippetFile);
- if (caveProfile == null) {
- continue;
- }
- String snippetKey = PackValidationIo.deriveKey(snippetFolder, snippetFile);
- validateFields("Cave-profile snippet '" + snippetKey + "' ", "", caveProfile, blockingErrors);
- }
- return blockingErrors;
- }
-
- private static void validateFields(String location, String replacementPrefix, JSONObject caveProfile,
- List blockingErrors) {
- for (LegacyField field : LEGACY_FIELDS) {
- if (caveProfile.has(field.oldName())) {
- blockingErrors.add(location + field.oldName() + " was removed; use " + replacementPrefix
- + field.newName()
- + ". Cave aquifers use the dimension fluidPalette, which defaults to water.");
- }
- }
- }
-
- private record LegacyField(String oldName, String newName) {
- }
-}
diff --git a/core/src/main/java/art/arcane/iris/engine/framework/placer/WorldObjectPlacer.java b/core/src/main/java/art/arcane/iris/engine/framework/placer/WorldObjectPlacer.java
deleted file mode 100644
index 8c7f4ef4a..000000000
--- a/core/src/main/java/art/arcane/iris/engine/framework/placer/WorldObjectPlacer.java
+++ /dev/null
@@ -1,158 +0,0 @@
-package art.arcane.iris.engine.framework.placer;
-
-import art.arcane.iris.platform.bukkit.BukkitBlockResolution;
-
-import art.arcane.iris.core.loader.IrisData;
-import art.arcane.iris.core.tools.IrisToolbelt;
-import art.arcane.iris.engine.framework.Engine;
-import art.arcane.iris.core.events.InventorySlotType;
-import art.arcane.iris.core.events.IrisLootEvent;
-import art.arcane.iris.engine.mantle.EngineMantle;
-import art.arcane.iris.engine.platform.EngineBukkitOps;
-import art.arcane.iris.engine.platform.PlatformChunkGenerator;
-import art.arcane.iris.engine.object.placement.IObjectPlacer;
-import art.arcane.iris.engine.object.prefab.TileData;
-import art.arcane.iris.platform.bukkit.BukkitBlockState;
-import art.arcane.iris.spi.IrisLogging;
-import art.arcane.iris.spi.PlatformBlockState;
-import art.arcane.iris.util.common.scheduling.J;
-import art.arcane.volmlib.util.collection.KList;
-import com.volmit.service.Loot;
-import art.arcane.iris.util.common.data.IrisCustomData;
-import art.arcane.volmlib.util.math.RNG;
-import art.arcane.volmlib.util.matter.MatterCavern;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import org.bukkit.Bukkit;
-import org.bukkit.Material;
-import org.bukkit.World;
-import org.bukkit.block.Block;
-import org.bukkit.block.data.BlockData;
-import org.bukkit.inventory.InventoryHolder;
-
-@Getter
-@EqualsAndHashCode(exclude = {"engine", "mantle"})
-public class WorldObjectPlacer implements IObjectPlacer {
- private final World world;
- private final Engine engine;
- private final EngineMantle mantle;
-
- public WorldObjectPlacer(World world) {
- PlatformChunkGenerator a = IrisToolbelt.access(world);
- if (a == null || a.getEngine() == null) throw new IllegalStateException(world.getName() + " is not an Iris World!");
- this.world = world;
- this.engine = a.getEngine();
- this.mantle = engine.getMantle();
- }
-
- @Override
- public int getHighest(int x, int z, IrisData data) {
- return mantle.getHighest(x, z, data);
- }
-
- @Override
- public int getHighest(int x, int z, IrisData data, boolean ignoreFluid) {
- return mantle.getHighest(x, z, data, ignoreFluid);
- }
-
- @Override
- public void set(int x, int y, int z, PlatformBlockState state) {
- BlockData d = (BlockData) state.nativeHandle();
- int worldY = y + world.getMinHeight();
- if (worldY < world.getMinHeight() || worldY >= world.getMaxHeight()) return;
- Block block = world.getBlockAt(x, worldY, z);
-
- if (block.getType() == Material.BEDROCK) return;
- boolean storageChest = BukkitBlockResolution.isStorageChest(d);
-
- if (d instanceof IrisCustomData data) {
- block.setBlockData(data.getBase(), false);
- // Reached per block for every custom block in the pack; the pack is what needs changing, and
- // one statement of that is enough.
- IrisLogging.warnOnce("custom-block-placer", "Tried to place custom block at " + x + ", " + y + ", " + z + " which is not supported.");
- } else block.setBlockData(d, false);
-
- if (storageChest && !J.runRegion(world, x >> 4, z >> 4, () -> fillLoot(block), 1)) {
- IrisLogging.warn("Failed to schedule loot resolution at " + x + ", " + worldY + ", " + z);
- }
- }
-
- private void fillLoot(Block block) {
- if (!BukkitBlockResolution.isStorageChest(block.getBlockData()) || !EngineBukkitOps.isCanonicalContainer(block)) {
- return;
- }
- int x = block.getX();
- int y = block.getY();
- int z = block.getZ();
- KList tables = EngineBukkitOps.getLootTables(engine, block);
-
- try {
- Bukkit.getPluginManager().callEvent(new IrisLootEvent(engine, block, InventorySlotType.STORAGE, tables));
- if (tables.isEmpty()) {
- return;
- }
- InventoryHolder holder = (InventoryHolder) block.getState();
- EngineBukkitOps.addItems(engine, false, holder.getInventory(), tables, world, x, y, z);
- } catch (Throwable e) {
- IrisLogging.reportError(e);
- }
- }
-
- @Override
- public PlatformBlockState get(int x, int y, int z) {
- return BukkitBlockState.of(world.getBlockAt(x, y + world.getMinHeight(), z).getBlockData());
- }
-
- @Override
- public boolean isPreventingDecay() {
- return mantle.isPreventingDecay();
- }
-
- @Override
- public boolean isCarved(int x, int y, int z) {
- return mantle.getMantle().get(x, y, z, MatterCavern.class) != null;
- }
-
- @Override
- public boolean isSurfaceSolid(int x, int y, int z) {
- return isSolid(x, y, z);
- }
-
- @Override
- public boolean isSolid(int x, int y, int z) {
- return world.getBlockAt(x, y + world.getMinHeight(), z).getType().isSolid();
- }
-
- @Override
- public boolean isUnderwater(int x, int z) {
- return mantle.isUnderwater(x, z);
- }
-
- @Override
- public int getFluidHeight() {
- return mantle.getFluidHeight();
- }
-
- @Override
- public void setTile(int xx, int yy, int zz, TileData tile) {
- int worldY = yy + world.getMinHeight();
- if (worldY < world.getMinHeight() || worldY >= world.getMaxHeight()) return;
- tile.toBukkitTry(world.getBlockAt(xx, worldY, zz));
- }
-
- @Override
- public void setData(int xx, int yy, int zz, T data) {
- if (data == null || yy < 0 || yy >= engine.getHeight()) {
- return;
- }
- mantle.getMantle().set(xx, yy, zz, data);
- }
-
- @Override
- public T getData(int xx, int yy, int zz, Class t) {
- if (yy < 0 || yy >= engine.getHeight()) {
- return null;
- }
- return mantle.getMantle().get(xx, yy, zz, t);
- }
-}
diff --git a/core/src/main/java/art/arcane/iris/engine/object/mod/IrisMod.java b/core/src/main/java/art/arcane/iris/engine/object/mod/IrisMod.java
deleted file mode 100644
index 60feb9d86..000000000
--- a/core/src/main/java/art/arcane/iris/engine/object/mod/IrisMod.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 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 .
- */
-
-package art.arcane.iris.engine.object.mod;
-
-import art.arcane.iris.engine.object.prefab.IrisObject;
-import art.arcane.iris.engine.object.world.biome.IrisBiome;
-import art.arcane.iris.engine.object.world.region.IrisRegion;
-import art.arcane.iris.core.loader.IrisRegistrant;
-import art.arcane.iris.engine.object.annotations.ArrayType;
-import art.arcane.iris.engine.object.annotations.Desc;
-import art.arcane.iris.engine.object.annotations.MaxNumber;
-import art.arcane.iris.engine.object.annotations.MinNumber;
-import art.arcane.iris.engine.object.annotations.RegistryListResource;
-import art.arcane.iris.engine.object.annotations.Required;
-import art.arcane.volmlib.util.collection.KList;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
-
-@Accessors(chain = true)
-@AllArgsConstructor
-@NoArgsConstructor
-@Desc("Represents a pack modification schema")
-@Data
-@EqualsAndHashCode(callSuper = false)
-public class IrisMod extends IrisRegistrant {
- @MinNumber(2)
- @Required
- @Desc("The human-readable name of this pack modification")
- private String name = "A Pack Modification";
-
- @Desc("The optional dimension load key this modification targets. An empty value does not restrict the target.")
- private String forDimension = "";
-
- @MinNumber(-1)
- @MaxNumber(512)
- @Desc("Override the fluid height. Otherwise set it to -1")
- private int overrideFluidHeight = -1;
-
- @Desc("A list of biomes to remove")
- @RegistryListResource(IrisBiome.class)
- @ArrayType(type = String.class, min = 1)
- private KList removeBiomes = new KList<>();
-
- @Desc("A list of objects to remove")
- @RegistryListResource(IrisObject.class)
- @ArrayType(type = String.class, min = 1)
- private KList removeObjects = new KList<>();
-
- @Desc("A list of regions to remove")
- @RegistryListResource(IrisRegion.class)
- @ArrayType(type = String.class, min = 1)
- private KList removeRegions = new KList<>();
-
- @Desc("A list of regions to inject")
- @RegistryListResource(IrisRegion.class)
- @ArrayType(type = String.class, min = 1)
- private KList injectRegions = new KList<>();
-
- @ArrayType(min = 1, type = IrisModBiomeInjector.class)
- @Desc("Inject biomes into existing regions")
- private KList biomeInjectors = new KList<>();
-
- @ArrayType(min = 1, type = IrisModBiomeReplacer.class)
- @Desc("Replace biomes with other biomes")
- private KList biomeReplacers = new KList<>();
-
- @ArrayType(min = 1, type = IrisModObjectReplacer.class)
- @Desc("Replace objects with other objects")
- private KList objectReplacers = new KList<>();
-
- @ArrayType(min = 1, type = IrisModObjectPlacementBiomeInjector.class)
- @Desc("Inject placers into existing biomes")
- private KList biomeObjectPlacementInjectors = new KList<>();
-
- @ArrayType(min = 1, type = IrisModObjectPlacementRegionInjector.class)
- @Desc("Inject placers into existing regions")
- private KList regionObjectPlacementInjectors = new KList<>();
-
- @ArrayType(min = 1, type = IrisModRegionReplacer.class)
- @Desc("Replace regions with other regions")
- private KList regionReplacers = new KList<>();
-
- @ArrayType(min = 1, type = IrisModNoiseStyleReplacer.class)
- @Desc("Replace noise styles with other styles")
- private KList styleReplacers = new KList<>();
-
- @Override
- public String getFolderName() {
- return "mods";
- }
-
- @Override
- public String getTypeName() {
- return "Mod";
- }
-}
diff --git a/core/src/main/java/art/arcane/iris/engine/object/mod/IrisModBiomeInjector.java b/core/src/main/java/art/arcane/iris/engine/object/mod/IrisModBiomeInjector.java
deleted file mode 100644
index 2488a6987..000000000
--- a/core/src/main/java/art/arcane/iris/engine/object/mod/IrisModBiomeInjector.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 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 .
- */
-
-package art.arcane.iris.engine.object.mod;
-
-import art.arcane.iris.engine.object.world.biome.IrisBiome;
-import art.arcane.iris.engine.object.world.region.IrisRegion;
-import art.arcane.iris.engine.object.annotations.ArrayType;
-import art.arcane.iris.engine.object.annotations.Desc;
-import art.arcane.iris.engine.object.annotations.RegistryListResource;
-import art.arcane.iris.engine.object.annotations.Required;
-import art.arcane.iris.engine.object.annotations.Snippet;
-import art.arcane.volmlib.util.collection.KList;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
-
-@Snippet("biome-injector")
-@Accessors(chain = true)
-@NoArgsConstructor
-@AllArgsConstructor
-@Desc("A biome injector")
-@Data
-public class IrisModBiomeInjector {
- @Required
- @Desc("The region to find")
- @RegistryListResource(IrisRegion.class)
- private String region = "";
-
- @Required
- @Desc("A biome to inject into the region")
- @RegistryListResource(IrisBiome.class)
- @ArrayType(type = String.class, min = 1)
- private KList inject = new KList<>();
-}
diff --git a/core/src/main/java/art/arcane/iris/engine/object/mod/IrisModBiomeReplacer.java b/core/src/main/java/art/arcane/iris/engine/object/mod/IrisModBiomeReplacer.java
deleted file mode 100644
index 3a1553c4a..000000000
--- a/core/src/main/java/art/arcane/iris/engine/object/mod/IrisModBiomeReplacer.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 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 .
- */
-
-package art.arcane.iris.engine.object.mod;
-
-import art.arcane.iris.engine.object.world.biome.IrisBiome;
-import art.arcane.iris.engine.object.annotations.ArrayType;
-import art.arcane.iris.engine.object.annotations.Desc;
-import art.arcane.iris.engine.object.annotations.RegistryListResource;
-import art.arcane.iris.engine.object.annotations.Required;
-import art.arcane.iris.engine.object.annotations.Snippet;
-import art.arcane.volmlib.util.collection.KList;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
-
-@Snippet("biome-replacer")
-@Accessors(chain = true)
-@NoArgsConstructor
-@AllArgsConstructor
-@Desc("A biome replacer")
-@Data
-public class IrisModBiomeReplacer {
- @Required
- @Desc("A list of biomes to find")
- @RegistryListResource(IrisBiome.class)
- @ArrayType(type = String.class, min = 1)
- private KList find = new KList<>();
-
- @Required
- @Desc("A biome to replace it with")
- @RegistryListResource(IrisBiome.class)
- private String replace = "";
-}
diff --git a/core/src/main/java/art/arcane/iris/engine/object/mod/IrisModNoiseStyleReplacer.java b/core/src/main/java/art/arcane/iris/engine/object/mod/IrisModNoiseStyleReplacer.java
deleted file mode 100644
index ec251a343..000000000
--- a/core/src/main/java/art/arcane/iris/engine/object/mod/IrisModNoiseStyleReplacer.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 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 .
- */
-
-package art.arcane.iris.engine.object.mod;
-
-import art.arcane.iris.engine.object.noise.IrisGeneratorStyle;
-import art.arcane.iris.engine.object.noise.NoiseStyle;
-import art.arcane.iris.engine.object.annotations.Desc;
-import art.arcane.iris.engine.object.annotations.Required;
-import art.arcane.iris.engine.object.annotations.Snippet;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
-
-@Snippet("noise-style-replacer")
-@Accessors(chain = true)
-@NoArgsConstructor
-@AllArgsConstructor
-@Desc("A noise style replacer")
-@Data
-public class IrisModNoiseStyleReplacer {
- @Required
- @Desc("A noise style to find")
- private NoiseStyle find = NoiseStyle.IRIS;
-
- @Required
- @Desc("If replaceTypeOnly is set to true, Iris will keep the existing generator style and only replace the type itself. Otherwise it will use the replace tag for every style using the find type.")
- private boolean replaceTypeOnly = false;
-
- @Required
- @Desc("A noise style to replace it with")
- private IrisGeneratorStyle replace = new IrisGeneratorStyle();
-}
diff --git a/core/src/main/java/art/arcane/iris/engine/object/mod/IrisModObjectPlacementBiomeInjector.java b/core/src/main/java/art/arcane/iris/engine/object/mod/IrisModObjectPlacementBiomeInjector.java
deleted file mode 100644
index 753f52a25..000000000
--- a/core/src/main/java/art/arcane/iris/engine/object/mod/IrisModObjectPlacementBiomeInjector.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 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 .
- */
-
-package art.arcane.iris.engine.object.mod;
-
-import art.arcane.iris.builtin.objects.ObjectPlacement;
-import art.arcane.iris.engine.object.world.biome.IrisBiome;
-import art.arcane.iris.engine.object.annotations.ArrayType;
-import art.arcane.iris.engine.object.annotations.Desc;
-import art.arcane.iris.engine.object.annotations.RegistryListResource;
-import art.arcane.iris.engine.object.annotations.Required;
-import art.arcane.iris.engine.object.annotations.Snippet;
-import art.arcane.volmlib.util.collection.KList;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
-
-@Snippet("object-placement-biome-injector")
-@Accessors(chain = true)
-@NoArgsConstructor
-@AllArgsConstructor
-@Desc("An object placement injector")
-@Data
-public class IrisModObjectPlacementBiomeInjector {
- @Required
- @Desc("The biome to find")
- @RegistryListResource(IrisBiome.class)
- private String biome = "";
-
- @Required
- @Desc("Object placements to inject into the biome")
- @ArrayType(type = ObjectPlacement.class, min = 1)
- private KList place = new KList<>();
-}
diff --git a/core/src/main/java/art/arcane/iris/engine/object/mod/IrisModObjectPlacementRegionInjector.java b/core/src/main/java/art/arcane/iris/engine/object/mod/IrisModObjectPlacementRegionInjector.java
deleted file mode 100644
index bf98e3a03..000000000
--- a/core/src/main/java/art/arcane/iris/engine/object/mod/IrisModObjectPlacementRegionInjector.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 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 .
- */
-
-package art.arcane.iris.engine.object.mod;
-
-import art.arcane.iris.builtin.objects.ObjectPlacement;
-import art.arcane.iris.engine.object.world.region.IrisRegion;
-import art.arcane.iris.engine.object.annotations.ArrayType;
-import art.arcane.iris.engine.object.annotations.Desc;
-import art.arcane.iris.engine.object.annotations.RegistryListResource;
-import art.arcane.iris.engine.object.annotations.Required;
-import art.arcane.iris.engine.object.annotations.Snippet;
-import art.arcane.volmlib.util.collection.KList;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
-
-@Snippet("object-placement-region-injector")
-@Accessors(chain = true)
-@NoArgsConstructor
-@AllArgsConstructor
-@Desc("An object placement injector")
-@Data
-public class IrisModObjectPlacementRegionInjector {
- @Required
- @Desc("The region to find")
- @RegistryListResource(IrisRegion.class)
- private String biome = "";
-
- @Required
- @Desc("Object placements to inject into the region")
- @ArrayType(type = ObjectPlacement.class, min = 1)
- private KList place = new KList<>();
-}
diff --git a/core/src/main/java/art/arcane/iris/engine/object/mod/IrisModObjectReplacer.java b/core/src/main/java/art/arcane/iris/engine/object/mod/IrisModObjectReplacer.java
deleted file mode 100644
index b4893f272..000000000
--- a/core/src/main/java/art/arcane/iris/engine/object/mod/IrisModObjectReplacer.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 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 .
- */
-
-package art.arcane.iris.engine.object.mod;
-
-import art.arcane.iris.engine.object.prefab.IrisObject;
-import art.arcane.iris.engine.object.annotations.ArrayType;
-import art.arcane.iris.engine.object.annotations.Desc;
-import art.arcane.iris.engine.object.annotations.RegistryListResource;
-import art.arcane.iris.engine.object.annotations.Required;
-import art.arcane.iris.engine.object.annotations.Snippet;
-import art.arcane.volmlib.util.collection.KList;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
-
-@Snippet("object-replacer")
-@Accessors(chain = true)
-@NoArgsConstructor
-@AllArgsConstructor
-@Desc("An object replacer")
-@Data
-public class IrisModObjectReplacer {
- @Required
- @Desc("A list of objects to find")
- @RegistryListResource(IrisObject.class)
- @ArrayType(type = String.class, min = 1)
- private KList find = new KList<>();
-
- @Required
- @Desc("An object to replace it with")
- @RegistryListResource(IrisObject.class)
- private String replace = "";
-}
diff --git a/core/src/main/java/art/arcane/iris/engine/object/mod/IrisModRegionReplacer.java b/core/src/main/java/art/arcane/iris/engine/object/mod/IrisModRegionReplacer.java
deleted file mode 100644
index c8088ce8a..000000000
--- a/core/src/main/java/art/arcane/iris/engine/object/mod/IrisModRegionReplacer.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 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 .
- */
-
-package art.arcane.iris.engine.object.mod;
-
-import art.arcane.iris.engine.object.world.region.IrisRegion;
-import art.arcane.iris.engine.object.annotations.ArrayType;
-import art.arcane.iris.engine.object.annotations.Desc;
-import art.arcane.iris.engine.object.annotations.RegistryListResource;
-import art.arcane.iris.engine.object.annotations.Required;
-import art.arcane.iris.engine.object.annotations.Snippet;
-import art.arcane.volmlib.util.collection.KList;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
-
-@Snippet("region-replacer")
-@Accessors(chain = true)
-@NoArgsConstructor
-@AllArgsConstructor
-@Desc("A region replacer")
-@Data
-public class IrisModRegionReplacer {
- @Required
- @Desc("A list of regions to find")
- @RegistryListResource(IrisRegion.class)
- @ArrayType(type = String.class, min = 1)
- private KList find = new KList<>();
-
- @Required
- @Desc("A region to replace it with")
- @RegistryListResource(IrisRegion.class)
- private String replace = "";
-}
diff --git a/core/src/test/java/art/arcane/iris/core/pack/PackCaveProfileValidatorTest.java b/core/src/test/java/art/arcane/iris/core/pack/PackCaveProfileValidatorTest.java
deleted file mode 100644
index d1629f4ea..000000000
--- a/core/src/test/java/art/arcane/iris/core/pack/PackCaveProfileValidatorTest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package art.arcane.iris.core.pack;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
-
-import java.io.File;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-public class PackCaveProfileValidatorTest {
- @Rule
- public TemporaryFolder temporaryFolder = new TemporaryFolder();
-
- @Test
- public void rejectsLegacyWaterFieldsAcrossEveryCaveProfileLocation() throws Exception {
- File pack = temporaryFolder.newFolder("pack");
- write(pack, "dimensions/main.json", "{\"caveProfile\":{\"allowWater\":false}}");
- write(pack, "regions/nested/region.json", "{\"caveProfile\":{\"waterMinDepthBelowSurface\":20}}");
- write(pack, "biomes/nested/biome.json", "{\"caveProfile\":{\"waterRequiresFloor\":true}}");
- write(pack, "snippet/iris/carve/cave-profile/nested/profile.json", "{\"allowWater\":true}");
-
- assertEquals(List.of(
- "Dimension 'main' caveProfile.allowWater was removed; use caveProfile.allowFluid. Cave aquifers use the dimension fluidPalette, which defaults to water.",
- "Region 'nested/region' caveProfile.waterMinDepthBelowSurface was removed; use caveProfile.fluidMinDepthBelowSurface. Cave aquifers use the dimension fluidPalette, which defaults to water.",
- "Biome 'nested/biome' caveProfile.waterRequiresFloor was removed; use caveProfile.fluidRequiresFloor. Cave aquifers use the dimension fluidPalette, which defaults to water.",
- "Cave-profile snippet 'nested/profile' allowWater was removed; use allowFluid. Cave aquifers use the dimension fluidPalette, which defaults to water."
- ), PackCaveProfileValidator.validateLegacyFields(pack));
- }
-
- @Test
- public void acceptsGenericFluidFields() throws Exception {
- File pack = temporaryFolder.newFolder("pack");
- write(pack, "dimensions/main.json", "{\"caveProfile\":{\"allowFluid\":true,"
- + "\"fluidMinDepthBelowSurface\":20,\"fluidRequiresFloor\":true}}");
- write(pack, "snippet/iris/carve/cave-profile/profile.json", "{\"allowFluid\":true,"
- + "\"fluidMinDepthBelowSurface\":20,\"fluidRequiresFloor\":true}");
-
- assertTrue(PackCaveProfileValidator.validateLegacyFields(pack).isEmpty());
- }
-
- @Test
- public void legacyFieldBlocksFullPackValidation() throws Exception {
- File pack = temporaryFolder.newFolder("pack");
- write(pack, "dimensions/main.json", "{\"regions\":[\"region\"]}");
- write(pack, "regions/region.json", "{\"landBiomes\":[\"biome\"]}");
- write(pack, "biomes/biome.json", "{\"name\":\"Biome\",\"caveProfile\":{\"allowWater\":false}}");
-
- PackValidationResult result = PackValidator.validate(pack);
-
- assertFalse(result.isLoadable());
- assertTrue(result.getBlockingErrors().contains(
- "Biome 'biome' caveProfile.allowWater was removed; use caveProfile.allowFluid. Cave aquifers use the dimension fluidPalette, which defaults to water."));
- }
-
- private void write(File root, String relative, String content) throws Exception {
- Path path = root.toPath().resolve(relative);
- Files.createDirectories(path.getParent());
- Files.writeString(path, content, StandardCharsets.UTF_8);
- }
-}
diff --git a/core/src/test/java/art/arcane/iris/core/pack/PackValidatorRemovedWorldgenFieldTest.java b/core/src/test/java/art/arcane/iris/core/pack/PackValidatorRemovedWorldgenFieldTest.java
deleted file mode 100644
index 80705657d..000000000
--- a/core/src/test/java/art/arcane/iris/core/pack/PackValidatorRemovedWorldgenFieldTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package art.arcane.iris.core.pack;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
-
-import java.io.File;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-public class PackValidatorRemovedWorldgenFieldTest {
- @Rule
- public TemporaryFolder temporaryFolder = new TemporaryFolder();
-
- @Test
- public void rejectsFluidBodiesAcrossEveryFormerHost() throws Exception {
- File pack = temporaryFolder.newFolder("pack");
- write(pack, "dimensions/main.json", "{\"fluidBodies\":{}}");
- write(pack, "regions/nested/region.json", "{\"fluidBodies\":null}");
- write(pack, "biomes/nested/biome.json", "{\"fluidBodies\":{\"lakes\":[]}}");
-
- assertEquals(List.of(
- "Dimension 'main' declares removed field 'fluidBodies'. Remove it because fluid-body generation is not supported.",
- "Region 'nested/region' declares removed field 'fluidBodies'. Remove it because fluid-body generation is not supported.",
- "Biome 'nested/biome' declares removed field 'fluidBodies'. Remove it because fluid-body generation is not supported."
- ), PackObjectSurfaceValidator.validateRemovedWorldgenFields(pack));
- }
-
- @Test
- public void removedFluidBodiesBlocksFullPackValidation() throws Exception {
- File pack = temporaryFolder.newFolder("pack");
- write(pack, "dimensions/main.json", "{\"regions\":[\"region\"]}");
- write(pack, "regions/region.json", "{\"landBiomes\":[\"biome\"]}");
- write(pack, "biomes/biome.json", "{\"name\":\"Biome\",\"fluidBodies\":{}}");
-
- PackValidationResult result = PackValidator.validate(pack);
-
- assertFalse(result.isLoadable());
- assertTrue(result.getBlockingErrors().contains(
- "Biome 'biome' declares removed field 'fluidBodies'. Remove it because fluid-body generation is not supported."));
- }
-
- private void write(File root, String relative, String content) throws Exception {
- Path path = root.toPath().resolve(relative);
- Files.createDirectories(path.getParent());
- Files.writeString(path, content, StandardCharsets.UTF_8);
- }
-}
diff --git a/gradle/irisapi-resolution.settings.gradle b/gradle/irisapi-resolution.settings.gradle
index b2ae309a4..8ef16fa66 100644
--- a/gradle/irisapi-resolution.settings.gradle
+++ b/gradle/irisapi-resolution.settings.gradle
@@ -36,7 +36,8 @@
* When nothing is found the build fails here, naming where it looked, rather than later with an
* unresolvable dependency.
*
- * The modded adapters do not apply this: they compile against core's jar and use no IrisApi type.
+ * The three modded adapter builds apply it too: core's dependencies on IrisApi must resolve in them, and the adapters
+ * read IrisApi types (ResourceId, BlockTurn).
*/
import java.io.File
diff --git a/probe/src/main/java/art/arcane/iris/probe/DeserializationProbe.java b/probe/src/main/java/art/arcane/iris/probe/DeserializationProbe.java
deleted file mode 100644
index a9af8a1c5..000000000
--- a/probe/src/main/java/art/arcane/iris/probe/DeserializationProbe.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * 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 .
- */
-
-package art.arcane.iris.probe;
-
-import art.arcane.iris.engine.loot.LootResources;
-import art.arcane.iris.engine.spawn.SpawnResources;
-import art.arcane.iris.core.loader.IrisData;
-import art.arcane.iris.engine.framework.MeteredCache;
-import art.arcane.iris.engine.framework.PreservationRegistry;
-import art.arcane.iris.builtin.spawn.EntityDefinition;
-import art.arcane.iris.builtin.spawn.EntitySpawn;
-import art.arcane.iris.builtin.loot.LootEntry;
-import art.arcane.iris.builtin.loot.LootTable;
-import art.arcane.iris.builtin.spawn.Spawner;
-import art.arcane.iris.spi.IrisPlatforms;
-import art.arcane.iris.spi.IrisServices;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.StandardCopyOption;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-public final class DeserializationProbe {
- private static final String FIXTURE_RESOURCE = "deserialization-pack";
- private static final String ENTITY_KEY = "probe_entity";
- private static final String SPAWNER_KEY = "probe_spawner";
- private static final String LOOT_KEY = "probe_loot";
- private static final List REPORTED = Collections.synchronizedList(new ArrayList<>());
-
- @FunctionalInterface
- private interface ProbeStep {
- void run() throws Exception;
- }
-
- private static final class InertPreservation implements PreservationRegistry {
- @Override
- public void register(Thread thread) {
- }
-
- @Override
- public void register(ExecutorService service) {
- }
-
- @Override
- public void registerCache(MeteredCache cache) {
- }
-
- @Override
- public void dereference() {
- }
- }
-
- public static void main(String[] args) throws Exception {
- IrisPlatforms.bind(new StubPlatform());
- StubPlatform.verbose(false);
- StubPlatform.errorSink(REPORTED::add);
- IrisServices.register(PreservationRegistry.class, new InertPreservation());
-
- boolean bukkitPresent = bukkitPresent();
- System.out.println("[deserprobe] org.bukkit on classpath: " + bukkitPresent);
- if (bukkitPresent) {
- System.out.println("[deserprobe] FAIL: org.bukkit is on the probe runtime classpath; this gate only proves the Bukkit-free deserialization contract when Bukkit is absent.");
- System.exit(1);
- return;
- }
-
- File fixtureSource = resolveFixture(args);
- if (fixtureSource == null || !fixtureSource.isDirectory()) {
- System.out.println("[deserprobe] FAIL: fixture pack folder not found"
- + (fixtureSource == null ? "" : ": " + fixtureSource.getAbsolutePath()));
- System.exit(1);
- return;
- }
-
- File workRoot = Files.createTempDirectory("iris-deserprobe").toFile();
- File pack = clonePack(fixtureSource, workRoot);
- System.out.println("[deserprobe] fixture: " + fixtureSource.getAbsolutePath());
- System.out.println("[deserprobe] work copy: " + pack.getAbsolutePath());
-
- IrisData data;
- try {
- data = IrisData.get(pack);
- } catch (Throwable e) {
- System.out.println("[deserprobe] FAIL: IrisData loader construction threw before any deserialization");
- e.printStackTrace(System.out);
- printReported(drain());
- System.exit(1);
- return;
- }
-
- int failures = 0;
- failures += run("entity<" + ENTITY_KEY + ">", () -> assertEntity(data));
- failures += run("spawner<" + SPAWNER_KEY + ">", () -> assertSpawner(data));
- failures += run("loot<" + LOOT_KEY + ">", () -> assertLoot(data));
-
- List residual = drain();
- if (!residual.isEmpty()) {
- System.out.println("[deserprobe] FAIL: " + residual.size() + " residual error(s) reported after deserialization:");
- printReported(residual);
- failures += residual.size();
- }
-
- System.out.println("[deserprobe] RESULT: " + (failures == 0 ? "PASS" : "FAIL"));
- System.exit(failures == 0 ? 0 : 1);
- }
-
- private static void assertEntity(IrisData data) {
- EntityDefinition entity = SpawnResources.entity(data.getPackResources(), ENTITY_KEY);
- require(entity != null, "entity deserialized");
- require("minecraft:panda".equals(entity.type()), "type round-trips as authored namespaced string");
- require("COMMAND".equals(entity.reason()), "reason retained as string");
- require("BROWN".equals(entity.pandaMainGene()), "pandaMainGene retained as string");
- require("LAZY".equals(entity.pandaHiddenGene()), "pandaHiddenGene retained as string");
- require(entity.baby(), "baby flag retained");
- require(entity.glowing(), "glowing flag retained");
-
- LootEntry helmet = entity.helmet();
- require(helmet != null, "helmet equipment loot deserialized");
- require(helmet.unbreakable(), "helmet unbreakable flag retained");
- require(helmet.itemFlags().contains("HIDE_ATTRIBUTES"), "helmet item flags retained as strings");
- List> helmetEnchants = helmet.enchantments();
- require(!helmetEnchants.isEmpty(), "helmet enchantments deserialized");
- require(entity.mainHand() != null, "mainHand equipment loot deserialized");
-
- List passengers = entity.passengers();
- require(passengers.size() == 1, "single passenger entity deserialized");
- require("minecraft:zombie".equals(passengers.get(0).type()), "nested passenger type round-trips");
-
- require(entity.attributes().size() == 1, "attribute modifier deserialized");
- require("generic.max_health".equals(entity.attributes().get(0).attribute()), "attribute key retained as string");
-
- require(entity.loot() != null, "loot reference deserialized");
- require(entity.loot().tables().contains(LOOT_KEY), "loot reference table retained");
- }
-
- private static void assertSpawner(IrisData data) {
- Spawner spawner = SpawnResources.spawner(data.getPackResources(), SPAWNER_KEY);
- require(spawner != null, "spawner deserialized");
- List spawns = spawner.spawns();
- require(spawns.size() == 1, "single entity spawn deserialized");
- require(ENTITY_KEY.equals(spawns.get(0).entity()), "spawn references the probe entity by key");
- require("NORMAL".equals(spawner.group().name()), "spawn group enum deserialized");
- require(spawner.maxEntitiesPerChunk() == 4, "spawner numeric field retained");
- }
-
- private static void assertLoot(IrisData data) {
- LootTable table = LootResources.table(data.getPackResources(), LOOT_KEY);
- require(table != null, "loot table deserialized");
- require(LOOT_KEY.equals(table.name()), "loot table name retained");
- require(table.rarity() == 4, "loot table rarity retained");
-
- List items = table.loot();
- require(!items.isEmpty(), "loot items deserialized");
- LootEntry item = items.get(0);
- require(item.maxAmount() == 3, "loot item amount retained");
- require("STORAGE".equals(item.slotTypes().name()), "loot item slot type enum deserialized");
- require(item.itemFlags().contains("HIDE_ENCHANTS"), "loot item flags retained as strings");
- require(!item.enchantments().isEmpty(), "loot item enchantments deserialized");
- require("unbreaking".equals(item.enchantments().get(0).enchantment()), "loot item enchantment key retained as string");
- }
-
- private static void require(boolean condition, String description) {
- if (!condition) {
- throw new IllegalStateException("assertion failed: " + description);
- }
- }
-
- private static int run(String label, ProbeStep step) {
- drain();
- Throwable thrown = null;
- try {
- step.run();
- } catch (Throwable e) {
- thrown = e;
- }
- List reported = drain();
- int failures = 0;
- if (thrown != null) {
- System.out.println("[deserprobe] " + label + " FAILED: " + thrown.getClass().getName() + ": " + thrown.getMessage());
- thrown.printStackTrace(System.out);
- failures++;
- }
- if (!reported.isEmpty()) {
- System.out.println("[deserprobe] " + label + " FAILED: " + reported.size() + " error(s) reported (swallowed) during deserialization:");
- printReported(reported);
- failures += reported.size();
- }
- if (failures == 0) {
- System.out.println("[deserprobe] " + label + " OK");
- }
- return failures;
- }
-
- private static boolean bukkitPresent() {
- try {
- Class.forName("org.bukkit.Bukkit", false, DeserializationProbe.class.getClassLoader());
- return true;
- } catch (ClassNotFoundException absent) {
- return false;
- }
- }
-
- private static File resolveFixture(String[] args) throws Exception {
- if (args.length > 0 && !args[0].isBlank()) {
- return new File(args[0]);
- }
- URL resource = DeserializationProbe.class.getClassLoader().getResource(FIXTURE_RESOURCE);
- if (resource == null) {
- return null;
- }
- return new File(resource.toURI());
- }
-
- private static File clonePack(File source, File workRoot) throws IOException {
- Path sourcePath = source.toPath();
- Path destinationPath = workRoot.toPath().resolve(source.getName());
- List paths;
- try (Stream walk = Files.walk(sourcePath)) {
- paths = walk.collect(Collectors.toList());
- }
- for (Path path : paths) {
- Path target = destinationPath.resolve(sourcePath.relativize(path).toString());
- if (Files.isDirectory(path)) {
- Files.createDirectories(target);
- } else {
- Files.createDirectories(target.getParent());
- Files.copy(path, target, StandardCopyOption.REPLACE_EXISTING);
- }
- }
- return destinationPath.toFile();
- }
-
- private static List drain() {
- synchronized (REPORTED) {
- List drained = new ArrayList<>(REPORTED);
- REPORTED.clear();
- return drained;
- }
- }
-
- private static void printReported(List errors) {
- for (Throwable error : errors) {
- error.printStackTrace(System.out);
- }
- }
-}
diff --git a/probe/src/main/resources/deserialization-pack/entities/probe_entity.json b/probe/src/main/resources/deserialization-pack/entities/probe_entity.json
deleted file mode 100644
index cb821b533..000000000
--- a/probe/src/main/resources/deserialization-pack/entities/probe_entity.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
- "type": "minecraft:panda",
- "reason": "COMMAND",
- "customName": "&aProbe Panda",
- "customNameVisible": true,
- "glowing": true,
- "baby": true,
- "pandaMainGene": "BROWN",
- "pandaHiddenGene": "LAZY",
- "helmet": {
- "type": "minecraft:diamond_helmet",
- "slotTypes": "STORAGE",
- "rarity": 2,
- "minAmount": 1,
- "maxAmount": 1,
- "unbreakable": true,
- "itemFlags": [
- "HIDE_ATTRIBUTES"
- ],
- "enchantments": [
- {
- "enchantment": "protection",
- "minLevel": 3,
- "maxLevel": 4,
- "chance": 1.0
- }
- ],
- "lore": [
- "&7Probe helmet"
- ]
- },
- "mainHand": {
- "type": "minecraft:diamond_sword",
- "rarity": 1,
- "enchantments": [
- {
- "enchantment": "sharpness",
- "minLevel": 5,
- "maxLevel": 5
- }
- ]
- },
- "passengers": [
- {
- "type": "minecraft:zombie",
- "reason": "NATURAL",
- "baby": false
- }
- ],
- "attributes": [
- {
- "attribute": "generic.max_health",
- "name": "probe_health",
- "operation": "ADD_NUMBER",
- "minAmount": 20,
- "maxAmount": 20,
- "chance": 1.0
- }
- ],
- "loot": {
- "mode": "ADD",
- "tables": [
- "probe_loot"
- ],
- "multiplier": 1.5
- }
-}
diff --git a/probe/src/main/resources/deserialization-pack/loot/probe_loot.json b/probe/src/main/resources/deserialization-pack/loot/probe_loot.json
deleted file mode 100644
index bd50cb9a4..000000000
--- a/probe/src/main/resources/deserialization-pack/loot/probe_loot.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "name": "probe_loot",
- "rarity": 4,
- "maxPicked": 3,
- "minPicked": 1,
- "maxTries": 8,
- "loot": [
- {
- "type": "minecraft:diamond",
- "slotTypes": "STORAGE",
- "rarity": 2,
- "minAmount": 1,
- "maxAmount": 3,
- "unbreakable": false,
- "itemFlags": [
- "HIDE_ENCHANTS"
- ],
- "enchantments": [
- {
- "enchantment": "unbreaking",
- "minLevel": 3,
- "maxLevel": 3,
- "chance": 1.0
- }
- ],
- "lore": [
- "&bShiny"
- ]
- }
- ]
-}
diff --git a/probe/src/main/resources/deserialization-pack/spawners/probe_spawner.json b/probe/src/main/resources/deserialization-pack/spawners/probe_spawner.json
deleted file mode 100644
index 815e838bb..000000000
--- a/probe/src/main/resources/deserialization-pack/spawners/probe_spawner.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "spawns": [
- {
- "entity": "probe_entity",
- "rarity": 1,
- "minSpawns": 1,
- "maxSpawns": 2
- }
- ],
- "maxEntitiesPerChunk": 4,
- "group": "NORMAL",
- "weather": "ANY",
- "maximumRate": {
- "amount": 1,
- "per": {
- "seconds": 30
- }
- },
- "allowedLightLevels": {
- "min": 0,
- "max": 7
- }
-}