Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[XItemStack] setDisplayName(getDisplayName()) doesn't retain the exact original IChatBaseComponent #229

Open
RazerStorm opened this issue Oct 1, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request special case Rare cases that need to be handled in the code manually by hardcoding a part of the system

Comments

@RazerStorm
Copy link

Description
So basicly the issue is that when i save a itemstack to the config using the XItemStack.serialize() function and deserialize it later it changes the nbt and that causes it not to be the exact item it was when it was put in the config.

image

Here is my full code if you want to review it: https://github.com/RazerStorm/CustomCrafting

@RazerStorm RazerStorm added the bug Something isn't working label Oct 1, 2023
@CryptoMorin
Copy link
Owner

CryptoMorin commented Oct 1, 2023

It's not possible for me to fix it. I just use get/setDisplayname(), I don't decide what those methods do. Of course I can modify the CraftBukkit instances directly, but that requires extra reflection code and probably a custom string -> TextComponent translator that I'm not willing to do myself.

Also you didn't say which version of Minecraft you're testing this with. If it's not the latest, see if the latest version has this issue as well.

@CryptoMorin CryptoMorin added enhancement New feature or request special case Rare cases that need to be handled in the code manually by hardcoding a part of the system and removed bug Something isn't working labels Oct 1, 2023
@CryptoMorin CryptoMorin changed the title [XItemStack] problem with original nbt [XItemStack] setDisplayname() doesn't retain the exact original IChatBaseComponent Oct 1, 2023
@CryptoMorin CryptoMorin changed the title [XItemStack] setDisplayname() doesn't retain the exact original IChatBaseComponent [XItemStack] setDisplayName(getDisplayName()) doesn't retain the exact original IChatBaseComponent Oct 1, 2023
@RazerStorm
Copy link
Author

Oh sorry, i indeed forgot to mention the version. The version is 1.20.1

It's not possible for me to fix it. I just use get/setDisplayname(), I don't decide what those methods do. Of course I can modify the CraftBukkit instances directly, but that requires extra reflection code and probably a custom string -> TextComponent translator that I'm not willing to do myself.

Also you didn't say which version of Minecraft you're testing this with. If it's not the latest, see if the latest version has this issue as well.

@RazerStorm RazerStorm closed this as not planned Won't fix, can't repro, duplicate, stale Oct 1, 2023
@RazerStorm RazerStorm reopened this Oct 2, 2023
@RazerStorm
Copy link
Author

I accidently closed it, i am keeping it open in case someone decides to fix this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request special case Rare cases that need to be handled in the code manually by hardcoding a part of the system
Projects
None yet
Development

No branches or pull requests

2 participants