Class EnchantmentCoreRegistries
java.lang.Object
johnsmith.enchantmentcore.api.registry.EnchantmentCoreRegistries
Manages custom static registries required for the modular spell field system.
Initializes registry ResourceKeys, resolves registry suppliers from BuiltInRegistries.REGISTRY,
and caches lazily initialized dispatch codecs for polymorphic serialization and deserialization of
DistanceScalingFunctions, SpellFieldShapes, and typed SpellFieldEffects.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.resources.ResourceKey<@NotNull net.minecraft.core.Registry<@NotNull com.mojang.serialization.MapCodec<? extends DistanceScalingFunction>>> Registry key forDistanceScalingFunctioncodec registrations.static final Supplier<net.minecraft.core.Registry<@NotNull com.mojang.serialization.MapCodec<? extends DistanceScalingFunction>>> Supplier resolving the activeDistanceScalingFunctionregistry fromBuiltInRegistries.REGISTRY.static final net.minecraft.resources.ResourceKey<@NotNull net.minecraft.core.Registry<@NotNull com.mojang.serialization.MapCodec<? extends SpellFieldEffect>>> Registry key forSpellFieldEffectcodec registrations.static final Supplier<net.minecraft.core.Registry<@NotNull com.mojang.serialization.MapCodec<? extends SpellFieldEffect>>> Supplier resolving the activeSpellFieldEffectregistry fromBuiltInRegistries.REGISTRY.static final net.minecraft.resources.ResourceKey<@NotNull net.minecraft.core.Registry<@NotNull com.mojang.serialization.MapCodec<? extends SpellFieldShape>>> Registry key forSpellFieldShapecodec registrations.static final Supplier<net.minecraft.core.Registry<@NotNull com.mojang.serialization.MapCodec<? extends SpellFieldShape>>> Supplier resolving the activeSpellFieldShaperegistry fromBuiltInRegistries.REGISTRY. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.mojang.serialization.Codec<DistanceScalingFunction> Retrieves the polymorphic dispatch codec forDistanceScalingFunctioninstances.static com.mojang.serialization.Codec<SpellFieldBlockEffect> Retrieves a strictly typed dispatch codec for block-targeted spell field effects.static com.mojang.serialization.Codec<SpellFieldEntityEffect> Retrieves a strictly typed dispatch codec for entity-targeted spell field effects.static com.mojang.serialization.Codec<SpellFieldShape> Retrieves the polymorphic dispatch codec forSpellFieldShapeinstances.static com.mojang.serialization.Codec<SpellFieldVisualEffect> Retrieves a strictly typed dispatch codec for visual/particle spell field effects.static com.mojang.serialization.Codec<SpellFieldVolumeEffect> Retrieves a strictly typed dispatch codec for volume-targeted spell field effects.static voidInitializes the custom registry keys and suppliers.
-
Field Details
-
DISTANCE_SCALING_FUNCTION_KEY
public static final net.minecraft.resources.ResourceKey<@NotNull net.minecraft.core.Registry<@NotNull com.mojang.serialization.MapCodec<? extends DistanceScalingFunction>>> DISTANCE_SCALING_FUNCTION_KEYRegistry key forDistanceScalingFunctioncodec registrations. -
SPELL_FIELD_SHAPE_KEY
public static final net.minecraft.resources.ResourceKey<@NotNull net.minecraft.core.Registry<@NotNull com.mojang.serialization.MapCodec<? extends SpellFieldShape>>> SPELL_FIELD_SHAPE_KEYRegistry key forSpellFieldShapecodec registrations. -
SPELL_FIELD_EFFECT_KEY
public static final net.minecraft.resources.ResourceKey<@NotNull net.minecraft.core.Registry<@NotNull com.mojang.serialization.MapCodec<? extends SpellFieldEffect>>> SPELL_FIELD_EFFECT_KEYRegistry key forSpellFieldEffectcodec registrations. -
DISTANCE_SCALING_FUNCTIONS
public static final Supplier<net.minecraft.core.Registry<@NotNull com.mojang.serialization.MapCodec<? extends DistanceScalingFunction>>> DISTANCE_SCALING_FUNCTIONSSupplier resolving the activeDistanceScalingFunctionregistry fromBuiltInRegistries.REGISTRY. -
SPELL_FIELD_SHAPES
public static final Supplier<net.minecraft.core.Registry<@NotNull com.mojang.serialization.MapCodec<? extends SpellFieldShape>>> SPELL_FIELD_SHAPESSupplier resolving the activeSpellFieldShaperegistry fromBuiltInRegistries.REGISTRY. -
SPELL_FIELD_EFFECTS
public static final Supplier<net.minecraft.core.Registry<@NotNull com.mojang.serialization.MapCodec<? extends SpellFieldEffect>>> SPELL_FIELD_EFFECTSSupplier resolving the activeSpellFieldEffectregistry fromBuiltInRegistries.REGISTRY.
-
-
Constructor Details
-
EnchantmentCoreRegistries
public EnchantmentCoreRegistries()
-
-
Method Details
-
getDistanceScalingFunctionCodec
public static com.mojang.serialization.Codec<DistanceScalingFunction> getDistanceScalingFunctionCodec()Retrieves the polymorphic dispatch codec forDistanceScalingFunctioninstances.Uses
Codec.lazyInitialized(java.util.function.Supplier<com.mojang.serialization.Codec<A>>)so custom registries are not queried before loader registry events populateBuiltInRegistries.REGISTRY.- Returns:
- The cached
DistanceScalingFunctiondispatch codec.
-
getSpellFieldShapeCodec
Retrieves the polymorphic dispatch codec forSpellFieldShapeinstances.Uses
Codec.lazyInitialized(java.util.function.Supplier<com.mojang.serialization.Codec<A>>)so custom registries are not queried before loader registry events populateBuiltInRegistries.REGISTRY.- Returns:
- The cached
SpellFieldShapedispatch codec.
-
getSpellFieldEntityEffectCodec
public static com.mojang.serialization.Codec<SpellFieldEntityEffect> getSpellFieldEntityEffectCodec()Retrieves a strictly typed dispatch codec for entity-targeted spell field effects. Rejects effects that do not implement theSpellFieldEntityEffectcontract.- Returns:
- The type-filtered
SpellFieldEntityEffectcodec.
-
getSpellFieldBlockEffectCodec
Retrieves a strictly typed dispatch codec for block-targeted spell field effects. Rejects effects that do not implement theSpellFieldBlockEffectcontract.- Returns:
- The type-filtered
SpellFieldBlockEffectcodec.
-
getSpellFieldVolumeEffectCodec
public static com.mojang.serialization.Codec<SpellFieldVolumeEffect> getSpellFieldVolumeEffectCodec()Retrieves a strictly typed dispatch codec for volume-targeted spell field effects. Rejects effects that do not implement theSpellFieldVolumeEffectcontract.- Returns:
- The type-filtered
SpellFieldVolumeEffectcodec.
-
getSpellFieldVisualEffectCodec
public static com.mojang.serialization.Codec<SpellFieldVisualEffect> getSpellFieldVisualEffectCodec()Retrieves a strictly typed dispatch codec for visual/particle spell field effects. Rejects effects that do not implement theSpellFieldVisualEffectcontract.- Returns:
- The type-filtered
SpellFieldVisualEffectcodec.
-
initialize
public static void initialize()Initializes the custom registry keys and suppliers.
-