镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Add ItemStack 1.8.8+ cross-version PersistentDataContainer - #4143

Merged
mdcfe merged 8 commits into
EssentialsX:2.xfrom
JRoy:feature/persistent-data-pain
May 28, 2021
Merged

mdcfe merged 8 commits into
EssentialsX:2.xfrom
JRoy:feature/persistent-data-pain

Conversation

@JRoy

@JRoy JRoy commented May 9, 2021 •

Copy link
Copy Markdown
Member

This PR itself does nothing on its own but creates the underlying backbone I need to make a less hacky solution in #3963 lmfao.

This PR creates a provider which uses NBT on 1.8.8-1.13 to mimic the exact structure of a PersistentDataContainer on 1.14+ which will allow us make any possible upgrades (which don't die from the lack of DFU on >1.13) work as expected. Additionally, this does not use reflection on modern minecraft versions and thus will not need to be maintained/updated on MC version updates.

In the future, we will need to find a way to store data on tile entities (signs namely) so that we are able to store UUIDs on signs for future plans but for now ItemStacks work to fix our spawner issues.

Tested on;
Spigot 1.8.8
Paper 1.8.8
Paper 1.12.2
Paper 1.16.4

@JRoy JRoy added the type: enhancement Features and feature requests. label May 9, 2021
@JRoy JRoy added this to the 2.19.0 milestone May 9, 2021
…l/providers/ReflPersistentDataProvider.java

Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com>
@EssentialsX EssentialsX deleted a comment from jpenilla May 10, 2021
@JRoy
JRoy requested a review from mdcfe May 10, 2021 17:14
@JRoy

JRoy commented May 10, 2021

Copy link
Copy Markdown
Member Author

Concerns addressed

@mdcfe
mdcfe enabled auto-merge (squash) May 28, 2021 11:21
@mdcfe
mdcfe merged commit ec50b28 into EssentialsX:2.x May 28, 2021
@JRoy
JRoy deleted the feature/persistent-data-pain branch May 28, 2021 17:57
ressidell pushed a commit to ressidell/Essentials that referenced this pull request Apr 27, 2025
…sX#4143)

This PR itself does nothing on its own but creates the underlying backbone I need to make a less hacky solution in EssentialsX#3963 lmfao.

This PR creates a provider which uses NBT on 1.8.8-1.13 to mimic the exact structure of a PersistentDataContainer on 1.14+ which will allow us make any possible upgrades (which don't die from the lack of DFU on >1.13) work as expected. Additionally, this does not use reflection on modern Minecraft versions and thus will not need to be maintained/updated on MC version updates.

In the future, we will need to find a way to store data on tile entities (signs namely) so that we are able to store UUIDs on signs for future plans, but for now ItemStacks work to fix our spawner issues.
rewsdjad1 pushed a commit to rewsdjad1/EssentialsXPlus that referenced this pull request Aug 13, 2026
…sX#4143)

This PR itself does nothing on its own but creates the underlying backbone I need to make a less hacky solution in EssentialsX#3963 lmfao.

This PR creates a provider which uses NBT on 1.8.8-1.13 to mimic the exact structure of a PersistentDataContainer on 1.14+ which will allow us make any possible upgrades (which don't die from the lack of DFU on >1.13) work as expected. Additionally, this does not use reflection on modern Minecraft versions and thus will not need to be maintained/updated on MC version updates.

In the future, we will need to find a way to store data on tile entities (signs namely) so that we are able to store UUIDs on signs for future plans, but for now ItemStacks work to fix our spawner issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement Features and feature requests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants