mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-27 19:24:43 +02:00
Clean up PlotAreaManager and move a bunch of plot area related logic out of PlotSquared
This commit is contained in:
@ -54,7 +54,10 @@ final class BlockStatePopulator extends BlockPopulator {
|
||||
if (this.queue == null) {
|
||||
this.queue = GlobalBlockQueue.IMP.getNewQueue(world.getName(), false);
|
||||
}
|
||||
final PlotArea area = PlotSquared.get().getPlotArea(world.getName(), null);
|
||||
final PlotArea area = PlotSquared.get().getPlotAreaManager().getPlotArea(world.getName(), null);
|
||||
if (area == null) {
|
||||
return;
|
||||
}
|
||||
final ChunkWrapper wrap =
|
||||
new ChunkWrapper(area.getWorldName(), source.getX(), source.getZ());
|
||||
final ScopedLocalBlockQueue chunk = this.queue.getForChunk(wrap.x, wrap.z);
|
||||
|
@ -108,7 +108,7 @@ public class BukkitPlotGenerator extends ChunkGenerator
|
||||
if (!this.loaded) {
|
||||
String name = world.getName();
|
||||
PlotSquared.get().loadWorld(name, this);
|
||||
Set<PlotArea> areas = PlotSquared.get().getPlotAreas(name);
|
||||
final Set<PlotArea> areas = PlotSquared.get().getPlotAreaManager().getPlotAreasSet(name);
|
||||
if (!areas.isEmpty()) {
|
||||
PlotArea area = areas.iterator().next();
|
||||
if (!area.isMobSpawning()) {
|
||||
@ -198,8 +198,8 @@ public class BukkitPlotGenerator extends ChunkGenerator
|
||||
if (ChunkManager.preProcessChunk(loc, result)) {
|
||||
return;
|
||||
}
|
||||
PlotArea area = PlotSquared.get().getPlotArea(world.getName(), null);
|
||||
if (area == null && (area = PlotSquared.get().getPlotArea(this.levelName, null)) == null) {
|
||||
PlotArea area = PlotSquared.get().getPlotAreaManager().getPlotArea(world.getName(), null);
|
||||
if (area == null && (area = PlotSquared.get().getPlotAreaManager().getPlotArea(this.levelName, null)) == null) {
|
||||
throw new IllegalStateException(
|
||||
"Cannot regenerate chunk that does not belong to a plot area." + " Location: " + loc
|
||||
+ ", world: " + world);
|
||||
|
Reference in New Issue
Block a user