mirror of
https://github.com/songoda/SongodaCore.git
synced 2025-01-26 17:21:26 +01:00
Added the required ability to load data separately.
This commit is contained in:
parent
17034afb94
commit
28b2d99b04
@ -21,6 +21,7 @@ public abstract class SongodaPlugin extends JavaPlugin {
|
||||
|
||||
protected Locale locale;
|
||||
protected Config config = new Config(this);
|
||||
protected long dataLoadDelay = 20L;
|
||||
|
||||
protected ConsoleCommandSender console = Bukkit.getConsoleSender();
|
||||
private boolean emergencyStop = false;
|
||||
@ -31,6 +32,8 @@ public abstract class SongodaPlugin extends JavaPlugin {
|
||||
|
||||
public abstract void onPluginDisable();
|
||||
|
||||
public abstract void onDataLoad();
|
||||
|
||||
/**
|
||||
* Called after reloadConfig() is called
|
||||
*/
|
||||
@ -95,6 +98,8 @@ public abstract class SongodaPlugin extends JavaPlugin {
|
||||
locale = Locale.loadDefaultLocale(this, "en_US");
|
||||
// plugin setup
|
||||
onPluginEnable();
|
||||
// Load Data.
|
||||
Bukkit.getScheduler().runTaskLater(this, this::onDataLoad, dataLoadDelay);
|
||||
if(emergencyStop) {
|
||||
console.sendMessage(ChatColor.RED + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
|
||||
console.sendMessage(" ");
|
||||
|
Loading…
Reference in New Issue
Block a user