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

Blueprints and PersistentDataContainer #2102

Open
2 tasks done
PancakeCatsss opened this issue Mar 5, 2023 · 3 comments
Open
2 tasks done

Blueprints and PersistentDataContainer #2102

PancakeCatsss opened this issue Mar 5, 2023 · 3 comments
Assignees
Labels
Status: Under investigation Investigating the interest and the feasability of the issue.

Comments

@PancakeCatsss
Copy link

Is your feature request related to a problem?

So recently we wanted to add some loot chests to the islands that are generated using one of our plugins, however, we ran into an issue of the blueprints not saving the PersistentData attached to the chest that was placed.

Describe the solution you'd like.

Would be nice if possible for the blueprints to save this data attached to blocks that have PersistentDataContainers, I thought it would have already saved it since it saves text on signs, items in chests etc but it seems it does not.

Describe alternatives you've considered.

Don't really think there is another alternative,

Agreements

  • I have searched for and ensured there isn't already an open issue regarding this.
  • I have ensured the feature I'm requesting isn't already in the latest supported BentoBox build or Addons.

Other

No response

@tastybento tastybento self-assigned this Mar 5, 2023
@tastybento tastybento added the Status: Under investigation Investigating the interest and the feasability of the issue. label Mar 5, 2023
@PancakeCatsss
Copy link
Author

Just a bit more information about this

Before saving the blueprint:

0, 82, -3 has the following block data: {z: -3, id: "minecraft:chest", y: 82, x: 0, Items: [], PublicBukkitValues: {"cclootchest:loot_table": "BASTION_TREASURE"}, CustomName: '{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"green","text":"Loot Chest"}],"text":""}'}

After saving and using the blueprint:

0, 82, -3 has the following block data: {z: -3, id: "minecraft:chest", y: 82, x: 0, Items: []}

@tastybento
Copy link
Member

That's good info. I was looking at trying to work out how to serialize all of that persistent data but it looks like it might already be serialized for us using the block data. Thanks.

@tastybento
Copy link
Member

I've looked into this and it seems quite complex to store the PersistentDataContainer data and put it back onto a block. There was one person who described doing using NMS but all their quoted code has been removed from the pastebin where they put it. Unfortunately, it's not as simple as using the block data. It seems almost impossible to do it using Bukkit API. So, right now, I don't know how to do this, sorry.

Coincidentally, after studying the blueprint pasting code quite a bit, I see that we no longer use NMS to paste blocks and instead use the Bukkit API. This doesn't affect this ticket, but I thought we were using NMS to paste blocks, which we're not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Under investigation Investigating the interest and the feasability of the issue.
Projects
None yet
Development

No branches or pull requests

2 participants