Muqsit / WorldStyler

Yet another World Editor plugin for PocketMine... except it's actually fast!
GNU Lesser General Public License v3.0
30 stars 6 forks source link

Race condition while editing never-generated chunks #13

Open Muqsit opened 5 years ago

Muqsit commented 5 years ago

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

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.

ZandercraftGames commented 5 years ago

Oof