Interface IHolderExtension<T>
- All Superinterfaces:
IWithData<T>
- All Known Implementing Classes:
DeferredBlock
,DeferredBlockBuilder
,DeferredEntityTypeBuilder
,DeferredHolder
,DeferredItem
,DeferredItemBuilder
Extension for
Holder
-
Method Summary
Modifier and TypeMethodDescriptiondefault net.minecraft.core.Holder
<T> Returns the holder that this holder wraps.default @Nullable net.minecraft.resources.ResourceKey
<T> getKey()
Get the resource key held by this Holder, or null if none is present.default net.minecraft.core.HolderLookup.RegistryLookup
<T> Attempts to resolve the underlyingHolderLookup.RegistryLookup
from aHolder
.
-
Method Details
-
getDelegate
Returns the holder that this holder wraps. Used byRegistry.safeCastToReference(net.minecraft.core.Holder<T>)
to resolve the underlyingHolder.Reference
for delegating holders.- Returns:
- the holder that this holder wraps
-
unwrapLookup
Attempts to resolve the underlyingHolderLookup.RegistryLookup
from aHolder
.This will only succeed if the underlying holder is a
Holder.Reference
. -
getKey
Get 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()
-