Package net.minestom.server.registry
Interface Holder<T>
- Type Parameters:
T- the type of the registry entry
- All Known Subinterfaces:
Attribute,BannerPattern,Block,BlockSoundType,ChatType,DataComponent<T>,EntityType,FeatureFlag,Fluid,GameEvent,Holder.Direct<T>,Instrument,JukeboxSong,Material,PaintingVariant,Particle,PotionEffect,PotionType,RegistryKey<T>,StaticProtocolObject<T>,StatisticType,TrimMaterial,TrimPattern,VillagerProfession
- All Known Implementing Classes:
ArgumentParserType,BlockSoundImpl,InstrumentImpl,Particle.Block,Particle.BlockCrumble,Particle.BlockMarker,Particle.Dust,Particle.DustColorTransition,Particle.DustPillar,Particle.EntityEffect,Particle.FallingDust,Particle.Item,Particle.SculkCharge,Particle.Shriek,Particle.Simple,Particle.TintedLeaves,Particle.Trail,Particle.Vibration,RecipeBookCategory,RecipeDisplayType,RecipeType,SlotDisplayType,VillagerProfessionImpl,VillagerType
Represents either a reference to a registry entry RegistryKey or a direct registry value.
Whether registry values implement this type depends on client support for direct values.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault @Nullable RegistryKey<T> asKey()default TasValue()codec(Registries.Selector<T> selector, @NotNull Codec<T> registryCodec) default booleanisDirect()static <T extends Holder<T>>
@NotNull NetworkBuffer.Type<Holder<T>> networkType(Registries.Selector<T> selector, NetworkBuffer.Type<T> registryNetworkType) default Tresolve(@NotNull DynamicRegistry<T> registry) default @NotNull Either<RegistryKey<T>, T> unwrap()
-
Method Details
-
networkType
static <T extends Holder<T>> @NotNull NetworkBuffer.Type<Holder<T>> networkType(@NotNull Registries.Selector<T> selector, @NotNull NetworkBuffer.Type<T> registryNetworkType) -
codec
@NotNull static <T extends Holder<T>> @NotNull Codec<Holder<T>> codec(@NotNull Registries.Selector<T> selector, @NotNull @NotNull Codec<T> registryCodec) -
isDirect
default boolean isDirect() -
asKey
-
asValue
-
unwrap
-
resolve
-