Expand Attachment system capabilities#3095
Conversation
Last commit published: 4f0e1667bc60ddea2b23aa625889644d8af9ee7d - version: PR PublishingThe artifacts published by this PR:
Repository DeclarationIn order to use the artifacts published by the PR, add the following repository to your buildscript: repositories {
maven {
name = "Maven for PR #3095" // https://github.com/neoforged/NeoForge/pull/3095
url = uri("https://prmaven.neoforged.net/NeoForge/pr3095")
content {
includeModule("net.neoforged", "neoforge")
includeModule("net.neoforged", "testframework")
}
}
}MDK installationIn order to setup a MDK using the latest PR version, run the following commands in a terminal. mkdir NeoForge-pr3095
cd NeoForge-pr3095
curl -L https://prmaven.neoforged.net/NeoForge/pr3095/net/neoforged/neoforge/26.1.2.44-beta-pr-3095-server-attachments/mdk-pr3095.zip -o mdk.zip
jar xf mdk.zip
rm mdk.zip || del mdk.zipTo test a production environment, you can download the installer from here. |
|
@robotgryphon, this PR introduces breaking changes. Compatibility checks
|
| "net/neoforged/neoforge/common/extensions/IPlayerListExtension" | ||
| ], | ||
| "net/minecraft/server/MinecraftServer": [ | ||
| "net/neoforged/neoforge/attachment/IForwardingAttachmentHolder" |
There was a problem hiding this comment.
This needs a more general solution such that the attachments can be synced to the client as well (and accessed from there). We brainstormed some sort of SessionData class that could be accessed from any level (including a client level) to that effect, should be findable on Discord somewhere.
This PR lays the foundation to allow for the expansion of the attachment system to new types, without bringing along some of the hard-coded sync and data persistence code that the existing system built due to its few type requirements.
Some examples, with vanilla attachment holders. These expose the holder, data storage, data persistence, and sync systems to anyone that wishes to interact with them, via the capability system:
Usage
Note that this is NOT required for the new sync and persistence code. It simply highlights what is now possible due to the systems moving to common, reusable interfaces.
TODOs
AttachmentHolderSyncHandlerclasses)MinecraftServerandClientLevelclasses