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

Adding support for schematics file format #193

Open
Bafbi opened this issue Jan 20, 2023 · 1 comment · May be fixed by #263
Open

Adding support for schematics file format #193

Bafbi opened this issue Jan 20, 2023 · 1 comment · May be fixed by #263
Labels
enhancement New feature or request

Comments

@Bafbi
Copy link
Contributor

Bafbi commented Jan 20, 2023

Description :

.schem file format, is meant to store part of the minecraft world as file and can be use in a large variety of community programs.

Specification link

Usability :

Adding support for this file format could be used to :

  • Let the server dev enhance his world generation by using premade structure
  • Let minigame creator use premade arena
  • Simplify the creation of tools for users to copy as or paste shematics

Implementation

For a simple implementation, I would see something like :

let schem = Schematics::load("<path>");

instance.paste_schem(schem: Schematics, basePos: Vec3, option: PasteOption);

let copy_schem = instance.copy_schem(pos1 : Vec3, pos2 : Vec3, option: CopyOption);

Schematics::save(schem: Schematics, "<path>");

The option would be like :

  • paste_air_block : bool
  • copy_entities : bool
  • ...
@rj00a
Copy link
Member

rj00a commented Jan 22, 2023

I think this would work well as an official auxiliary crate in the same way that valence_anvil is.

@rj00a rj00a added the enhancement New feature or request label Jan 22, 2023
@MrlnHi MrlnHi linked a pull request Mar 2, 2023 that will close this issue
@rj00a rj00a mentioned this issue Jun 30, 2023
4 tasks
rj00a added a commit that referenced this issue Jul 1, 2023
## Description

Iterate on the design of `valence_instance` and `valence_anvil`. This
has been a blocker for #193 and #342.

- Removed the `LOADED` const param from `Chunk` and split it into
separate `LoadedChunk` and `UnloadedChunk` types. Common operations
between the two are part of the new `Chunk` trait.
- Reworked the chunk interface and made it more convenient.
- Removed the confusing `ChunkCell` mechanism and flattened its data
into `LoadedChunk`.
- As a consequence of the previous point, `LoadedChunk` now implements
`WritePacket`.
- Added support for the new biome change packet introduced circa 1.19.4.
- Resolved some confusion around the client's respawn position/compass
position. Fixes #312.
- Improvements to `valence_anvil`. Now handles chunks with unusual
`min_y` correctly.
- Simplified `PacketWriter` interface. No longer takes a mut ref to a
`Vec<u8>`.
- Fixed a bug where block entities were not properly removed when
truncating a chunk.
- Added more unit tests for chunk mutations and chunk loading/unloading.
- Loaded chunks now use viewership information for optimization. Only
chunks in view of clients will record changes. For instance, writing a
packet to a chunk out of view is a no-op.
- Entities are always despawned on the client when the entity is moved
to an unloaded chunk position.
- Reorganized `valence_instance`.
- Fix player list systems not being added to the correct system set.
- New utilities for unit tests.

There was initially some indecision around whether chunks and block
entities should be entities in the ECS. After some consideration, I
decided to abandon that idea.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants