Package net.minecraft.core
Class Holder.Reference<T>
java.lang.Object
net.minecraft.core.Holder.Reference<T>
- All Implemented Interfaces:
Holder<T>,IHolderExtension<T>,IWithData<T>
- Direct Known Subclasses:
RegistrySetBuilder.LazyHolder
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.minecraft.core.Holder
Holder.Direct<T>, Holder.Kind, Holder.Reference<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ResourceKey<T> private final HolderOwner<T> private final Holder.Reference.Typeprivate T -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedReference(Holder.Reference.Type pType, HolderOwner<T> pOwner, ResourceKey<T> pKey, T pValue) -
Method Summary
Modifier and TypeMethodDescription(package private) voidbindKey(ResourceKey<T> pKey) (package private) voidbindTags(Collection<TagKey<T>> pTags) protected voidbooleancanSerializeIn(HolderOwner<T> pOwner) static <T> Holder.Reference<T> createIntrusive(HolderOwner<T> pOwner, T pValue) Deprecated.static <T> Holder.Reference<T> createStandAlone(HolderOwner<T> pOwner, ResourceKey<T> pKey) boolean<A> AgetData(DataMapType<T, A> type) Returns the data of the given type that is attached to this object, ornullif one isn't.@Nullable ResourceKey<T> getKey()Get the resource key held by this Holder, or null if none is present.inthashCode()booleanis(Predicate<ResourceKey<T>> pPredicate) booleanbooleanis(ResourceKey<T> pResourceKey) booleanis(ResourceLocation pLocation) booleanbooleanisBound()key()kind()tags()toString()com.mojang.datafixers.util.Either<ResourceKey<T>, T> unwrap()Attempts to resolve the underlyingHolderLookup.RegistryLookupfrom aHolder.value()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.core.Holder
getRegisteredNameMethods inherited from interface net.neoforged.neoforge.common.extensions.IHolderExtension
getDelegate
-
Field Details
-
owner
-
tags
-
type
-
key
-
value
-
-
Constructor Details
-
Reference
protected Reference(Holder.Reference.Type pType, HolderOwner<T> pOwner, @Nullable ResourceKey<T> pKey, @Nullable T pValue)
-
-
Method Details
-
createStandAlone
-
createIntrusive
@Deprecated public static <T> Holder.Reference<T> createIntrusive(HolderOwner<T> pOwner, @Nullable T pValue) Deprecated. -
key
-
value
-
is
-
is
-
boundTags
-
is
-
is
-
is
-
canSerializeIn
- Specified by:
canSerializeInin interfaceHolder<T>
-
unwrap
-
unwrapKey
-
kind
-
isBound
public boolean isBound() -
bindKey
-
bindValue
-
getData
Description copied from interface:IWithDataReturns the data of the given type that is attached to this object, ornullif one isn't. -
bindTags
-
tags
-
toString
-
getKey
Description copied from interface:IHolderExtensionGet the resource key held by this Holder, or null if none is present. This method will be overriden by Holder implementations to avoid allocation associated withHolder.unwrapKey()- Specified by:
getKeyin interfaceIHolderExtension<T>
-
hashCode
public int hashCode() -
equals
-
unwrapLookup
Description copied from interface:IHolderExtensionAttempts to resolve the underlyingHolderLookup.RegistryLookupfrom aHolder.This will only succeed if the underlying holder is a
Holder.Reference.- Specified by:
unwrapLookupin interfaceIHolderExtension<T>
-