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

Upgrade Data implementation to allow upgrading Sponge's Schematic Format #2039

Open
3 of 10 tasks
gabizou opened this issue Aug 2, 2018 · 4 comments
Open
3 of 10 tasks
Labels
help wanted priority: low Low priority status: accepted a confirmation that this is either an issue caused by us or something that should be added system: data system: entity type: enhancement An improvement type: impl request An Implementation request (the api is already there) version: 1.12 (u) API: 7 (unsupported since May 21st 2021) version: 1.16 (u) API: 8

Comments

@gabizou
Copy link
Member

gabizou commented Aug 2, 2018

With our Schematic format needing an update to support EntityArchetypes and Minecraft's Data Version to pipe not through DataFixers (which Mojang has not implemented yet on their own schematic format, because it's assumed that structures are still only somewhat used for creating structures in code).

Here's my proposal for changes necessary for Schematics v2 (or 1.1?) which will also affect how implementation is handled:

  • Alter Entity#toContainer(), TileEntity#toContainer(), and ItemStack#toContainer() to include the "current" Data Version that Minecraft is using

    • Pipe pre-existing data through DataFixers to upgrade from whatever current version
    • Bump the sponge exposed DataVersion to allow fail fast detection whether some other data needs to be updated, or only the DataFixers need to be processed
  • Properly implement setRawData to treat incoming data as if being read from NBT

    • Maintain the "unwrapped" Sponge formatted data, like position, types, etc. when absorbing the data, so that we don't have to change all our constants to use Mojang's constants
    • Document the format of our data and possibly their queries
  • Improve DataView API We need to better the process and usability of DataView and throw exceptions when a passed in object cannot be serialized to primitive supported types

  • Implement the proper support for using Keys and DataManipulators based on NBT.

    • Overhaul how NBT Processors are currently written, but actually make them usable.
  • Provide a data upgrader for old schematics to new schematics. Treat old content versions as Sponge content versions due to current implementation of schematics.

This also lends itself to needing the Data layout documented for Sponge's implementation on the docs, likely as an advanced section, pinging @Inscrutable for input on that. Likewise, we need to update our Schematic specification.

@limbo-app limbo-app added the status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage label Aug 2, 2018
@gabizou gabizou changed the title Upgrade Data implementation for supporting EntityArchetypes and Minecraft data versions Upgrade Data implementation to allow upgrading Sponge's Schematic Format Aug 2, 2018
@gabizou gabizou added status: accepted a confirmation that this is either an issue caused by us or something that should be added system: data type: enhancement An improvement help wanted priority: low Low priority version: 1.12 (u) API: 7 (unsupported since May 21st 2021) system: entity version: 1.16 (u) API: 8 type: impl request An Implementation request (the api is already there) and removed status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage labels Aug 2, 2018
@Inscrutable
Copy link
Member

SpongeDocs has a Data section with a few sub-pages, but nothing at all on schematics. There would be more data stuff, but the Issue has gone cold since Saladoc went away, and we have few people who feel confident enough to write about it.
The aforementioned pages would need updating and extending after this PR goes through, if someone cares to walk through the how to use the final implementation. (I won't complain if anyone wants to try finishing out the current Data docs either).

@ImMorpheus
Copy link
Contributor

@gabizou What's the status of this after the recent PRs ?

@gabizou
Copy link
Member Author

gabizou commented Jun 2, 2019

Largely still relevant. Haven't bothered redoing any of the formats or updating the format spec for Sponge's internal formats on it's things like snapshtos etc.

@Inscrutable
Copy link
Member

If we do write about Schematics in the docs it will finally deal with this old issue: SpongePowered/SpongeDocs#507

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted priority: low Low priority status: accepted a confirmation that this is either an issue caused by us or something that should be added system: data system: entity type: enhancement An improvement type: impl request An Implementation request (the api is already there) version: 1.12 (u) API: 7 (unsupported since May 21st 2021) version: 1.16 (u) API: 8
Projects
None yet
Development

No branches or pull requests

4 participants