From 6e1a206013c099b3d5c430ae9568aa20d5333a3c Mon Sep 17 00:00:00 2001 From: piexel Date: Fri, 6 Nov 2026 07:16:27 +0100 Subject: [PATCH] Follow @ResourceRef in the export closure and schema --- .../arcane/iris/core/pack/ModuleResourceClosure.java | 10 +++++----- .../iris/core/modules/PackModuleResourceKindTest.java | 2 +- .../iris/core/project/SchemaBuilderParityTest.java | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/art/arcane/iris/core/pack/ModuleResourceClosure.java b/core/src/main/java/art/arcane/iris/core/pack/ModuleResourceClosure.java index e2463daf5..6a6beb887 100644 --- a/core/src/main/java/art/arcane/iris/core/pack/ModuleResourceClosure.java +++ b/core/src/main/java/art/arcane/iris/core/pack/ModuleResourceClosure.java @@ -27,7 +27,7 @@ import art.arcane.iris.engine.object.structure.IrisStructure; import art.arcane.volmlib.util.io.IO; import art.arcane.volmlib.util.json.JSONObject; import com.google.gson.Gson; -import com.volmit.config.Ref; +import com.volmit.config.ResourceRef; import com.volmit.host.ResourceKindRegistration; import com.volmit.resource.ResourceKind; @@ -49,7 +49,7 @@ import java.util.TreeSet; /** * The resources of the pack's module resource kinds that a pack export has to carry: what the settings of the - * exported dimension, regions and biomes (and anything else handed to {@link #follow}) name by {@code @Ref(kind = ...)}, + * exported dimension, regions and biomes (and anything else handed to {@link #follow}) name by {@link ResourceRef}, * {@link IrisStructureRef} or {@link RegistryListResource}, and what those resources name in turn. Core does not know the kinds: it follows the * references the modules declare on their classes. */ @@ -169,9 +169,9 @@ public final class ModuleResourceClosure { /** The class of the resources the field names by key, or null when it names none. */ private static Class referencedType(Field field) { - Ref reference = field.getAnnotation(Ref.class); - if (reference != null && reference.kind() != void.class) { - return reference.kind(); + ResourceRef reference = field.getAnnotation(ResourceRef.class); + if (reference != null) { + return reference.value(); } if (field.isAnnotationPresent(IrisStructureRef.class)) { return IrisStructure.class; diff --git a/core/src/test/java/art/arcane/iris/core/modules/PackModuleResourceKindTest.java b/core/src/test/java/art/arcane/iris/core/modules/PackModuleResourceKindTest.java index 3a3b38f63..597aeddb5 100644 --- a/core/src/test/java/art/arcane/iris/core/modules/PackModuleResourceKindTest.java +++ b/core/src/test/java/art/arcane/iris/core/modules/PackModuleResourceKindTest.java @@ -56,7 +56,7 @@ public class PackModuleResourceKindTest { public final class Keep { @Desc("Towers on the walls") @MinNumber(1) private int towers = 4; - @Ref(kind = Keep.class) + @ResourceRef(Keep.class) private String next = ""; public int towers() { return towers; } diff --git a/core/src/test/java/art/arcane/iris/core/project/SchemaBuilderParityTest.java b/core/src/test/java/art/arcane/iris/core/project/SchemaBuilderParityTest.java index 16d6e9d86..131bf71fb 100644 --- a/core/src/test/java/art/arcane/iris/core/project/SchemaBuilderParityTest.java +++ b/core/src/test/java/art/arcane/iris/core/project/SchemaBuilderParityTest.java @@ -216,7 +216,7 @@ public class SchemaBuilderParityTest { assertEquals("@IrisStructureRef completes the keys of Iris's structure model", "#/definitions/erz" + StructureResources.STRUCTURES.folder(), properties.getJSONObject("structures").getJSONObject("items").getString("$ref")); - assertEquals("@Ref(kind = PackBiome.class) completes the pack's biome keys", "#/definitions/erzbiomes", + assertEquals("@ResourceRef(PackBiome.class) completes the pack's biome keys", "#/definitions/erzbiomes", properties.getJSONObject("caveBiomes").getJSONObject("items").getString("$ref")); assertFalse(properties.has("scale")); }