valence
valence copied to clipboard
Support for schematics file format
Description
- Added auxiliary crate
valence_schem
that supports copying and pasting schematics to anInstance
and also allows for parsing them from aCompound
and serializing it back to one
Test Plan
The examples schem_loading
and schem_saving
are sufficient for testing. Also, as for a third party created schematic, I used SimpleSpongeSchematics to do so.
To test, either:
try the example schematic by running cargo r --example schem_loading -- assets/example_schem.schem
OR:
- Create a Schematic file using the sponge mod above
- Start the
schem_loading
with the path of your schematic, like so:cargo r --example schem_loading -- "my/path/to/something_cool.schem"
Related
Closes #193
I think would be good to have an example schematic in valence/assets
directory.
I think would be good to have an example schematic in
valence/assets
directory.
I agree 👍. Will do once I get back at it
Question: do we want to support all spec versions? (1-3) I don't think we should for serialization, but for deserialization probably. The deserialization would then check the version and act accordingly. So basically by deserializing an older schematic and serializing it again, we would upgrade it to version 3. I don't think we should support DataVersion (meaning knowing how to handle 1.8 schematics with blocks like minecraft:planks) but probably the Version property. What do you think?
I don't think we should support DataVersion (meaning knowing how to handle 1.8 schematics with blocks like minecraft:planks) but probably the Version property. What do you think?
That seems like the most reasonable thing to do now.
@rj00a ready for review
Currently working on a redesign of the Instance
API to fix a number of issues. Once that's mostly finished I can take a closer look at this and see what impact it has.
I've (finally) finished the redesign in #402, so we can move forward with this.
I've (finally) finished the redesign in #402, so we can move forward with this.
Ok, I updated the branch to main