Class SpellFieldRegistrar

java.lang.Object
johnsmith.enchantmentcore.api.registry.SpellFieldRegistrar

public class SpellFieldRegistrar extends Object
Centralized registration helper for binding built-in spell field DistanceScalingFunctions, SpellFieldShapes, and SpellFieldEffects to their custom registries across all mod loaders.

Also dispatches each implementation's LevelBasedKeyProvider keys to DataTransformerRegistry so that nested level-based values inside spell fields are automatically recognized during import and export.

  • Constructor Details

    • SpellFieldRegistrar

      public SpellFieldRegistrar()
  • Method Details

    • registerFunctions

      public static void registerFunctions(BiConsumer<net.minecraft.resources.Identifier, com.mojang.serialization.MapCodec<? extends DistanceScalingFunction>> registrar)
      Feeds all built-in DistanceScalingFunction codecs into the provided platform registrar callback.
      Parameters:
      registrar - A consumer accepting each function's Identifier and MapCodec.
    • registerShapes

      public static void registerShapes(BiConsumer<net.minecraft.resources.Identifier, com.mojang.serialization.MapCodec<? extends SpellFieldShape>> registrar)
      Feeds all built-in SpellFieldShape codecs into the provided platform registrar callback and registers their level-based JSON keys with DataTransformerRegistry.
      Parameters:
      registrar - A consumer accepting each shape's Identifier and MapCodec.
    • registerEffects

      public static void registerEffects(BiConsumer<net.minecraft.resources.Identifier, com.mojang.serialization.MapCodec<? extends SpellFieldEffect>> registrar)
      Feeds all built-in SpellFieldEffect codecs into the provided platform registrar callback and registers their level-based JSON keys with DataTransformerRegistry.
      Parameters:
      registrar - A consumer accepting each effect's Identifier and MapCodec.