Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Add ability for Schematics to load chunks when applying #36

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

GreatWyrm
Copy link
Contributor

No description provided.

@GreatWyrm GreatWyrm linked an issue Jan 1, 2023 that may be closed by this pull request

@Test
public void testSchemPaste() {
MinecraftServer.init();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use minestom test stuff (@EnvTest)

@GreatWyrm
Copy link
Contributor Author

Fixed it so the test runs successfully, but I get java.lang.AssertionError: Chunk must be locked before access, so I am not super comfortable with merging this in.

public @NotNull CompletableFuture<Void> applyToInstance(@NotNull Instance instance, @NotNull Point startPoint, boolean loadChunks, @NotNull Rotation rotation, @Nullable Function<Block, Block> blockModifier) {
RelativeBlockBatch batch = build(rotation, blockModifier);
if (loadChunks) {
Point min = startPoint.add(offset());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could also specify the rotation here, by adding a parameter to the function, as offset() can take a rotation parameter.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optionally load chunks when pasting a schematic
3 participants