Record Class RegistryKey<T>

java.lang.Object
java.lang.Record
fr.fidorial.registry.RegistryKey<T>
Type Parameters:
T - marker type for entries contained by the registry
Record Components:
key - namespaced registry identifier

public record RegistryKey<T>(Key key) extends Record
Identifies a Minecraft registry.
  • Field Details

    • ATTRIBUTE

      public static final RegistryKey<Attribute> ATTRIBUTE
      Registry key for minecraft:attribute.
    • BIOME

      public static final RegistryKey<Biome> BIOME
      Registry key for minecraft:worldgen/biome.
    • BLOCK

      public static final RegistryKey<BlockType> BLOCK
      Registry key for minecraft:block.
    • CAT_SOUND_VARIANT

      public static final RegistryKey<CatSoundVariant> CAT_SOUND_VARIANT
      Registry key for minecraft:cat_sound_variant.
    • CAT_VARIANT

      public static final RegistryKey<CatVariant> CAT_VARIANT
      Registry key for minecraft:cat_variant.
    • CHAT_TYPE

      public static final RegistryKey<ChatType> CHAT_TYPE
      Registry key for minecraft:chat_type.
    • CHICKEN_SOUND_VARIANT

      public static final RegistryKey<ChickenSoundVariant> CHICKEN_SOUND_VARIANT
      Registry key for minecraft:chicken_sound_variant.
    • CHICKEN_VARIANT

      public static final RegistryKey<ChickenVariant> CHICKEN_VARIANT
      Registry key for minecraft:chicken_variant.
    • COW_SOUND_VARIANT

      public static final RegistryKey<CowSoundVariant> COW_SOUND_VARIANT
      Registry key for minecraft:cow_sound_variant.
    • COW_VARIANT

      public static final RegistryKey<CowVariant> COW_VARIANT
      Registry key for minecraft:cow_variant.
    • DAMAGE_TYPE

      public static final RegistryKey<DamageType> DAMAGE_TYPE
      Registry key for minecraft:damage_type.
    • DATA_COMPONENT_TYPE

      public static final RegistryKey<DataComponentType> DATA_COMPONENT_TYPE
      Registry key for minecraft:data_component_type.
    • DIALOG

      public static final RegistryKey<Dialog> DIALOG
      Registry key for minecraft:dialog.
    • DIMENSION_TYPE

      public static final RegistryKey<DimensionType> DIMENSION_TYPE
      Registry key for minecraft:dimension_type.
    • ENCHANTMENT

      public static final RegistryKey<Enchantment> ENCHANTMENT
      Registry key for minecraft:enchantment.
    • FROG_VARIANT

      public static final RegistryKey<FrogVariant> FROG_VARIANT
      Registry key for minecraft:frog_variant.
    • GAME_EVENT

      public static final RegistryKey<GameEvent> GAME_EVENT
      Registry key for minecraft:game_event.
    • GAME_RULE

      public static final RegistryKey<GameRule> GAME_RULE
      Registry key for minecraft:game_rule.
    • INSTRUMENT

      public static final RegistryKey<Instrument> INSTRUMENT
      Registry key for minecraft:instrument.
    • ITEM

      public static final RegistryKey<Item> ITEM
      Registry key for minecraft:item.
    • JUKEBOX_SONG

      public static final RegistryKey<JukeboxSong> JUKEBOX_SONG
      Registry key for minecraft:jukebox_song.
    • MAP_DECORATION_TYPE

      public static final RegistryKey<MapDecorationType> MAP_DECORATION_TYPE
      Registry key for minecraft:map_decoration_type.
    • MOB_EFFECT

      public static final RegistryKey<MobEffect> MOB_EFFECT
      Registry key for minecraft:mob_effect.
    • PAINTING_VARIANT

      public static final RegistryKey<PaintingVariant> PAINTING_VARIANT
      Registry key for minecraft:painting_variant.
    • PIG_SOUND_VARIANT

      public static final RegistryKey<PigSoundVariant> PIG_SOUND_VARIANT
      Registry key for minecraft:pig_sound_variant.
    • PIG_VARIANT

      public static final RegistryKey<PigVariant> PIG_VARIANT
      Registry key for minecraft:pig_variant.
    • SOUND_EVENT

      public static final RegistryKey<SoundEvent> SOUND_EVENT
      Registry key for minecraft:sound_event.
    • TIMELINE

      public static final RegistryKey<Timeline> TIMELINE
      Registry key for minecraft:timeline.
    • TRIM_MATERIAL

      public static final RegistryKey<TrimMaterial> TRIM_MATERIAL
      Registry key for minecraft:trim_material.
    • TRIM_PATTERN

      public static final RegistryKey<TrimPattern> TRIM_PATTERN
      Registry key for minecraft:trim_pattern.
    • VILLAGER_PROFESSION

      public static final RegistryKey<VillagerProfession> VILLAGER_PROFESSION
      Registry key for minecraft:villager_profession.
    • VILLAGER_TYPE

      public static final RegistryKey<VillagerType> VILLAGER_TYPE
      Registry key for minecraft:villager_type.
    • WOLF_SOUND_VARIANT

      public static final RegistryKey<WolfSoundVariant> WOLF_SOUND_VARIANT
      Registry key for minecraft:wolf_sound_variant.
    • WOLF_VARIANT

      public static final RegistryKey<WolfVariant> WOLF_VARIANT
      Registry key for minecraft:wolf_variant.
    • WORLD_CLOCK

      public static final RegistryKey<WorldClock> WORLD_CLOCK
      Registry key for minecraft:world_clock.
    • ZOMBIE_NAUTILUS_VARIANT

      public static final RegistryKey<ZombieNautilusVariant> ZOMBIE_NAUTILUS_VARIANT
      Registry key for minecraft:zombie_nautilus_variant.
    • ENTITY_TYPE

      public static final RegistryKey<EntityType> ENTITY_TYPE
      Registry key for minecraft:entity_type.
  • Constructor Details

    • RegistryKey

      public RegistryKey(Key key)
      Creates an instance of a RegistryKey record class.
      Parameters:
      key - the value for the key record component
  • Method Details

    • of

      public static <T> RegistryKey<T> of(Key key)
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • key

      public Key key()
      Returns the value of the key record component.
      Returns:
      the value of the key record component