Skip to content
This repository was archived by the owner on Sep 12, 2022. It is now read-only.
This repository was archived by the owner on Sep 12, 2022. It is now read-only.

Race condition while editing never-generated chunks #13

Description

@Muqsit

Issue

While world-editing a massive region (eg: //pos1: [0, 0, 0] and //pos2: [1000, 255, 1000]), the cuboid formed by the two points may include chunks that have never been loaded/generated at all.

So what happens?

The plugin would request PocketMine to create the chunk. PocketMine's chunk creation is synchronous which works well with the design of WorldStyler, BUT PocketMine's world generation AND population is asynchronous and WorldStyler completely disregards that fact! Here's what happens when you //set stone f.e in a large area:
ece

  • How did the dirt and ores get there?
    Because the population task was done after the chunk had already been edited by WorldStyler.
  • What's up with that weird stair-like pattern?
    Just another possible thing that could happen while modifying non-generated chunks. The chunk was never generated, it's an empty chunk that the server is modifying. The chunk hasn't been flagged as "generated" before WorldStyler modifies it. So pocketmine's generators override the chunk.

The solution would be to queue the world edit task for such chunks. The plugin would request the chunk to generate and once it's done generating, WorldStyler may do whatever it likes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions