Fix Exception when calling #emergencyStop inside onPluginEnable

This commit is contained in:
Christian Koop 2022-06-26 13:34:14 +02:00
parent 73685b62dd
commit ed7b454625
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
1 changed files with 6 additions and 2 deletions

View File

@ -48,7 +48,7 @@ public abstract class SongodaPlugin extends JavaPlugin {
* <br>
* Do not include language files if you are using the Core's localization system.
*/
public abstract List<SongodaYamlConfig> getConfigs();
public abstract @NotNull List<SongodaYamlConfig> getConfigs();
@Override
public final void onLoad() {
@ -82,6 +82,10 @@ public abstract class SongodaPlugin extends JavaPlugin {
// plugin setup
onPluginEnable();
if (this.emergencyStop) {
return;
}
// Load Data.
Bukkit.getScheduler().runTaskLater(this, this::onDataLoad, this.dataLoadDelay);
@ -205,7 +209,7 @@ public abstract class SongodaPlugin extends JavaPlugin {
protected void criticalErrorOnPluginStartup(Throwable th) {
Bukkit.getLogger().log(Level.SEVERE,
String.format(
"Unexpected error while loading %s v%s c%s: Disabling plugin!",
"Unexpected error while loading %s v%s (core v%s): Disabling plugin!",
getDescription().getName(),
getDescription().getVersion(),
SongodaCore.getCoreLibraryVersion()