Type platform keys and fold pack references into @Ref(kind)

Batch 6, findings 41 and 42.

- Platform keys travel as ResourceId: enchantments, attributes, sounds,
  particles, potions, loot tables, sapling species, marker tags, upper
  dimension ids and jigsaw start pools. ResourceId.ofPlatformKey normalises
  a key a pack wrote.
- Item and entity types are a ContentKey (Registered id, or Provided
  provider and name) instead of strings and a special-type flag.
- ItemDrop groups into Look, Wear and PlatformExtras; colours are an RGB
  int and DyeColor, attribute operations an enum.
- EntitySpec groups into Appearance, Behaviour, Company, Drops and Arrival,
  and carries host extensions instead of Iris-only fields.
- @Ref(kind = Type.class) replaces @ResourceRef and the PACK_* references;
  expressions and image maps become the host kinds EXPRESSIONS and
  IMAGE_MAPS.
This commit is contained in:
piexel committed 2026-10-24 06:06:44 +02:00
1 parent 05f621d82d
commit 6b24e6f150
31 files changed
+620 -295

No files matched your search

+13 -4
View File
@@ -2,12 +2,21 @@ package com.volmit.config;
import java.lang.annotation.*;
/** Says what an option's text names, such as {@code @Ref(Reference.BLOCK) String block}. Allowed on
* {@code String} and {@link com.volmit.resource.ResourceId} options and on lists, sets and arrays of
* them, where it applies to every element. Anywhere else it fails the pack load.
/** Says what an option's text names: an entry of a platform registry, {@code @Ref(Reference.BLOCK) String block}, or
* a resource of the pack by its key, {@code @Ref(kind = LootTable.class) String table}, where {@code kind} is the type
* of a {@link com.volmit.resource.ResourceKind}: a host kind, the constants of
* {@link com.volmit.resource.PackResources}, or a kind some module of the pack registers. Studio then offers the
* registry's entries or the pack's keys of that kind. Give exactly one of the two. Allowed on {@code String} and
* {@link com.volmit.resource.ResourceId} options and on lists, sets and arrays of them, where it applies to every
* element; a {@code ResourceId} option naming a pack resource holds the id the pack gives the key it writes.
* Anything else fails the pack load.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface Ref {
Reference value();
/** The platform registry the text names; give one, or none when {@link #kind} is given. */
Reference[] value() default {};
/** The type of the resource kind the text names by key; {@code void.class}, the default, when {@link #value} is given. */
Class<?> kind() default void.class;
}
@@ -1,9 +1,9 @@
package com.volmit.config;
/** What a text option names, so studio can offer the matching completion list. Platform kinds name
* entries of the server's registries, such as {@code minecraft:stone}, including those that data
* packs and mods add. Pack kinds name resources of the pack being edited. The set is closed: every
* kind is one the Iris host can list.
/** The platform registry a text option names, so studio can offer the matching completion list: entries of the
* server's registries, such as {@code minecraft:stone}, including those that data packs and mods add, and the host's
* own noise generators. Resources of the pack are named by their kind instead, {@code @Ref(kind = ...)}. The set is
* closed: every registry is one the Iris host can list.
*/
public enum Reference {
/** A block type, such as {@code minecraft:stone}. {@link com.volmit.block.BlockState} options are block references without {@link Ref}. */
@@ -29,20 +29,8 @@ public enum Reference {
ENCHANTMENT,
/** A loot table of the platform, such as {@code minecraft:chests/simple_dungeon}; not a loot table of the pack. */
LOOT_TABLE,
/** A mob of another plugin or content provider, such as {@code mythicmobs:skeleton_king}. */
/** A mob of another plugin or content provider, such as {@code mythicmobs:SkeletonKing}; see {@link com.volmit.resource.ContentKey.Provided}. */
SPECIAL_ENTITY,
/** A biome of the pack. */
PACK_BIOME,
/** A region of the pack. */
PACK_REGION,
/** An object of the pack. */
PACK_OBJECT,
/** One of the host's noise styles, such as {@code SIMPLEX}; see {@link com.volmit.noise.NoiseStyle}. */
NOISE_STYLE,
/** An expression of the pack. */
PACK_EXPRESSION,
/** An image map of the pack. */
PACK_IMAGE_MAP,
/** A jigsaw structure of the pack. */
PACK_STRUCTURE
NOISE_STYLE
}
@@ -1,14 +0,0 @@
package com.volmit.config;
import java.lang.annotation.*;
/** Says that an option names a resource of the module resource kind read into {@code value}, by its key in the
* pack, such as {@code @ResourceRef(Pool.class) String startPool = "castle/start"}. Studio then offers the keys
* of that kind's files. Allowed on {@code String} options and lists, sets and arrays of them; the class must be
* the type of a resource kind some module of the pack registers. Anywhere else it fails the pack load.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface ResourceRef {
Class<?> value();
}