Interface Holder<T>
- Type Parameters:
T- the type of the registry entry
- All Known Subinterfaces:
Attribute, BannerPattern, Block, BlockEntityType, BlockSoundType, ChatType, DataComponent<T>, DebugSubscription<T>, Dialog, 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, BlockEntityTypeImpl, BuiltinSoundEvent, DebugSubscriptionImpl, Dialog.Confirmation, Dialog.DialogList, Dialog.MultiAction, Dialog.Notice, Dialog.ServerLinks, InstrumentImpl, Particle.Block, Particle.BlockCrumble, Particle.BlockMarker, Particle.DragonBreath, Particle.Dust, Particle.DustColorTransition, Particle.DustPillar, Particle.Effect, Particle.EntityEffect, Particle.FallingDust, Particle.Flash, Particle.InstantEffect, 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, Codec<T> registryCodec) default booleanisDirect()static <T extends Holder<T>>
NetworkBuffer.Type<Holder<T>> networkType(Registries.Selector<T> selector, NetworkBuffer.Type<T> registryNetworkType) default Tresolve(DynamicRegistry<T> registry) default Either<RegistryKey<T>, T> unwrap()
-
Method Details
-
networkType
static <T extends Holder<T>> NetworkBuffer.Type<Holder<T>> networkType(Registries.Selector<T> selector, NetworkBuffer.Type<T> registryNetworkType) -
codec
static <T extends Holder<T>> Codec<Holder<T>> codec(Registries.Selector<T> selector, Codec<T> registryCodec) -
isDirect
default boolean isDirect() -
asKey
-
asValue
-
unwrap
-
resolve
-