Let modules declare pack resource kinds and validators: ResourceKind, PackResources.ids, @ResourceRef, the validation API and folders the host reserves

This commit is contained in:
piexel committed 2026-10-08 20:36:10 +02:00
1 parent 09afee8ae3
commit ef4b640867
37 files changed
+990 -128

No files matched your search

@@ -1,6 +1,7 @@
package com.volmit.host.schema;
import com.volmit.config.Reference;
import com.volmit.resource.ResourceId;
import java.util.List;
import java.util.Objects;
@@ -32,6 +33,15 @@ public sealed interface ValueKind {
}
}
/** A string naming a resource of the module resource kind {@code kind} by its key in the pack, such as
* {@code castle/start}; see {@link PackSchema#resource}.
*/
record ResourceReferenceKind(ResourceId kind) implements ValueKind {
public ResourceReferenceKind {
Objects.requireNonNull(kind, "kind");
}
}
/** One of the constant names of the enum class named {@code type}, in declaration order. */
record EnumKind(String type, List<EnumConstant> constants) implements ValueKind {
public EnumKind {