Interface RegistryKey<T>
- Type Parameters:
T- the type of the registry entry
- All Known Subinterfaces:
Attribute, Block, BlockEntityType, BlockSoundType, DataComponent<T>, DebugSubscription<T>, EntityType, FeatureFlag, Fluid, GameEvent, GameRule<T>, Material, Particle, PotionEffect, PotionType, StaticProtocolObject<T>, StatisticType, VillagerProfession
- All Known Implementing Classes:
ArgumentParserType, BuiltinSoundEvent, DebugSubscriptionImpl, Particle.Block, Particle.BlockCrumble, Particle.BlockMarker, Particle.DragonBreath, Particle.Dust, Particle.DustColorTransition, Particle.DustPillar, Particle.Effect, Particle.EntityEffect, Particle.FallingDust, Particle.Flash, Particle.Geyser, Particle.GeyserBase, Particle.GeyserPlume, Particle.GeyserPoof, Particle.InstantEffect, Particle.Item, Particle.SculkCharge, Particle.Shriek, Particle.Simple, Particle.TintedLeaves, Particle.Trail, Particle.Vibration, RecipeBookCategory, RecipeDisplayType, RecipeType, SlotDisplayType, VillagerProfessionImpl, VillagerType
Represents a reference to a
Registry entry.-
Nested Class Summary
Nested classes/interfaces inherited from interface Holder
Holder.Direct<T> -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Codec<RegistryKey<T>> codec(Registries.Selector<T> selector) default Stringname()static <T> NetworkBuffer.Type<RegistryKey<T>> networkType(Registries.Selector<T> selector) static <T> RegistryKey<T> Creates a typed key from a string.static <T> RegistryKey<T> Creates a typed key without checking registry membership.static <T> Codec<RegistryKey<T>> static <T> NetworkBuffer.Type<RegistryKey<T>>
-
Method Details
-
networkType
-
codec
-
uncheckedNetworkType
-
uncheckedCodec
-
of
Creates a typed key from a string. The key syntax is validated, registry membership is not. A key is only a typed name: the same key can name a registered entry in one registry and nothing in another. Lookups with a key that has no entry returnnullor-1.- Type Parameters:
T- the registry entry type- Parameters:
key- the entry key- Returns:
- the typed registry key
- Throws:
IllegalArgumentException- ifkeyis not validNullPointerException- ifkeyisnull
-
of
Creates a typed key without checking registry membership. Seeof(String).- Type Parameters:
T- the registry entry type- Parameters:
key- the entry key- Returns:
- the typed registry key
- Throws:
NullPointerException- ifkeyisnull
-
name
-