Address deprecations in queue/generation code (#3658)

This commit is contained in:
Jordan
2022-06-16 15:41:03 +01:00
committed by GitHub
parent 8afcaccb8a
commit 27ffe4fcdc
17 changed files with 55 additions and 278 deletions

View File

@ -26,7 +26,7 @@ import com.plotsquared.core.location.UncheckedWorldLocation;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.plot.world.SinglePlotArea;
import com.plotsquared.core.queue.ScopedQueueCoordinator;
import com.plotsquared.core.queue.ZeroedDelegateScopedQueueCoordinator;
import org.bukkit.generator.BlockPopulator;
import org.bukkit.generator.LimitedRegion;
import org.bukkit.generator.WorldInfo;
@ -80,7 +80,7 @@ final class BlockStatePopulator extends BlockPopulator {
worldInfo.getMaxHeight(),
(chunkZ << 4) + 15
);
ScopedQueueCoordinator offsetChunkQueue = new ScopedQueueCoordinator(wrapped, min, max);
ZeroedDelegateScopedQueueCoordinator offsetChunkQueue = new ZeroedDelegateScopedQueueCoordinator(wrapped, min, max);
this.plotGenerator.populateChunk(offsetChunkQueue, area);
}

View File

@ -28,7 +28,7 @@ import com.plotsquared.core.generator.SingleWorldGenerator;
import com.plotsquared.core.location.ChunkWrapper;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.queue.ScopedQueueCoordinator;
import com.plotsquared.core.queue.ZeroedDelegateScopedQueueCoordinator;
import com.plotsquared.core.util.ChunkManager;
import com.sk89q.worldedit.math.BlockVector2;
import org.bukkit.World;
@ -204,7 +204,7 @@ public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrap
return result.getChunkData();
}
private void generate(BlockVector2 loc, World world, ScopedQueueCoordinator result) {
private void generate(BlockVector2 loc, World world, ZeroedDelegateScopedQueueCoordinator result) {
// Load if improperly loaded
if (!this.loaded) {
checkLoaded(world);

View File

@ -24,7 +24,7 @@ import com.plotsquared.core.generator.IndependentPlotGenerator;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.PlotId;
import com.plotsquared.core.queue.ScopedQueueCoordinator;
import com.plotsquared.core.queue.ZeroedDelegateScopedQueueCoordinator;
import com.plotsquared.core.util.MathMan;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import org.bukkit.World;
@ -60,7 +60,7 @@ final class DelegatePlotGenerator extends IndependentPlotGenerator {
}
@Override
public void generateChunk(final ScopedQueueCoordinator result, PlotArea settings) {
public void generateChunk(final ZeroedDelegateScopedQueueCoordinator result, PlotArea settings) {
World world = BukkitUtil.getWorld(this.world);
Location min = result.getMin();
int chunkX = min.getX() >> 4;

View File

@ -26,7 +26,7 @@ import com.plotsquared.core.location.UncheckedWorldLocation;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.world.SinglePlotArea;
import com.plotsquared.core.queue.QueueCoordinator;
import com.plotsquared.core.queue.ScopedQueueCoordinator;
import com.plotsquared.core.queue.ZeroedDelegateScopedQueueCoordinator;
import com.sk89q.worldedit.bukkit.BukkitWorld;
import com.sk89q.worldedit.util.SideEffectSet;
import org.bukkit.Chunk;
@ -66,7 +66,7 @@ final class LegacyBlockStatePopulator extends BlockPopulator {
queue.setChunkObject(source);
Location min = UncheckedWorldLocation.at(world.getName(), chunkMinX, world.getMinHeight(), chunkMinZ);
Location max = UncheckedWorldLocation.at(world.getName(), chunkMinX + 15, world.getMaxHeight(), chunkMinZ + 15);
ScopedQueueCoordinator offsetChunkQueue = new ScopedQueueCoordinator(queue, min, max);
ZeroedDelegateScopedQueueCoordinator offsetChunkQueue = new ZeroedDelegateScopedQueueCoordinator(queue, min, max);
this.plotGenerator.populateChunk(offsetChunkQueue, area);
queue.enqueue();
}

View File

@ -23,7 +23,7 @@ import com.plotsquared.bukkit.util.BukkitBlockUtil;
import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.core.location.ChunkWrapper;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.queue.ScopedQueueCoordinator;
import com.plotsquared.core.queue.ZeroedDelegateScopedQueueCoordinator;
import com.plotsquared.core.util.AnnotationHelper;
import com.plotsquared.core.util.ChunkUtil;
import com.plotsquared.core.util.PatternUtil;
@ -45,7 +45,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.Arrays;
@AnnotationHelper.ApiDescription(info = "Internal use only. Subject to changes at any time.")
public class GenChunk extends ScopedQueueCoordinator {
public class GenChunk extends ZeroedDelegateScopedQueueCoordinator {
public final Biome[] biomes;
public BlockState[][] result;

View File

@ -30,7 +30,7 @@ import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.PlotManager;
import com.plotsquared.core.queue.GlobalBlockQueue;
import com.plotsquared.core.queue.QueueCoordinator;
import com.plotsquared.core.queue.ScopedQueueCoordinator;
import com.plotsquared.core.queue.ZeroedDelegateScopedQueueCoordinator;
import com.plotsquared.core.util.ChunkManager;
import com.plotsquared.core.util.RegionManager;
import com.plotsquared.core.util.WorldUtil;
@ -257,9 +257,9 @@ public class BukkitRegionManager extends RegionManager {
map.saveEntitiesOut(Bukkit.getWorld(world.getName()).getChunkAt(x, z), currentPlotClear);
AugmentedUtils.bypass(
ignoreAugment,
() -> ChunkManager.setChunkInPlotArea(null, new RunnableVal<ScopedQueueCoordinator>() {
() -> ChunkManager.setChunkInPlotArea(null, new RunnableVal<ZeroedDelegateScopedQueueCoordinator>() {
@Override
public void run(ScopedQueueCoordinator value) {
public void run(ZeroedDelegateScopedQueueCoordinator value) {
Location min = value.getMin();
int bx = min.getX();
int bz = min.getZ();