mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 06:36:44 +01:00
Fix #3231
This commit is contained in:
parent
8e5e33eec2
commit
732f79bbfc
@ -419,6 +419,9 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
}, TaskTime.ticks(1L));
|
}, TaskTime.ticks(1L));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Once the server has loaded force updating all generators known to P2
|
||||||
|
TaskManager.runTaskLater(() -> PlotSquared.platform().setupUtils().updateGenerators(true), TaskTime.ticks(1L));
|
||||||
|
|
||||||
// Services are accessed in order
|
// Services are accessed in order
|
||||||
final CacheUUIDService cacheUUIDService = new CacheUUIDService(Settings.UUID.UUID_CACHE_SIZE);
|
final CacheUUIDService cacheUUIDService = new CacheUUIDService(Settings.UUID.UUID_CACHE_SIZE);
|
||||||
this.impromptuPipeline.registerService(cacheUUIDService);
|
this.impromptuPipeline.registerService(cacheUUIDService);
|
||||||
|
@ -75,8 +75,8 @@ public class BukkitSetupUtils extends SetupUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateGenerators() {
|
public void updateGenerators(final boolean force) {
|
||||||
if (!SetupUtils.generators.isEmpty()) {
|
if (!SetupUtils.generators.isEmpty() && !force) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String testWorld = "CheckingPlotSquaredGenerator";
|
String testWorld = "CheckingPlotSquaredGenerator";
|
||||||
@ -128,7 +128,7 @@ public class BukkitSetupUtils extends SetupUtils {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String setupWorld(PlotAreaBuilder builder) {
|
public String setupWorld(PlotAreaBuilder builder) {
|
||||||
this.updateGenerators();
|
this.updateGenerators(false);
|
||||||
ConfigurationNode[] steps = builder.settingsNodesWrapper() == null ?
|
ConfigurationNode[] steps = builder.settingsNodesWrapper() == null ?
|
||||||
new ConfigurationNode[0] : builder.settingsNodesWrapper().getSettingsNodes();
|
new ConfigurationNode[0] : builder.settingsNodesWrapper().getSettingsNodes();
|
||||||
String world = builder.worldName();
|
String world = builder.worldName();
|
||||||
@ -240,7 +240,7 @@ public class BukkitSetupUtils extends SetupUtils {
|
|||||||
@Override
|
@Override
|
||||||
public String getGenerator(PlotArea plotArea) {
|
public String getGenerator(PlotArea plotArea) {
|
||||||
if (SetupUtils.generators.isEmpty()) {
|
if (SetupUtils.generators.isEmpty()) {
|
||||||
updateGenerators();
|
updateGenerators(false);
|
||||||
}
|
}
|
||||||
World world = Bukkit.getWorld(plotArea.getWorldName());
|
World world = Bukkit.getWorld(plotArea.getWorldName());
|
||||||
if (world == null) {
|
if (world == null) {
|
||||||
|
@ -38,7 +38,7 @@ import java.util.ArrayList;
|
|||||||
public class SetGenCB {
|
public class SetGenCB {
|
||||||
|
|
||||||
public static void setGenerator(World world) throws Exception {
|
public static void setGenerator(World world) throws Exception {
|
||||||
PlotSquared.platform().setupUtils().updateGenerators();
|
PlotSquared.platform().setupUtils().updateGenerators(false);
|
||||||
PlotSquared.get().removePlotAreas(world.getName());
|
PlotSquared.get().removePlotAreas(world.getName());
|
||||||
ChunkGenerator gen = world.getGenerator();
|
ChunkGenerator gen = world.getGenerator();
|
||||||
if (gen == null) {
|
if (gen == null) {
|
||||||
|
@ -91,7 +91,7 @@ public class Setup extends SubCommand {
|
|||||||
}
|
}
|
||||||
process = new SetupProcess();
|
process = new SetupProcess();
|
||||||
metaDataAccess.set(process);
|
metaDataAccess.set(process);
|
||||||
this.setupUtils.updateGenerators();
|
this.setupUtils.updateGenerators(false);
|
||||||
SetupStep step = process.getCurrentStep();
|
SetupStep step = process.getCurrentStep();
|
||||||
step.announce(player);
|
step.announce(player);
|
||||||
displayGenerators(player);
|
displayGenerators(player);
|
||||||
|
@ -34,8 +34,12 @@ import java.util.HashMap;
|
|||||||
public abstract class SetupUtils {
|
public abstract class SetupUtils {
|
||||||
|
|
||||||
public static HashMap<String, GeneratorWrapper<?>> generators = new HashMap<>();
|
public static HashMap<String, GeneratorWrapper<?>> generators = new HashMap<>();
|
||||||
|
// static {
|
||||||
|
// generators.put(PlotSquared.platform().pluginName(),
|
||||||
|
// (HybridGen) PlotSquared.platform().injector().getInstance(IndependentPlotGenerator.class));
|
||||||
|
// }
|
||||||
|
|
||||||
public abstract void updateGenerators();
|
public abstract void updateGenerators(final boolean force);
|
||||||
|
|
||||||
public abstract String getGenerator(final PlotArea plotArea);
|
public abstract String getGenerator(final PlotArea plotArea);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user