Class AttachmentHolder.AsField
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.neoforged.neoforge.attachment.AttachmentHolder.AsField
- All Implemented Interfaces:
IAttachmentHolder
- Enclosing class:
AttachmentHolder
Version of the
AttachmentHolder
that is suitable for storing in a field.
To be used when extending AttachmentHolder
is not possible,
for example because the class already has a supertype.-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsField
-
Field Summary
Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
attachments, ATTACHMENTS_NBT_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deserializeInternal
(HolderLookup.Provider provider, CompoundTag tag) (package private) IAttachmentHolder
Returns the attachment holder that is exposed to the user.Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getAttachmentMap, getData, getExistingData, hasAttachments, hasData, removeData, serializeAttachments, setData
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, hasData, removeData, setData
-
Field Details
-
exposedHolder
-
-
Constructor Details
-
AsField
-
-
Method Details
-
getExposedHolder
IAttachmentHolder getExposedHolder()Description copied from class:AttachmentHolder
Returns the attachment holder that is exposed to the user. This is the same asthis
for most cases, but when usingAttachmentHolder.AsField
it is the field holder.- Overrides:
getExposedHolder
in classAttachmentHolder
-
deserializeInternal
-