mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 22:56:45 +01:00
Fix plotworld get
This commit is contained in:
parent
8c56affb2f
commit
d8849f718c
@ -40,6 +40,9 @@ public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrap
|
|||||||
private boolean loaded = false;
|
private boolean loaded = false;
|
||||||
|
|
||||||
public BukkitPlotGenerator(IndependentPlotGenerator generator) {
|
public BukkitPlotGenerator(IndependentPlotGenerator generator) {
|
||||||
|
if (generator == null) {
|
||||||
|
throw new IllegalArgumentException("Generator may not be null!");
|
||||||
|
}
|
||||||
this.plotGenerator = generator;
|
this.plotGenerator = generator;
|
||||||
this.platformGenerator = this;
|
this.platformGenerator = this;
|
||||||
this.populators.add(new BlockPopulator() {
|
this.populators.add(new BlockPopulator() {
|
||||||
@ -279,7 +282,12 @@ public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrap
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PlotArea area = PS.get().getPlotArea(world.getName(), null);
|
PlotArea area = PS.get().getPlotArea(world.getName(), null);
|
||||||
|
try {
|
||||||
this.plotGenerator.generateChunk(this.chunkSetter, area, this.random);
|
this.plotGenerator.generateChunk(this.chunkSetter, area, this.random);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
// Recover from generator error
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
ChunkManager.postProcessChunk(result);
|
ChunkManager.postProcessChunk(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -482,17 +482,20 @@ public class PS {
|
|||||||
|
|
||||||
public PlotArea getPlotArea(String world, String id) {
|
public PlotArea getPlotArea(String world, String id) {
|
||||||
PlotArea[] areas = this.plotAreaMap.get(world);
|
PlotArea[] areas = this.plotAreaMap.get(world);
|
||||||
if (areas == null || id == null) {
|
if (areas == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (areas.length == 1) {
|
if (areas.length == 1) {
|
||||||
return areas[0];
|
return areas[0];
|
||||||
}
|
} else if (id == null) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
for (PlotArea area : areas) {
|
for (PlotArea area : areas) {
|
||||||
if (StringMan.isEqual(id, area.id)) {
|
if (StringMan.isEqual(id, area.id)) {
|
||||||
return area;
|
return area;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user