mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Fix nukkit augmented generator
This commit is contained in:
parent
2d98da47cf
commit
645c5fb529
@ -486,7 +486,7 @@ public class PS{
|
||||
HashMap<PlotId, Plot> plots;
|
||||
if (plots_tmp == null || (plots = plots_tmp.remove(plotArea.toString())) == null) {
|
||||
if (plotArea.TYPE == 2) {
|
||||
plots = this.plots_tmp.get(plotArea.worldname);
|
||||
plots = this.plots_tmp != null ? this.plots_tmp.get(plotArea.worldname) : null;
|
||||
if (plots != null) {
|
||||
Iterator<Entry<PlotId, Plot>> iterator = plots.entrySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@ -507,7 +507,7 @@ public class PS{
|
||||
Set<PlotCluster> clusters;
|
||||
if (clusters_tmp == null || (clusters = clusters_tmp.remove(plotArea.toString())) == null) {
|
||||
if (plotArea.TYPE == 2) {
|
||||
clusters = this.clusters_tmp.get(plotArea.worldname);
|
||||
clusters = this.clusters_tmp != null ? this.clusters_tmp.get(plotArea.worldname) : null;
|
||||
if (clusters != null) {
|
||||
Iterator<PlotCluster> iterator = clusters.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
|
@ -414,7 +414,12 @@ public class Area extends SubCommand {
|
||||
public void run(ChunkLoc value) {
|
||||
AugmentedUtils.generate(area.worldname, value.x, value.z, null);
|
||||
}
|
||||
}, null);
|
||||
}, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.sendMessage("Regen complete");
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
case "goto":
|
||||
|
@ -307,9 +307,14 @@ public final class NukkitMain extends PluginBase implements Listener, IPlotMain
|
||||
return new NukkitPlotGenerator(map);
|
||||
} catch (Throwable e) {
|
||||
System.out.println("Failed to create generator for " + name + " | " + gen);
|
||||
while (e.getCause() != null) {
|
||||
e = e.getCause();
|
||||
}
|
||||
synchronized (PS.class) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return new NukkitHybridGen(map);
|
||||
}
|
||||
|
||||
|
@ -22,15 +22,15 @@ import java.util.Map;
|
||||
|
||||
public class NukkitPlotGenerator extends Generator implements GeneratorWrapper<Generator> {
|
||||
|
||||
private final PseudoRandom random = new PseudoRandom();
|
||||
private final IndependentPlotGenerator plotGenerator;
|
||||
private final Generator platformGenerator;
|
||||
private final boolean full;
|
||||
private final String world;
|
||||
private final Map<String, Object> settings;
|
||||
private boolean loaded = false;
|
||||
private cn.nukkit.level.ChunkManager chunkManager;
|
||||
private final NukkitWrappedChunk chunkSetter;
|
||||
protected final PseudoRandom random = new PseudoRandom();
|
||||
protected final IndependentPlotGenerator plotGenerator;
|
||||
protected final Generator platformGenerator;
|
||||
protected final boolean full;
|
||||
protected final String world;
|
||||
protected final Map<String, Object> settings;
|
||||
protected boolean loaded = false;
|
||||
protected cn.nukkit.level.ChunkManager chunkManager;
|
||||
protected final NukkitWrappedChunk chunkSetter;
|
||||
|
||||
public NukkitPlotGenerator(Map<String, Object> map) {
|
||||
if (map == null) {
|
||||
@ -86,7 +86,6 @@ public class NukkitPlotGenerator extends Generator implements GeneratorWrapper<G
|
||||
this.full = true;
|
||||
chunkSetter = new NukkitWrappedChunk(world, null);
|
||||
}
|
||||
PS.get().loadWorld(world, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -136,6 +135,9 @@ public class NukkitPlotGenerator extends Generator implements GeneratorWrapper<G
|
||||
|
||||
@Override
|
||||
public void init(cn.nukkit.level.ChunkManager chunkManager, NukkitRandom nukkitRandom) {
|
||||
if (this.chunkManager == null) {
|
||||
PS.get().loadWorld(world, this);
|
||||
}
|
||||
this.chunkManager = chunkManager;
|
||||
if (getPlatformGenerator() != this) {
|
||||
getPlatformGenerator().init(chunkManager, nukkitRandom);
|
||||
|
@ -19,7 +19,7 @@ public class NukkitChunkManager extends ChunkManager {
|
||||
|
||||
@Override
|
||||
public boolean loadChunk(String world, ChunkLoc loc, boolean force) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user