mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 20:56:45 +01:00
Set plot biome chunk by chunk (#3590)
* Actually set plot biome chunk by chunk * Better variable name for chunk position
This commit is contained in:
parent
0974fb2834
commit
a6aaa9538f
@ -409,13 +409,26 @@ public abstract class RegionManager {
|
||||
) {
|
||||
final QueueCoordinator queue = blockQueue.getNewQueue(worldUtil.getWeWorld(area.getWorldName()));
|
||||
queue.addReadChunks(region.getChunks());
|
||||
queue.setChunkConsumer(blockVector2 -> {
|
||||
final BlockVector3 regionMin = region.getMinimumPoint();
|
||||
final BlockVector3 regionMax = region.getMaximumPoint();
|
||||
queue.setChunkConsumer(chunkPos -> {
|
||||
BlockVector3 chunkMin = BlockVector3.at(
|
||||
Math.max(chunkPos.getX() << 4, regionMin.getBlockX()),
|
||||
regionMin.getBlockY(),
|
||||
Math.max(chunkPos.getZ() << 4, regionMin.getBlockZ())
|
||||
);
|
||||
BlockVector3 chunkMax = BlockVector3.at(
|
||||
Math.min((chunkPos.getX() << 4) + 15, regionMax.getBlockX()),
|
||||
regionMax.getBlockY(),
|
||||
Math.min((chunkPos.getZ() << 4) + 15, regionMax.getBlockZ())
|
||||
);
|
||||
CuboidRegion chunkRegion = new CuboidRegion(region.getWorld(), chunkMin, chunkMax);
|
||||
WorldUtil.setBiome(
|
||||
area.getWorldName(),
|
||||
region,
|
||||
chunkRegion,
|
||||
biome
|
||||
);
|
||||
worldUtil.refreshChunk(blockVector2.getBlockX(), blockVector2.getBlockZ(), area.getWorldName());
|
||||
worldUtil.refreshChunk(chunkPos.getBlockX(), chunkPos.getBlockZ(), area.getWorldName());
|
||||
});
|
||||
queue.setCompleteTask(whenDone);
|
||||
queue.enqueue();
|
||||
|
Loading…
Reference in New Issue
Block a user