Class ServerSessionData
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.neoforged.neoforge.attachment.SessionData
net.neoforged.neoforge.attachment.ServerSessionData
- All Implemented Interfaces:
IAttachmentHolder
Session Data for a server. Saves through
MinecraftServer.getDataStorage().-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class AttachmentHolder
AttachmentHolder.AsField -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Identifierprivate final SavedDataType<ServerSessionData.Storage> private final MinecraftServerFields inherited from class AttachmentHolder
attachments, ATTACHMENTS_NBT_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ServerSessionDatacreate(MinecraftServer server) Creates the holder and loads it from the server's data storage, which then keeps it registered for saving.private com.mojang.serialization.Codec<ServerSessionData.Storage> SavedDataType<? extends SavedData> voidsyncData(AttachmentType<?> type) Syncs a data attachment of the given type with all relevant clients.Methods inherited from class AttachmentHolder
deserializeAttachments, deserializeAttachments, getAttachmentMap, getData, getExistingDataOrNull, getExposedHolder, hasAttachments, hasData, removeData, serializeAttachments, serializeAttachments, setDataMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncData
-
Field Details
-
ID
-
server
-
savedDataType
-
-
Constructor Details
-
ServerSessionData
-
-
Method Details
-
create
Creates the holder and loads it from the server's data storage, which then keeps it registered for saving. -
savedDataType
-
makeCodec
-
syncData
Description copied from interface:IAttachmentHolderSyncs a data attachment of the given type with all relevant clients.If there is currently no attachment of the given type, the removal of the attachment is synced to the client.
- See Also:
-