Address deprecations in queue/generation code

This commit is contained in:
dordsor21
2022-06-08 21:12:55 +01:00
parent 3d87ee41b3
commit 43150abb86
16 changed files with 56 additions and 255 deletions

View File

@ -31,7 +31,7 @@ import com.plotsquared.core.location.ChunkWrapper;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.world.PlotAreaManager;
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 org.bukkit.Chunk;
import org.bukkit.World;
@ -65,7 +65,7 @@ final class BlockStatePopulator extends BlockPopulator {
return;
}
final ChunkWrapper wrap = new ChunkWrapper(area.getWorldName(), source.getX(), source.getZ());
final ScopedQueueCoordinator chunk = this.queue.getForChunk(wrap.x, wrap.z,
final ZeroedDelegateScopedQueueCoordinator chunk = this.queue.getForChunk(wrap.x, wrap.z,
com.plotsquared.bukkit.util.BukkitWorld.getMinWorldHeight(world),
com.plotsquared.bukkit.util.BukkitWorld.getMaxWorldHeight(world) - 1
);

View File

@ -35,7 +35,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;
@ -198,7 +198,7 @@ public class BukkitPlotGenerator extends ChunkGenerator
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) {
String name = world.getName();

View File

@ -31,7 +31,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;
@ -67,7 +67,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

@ -30,7 +30,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;
@ -52,7 +52,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

@ -37,7 +37,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;
@ -264,9 +264,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();