Fix NPE when plugins access WorldGenerator during startup [SD-8519]

This commit is contained in:
Christian Koop 2021-07-29 20:07:33 +02:00
parent cc99b9c856
commit 60b92cfa3a
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
2 changed files with 2 additions and 9 deletions

View File

@ -65,7 +65,7 @@ public class SkyBlock extends SongodaPlugin {
private static SkyBlock INSTANCE;
private FileManager fileManager;
private WorldManager worldManager;
private final WorldManager worldManager = new WorldManager(this);
private UserCacheManager userCacheManager;
private VisitManager visitManager;
private BanManager banManager;
@ -166,7 +166,7 @@ public class SkyBlock extends SongodaPlugin {
permissionManager = new PermissionManager(this);
localizationManager = new LocalizationManager();
worldManager = new WorldManager(this);
worldManager.loadWorlds();
userCacheManager = new UserCacheManager(this);
visitManager = new VisitManager(this);
banManager = new BanManager(this);
@ -184,7 +184,6 @@ public class SkyBlock extends SongodaPlugin {
structureManager = new StructureManager(this);
soundManager = new SoundManager(this);
if (this.config.getBoolean("Island.Generator.Enable")) {
generatorManager = new GeneratorManager(this);
}
@ -206,7 +205,6 @@ public class SkyBlock extends SongodaPlugin {
bankManager = new BankManager(this);
if (this.config.getBoolean("Island.Task.PlaytimeTask")) {
new PlaytimeTask(playerDataManager, islandManager).runTaskTimerAsynchronously(this, 0L, 20L);
}
@ -323,7 +321,6 @@ public class SkyBlock extends SongodaPlugin {
return null;
}
private boolean loadConfigs() {
try {
biomes = this.getFileManager().getConfig(new File(this.getDataFolder(), "biomes.yml")).getFileConfiguration();
@ -500,7 +497,6 @@ public class SkyBlock extends SongodaPlugin {
return economyManager;
}
public FileConfiguration getBiomes() {
return biomes;
}
@ -556,5 +552,4 @@ public class SkyBlock extends SongodaPlugin {
public FileConfiguration getScoreboard() {
return scoreboard;
}
}

View File

@ -25,8 +25,6 @@ public class WorldManager {
public WorldManager(SkyBlock plugin) {
this.plugin = plugin;
loadWorlds();
}
public void loadWorlds() {