mirror of
https://github.com/songoda/SongodaCore.git
synced 2025-01-27 09:41:22 +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 Locale locale;
|
||||||
protected Config config = new Config(this);
|
protected Config config = new Config(this);
|
||||||
|
protected long dataLoadDelay = 20L;
|
||||||
|
|
||||||
protected ConsoleCommandSender console = Bukkit.getConsoleSender();
|
protected ConsoleCommandSender console = Bukkit.getConsoleSender();
|
||||||
private boolean emergencyStop = false;
|
private boolean emergencyStop = false;
|
||||||
@ -31,6 +32,8 @@ public abstract class SongodaPlugin extends JavaPlugin {
|
|||||||
|
|
||||||
public abstract void onPluginDisable();
|
public abstract void onPluginDisable();
|
||||||
|
|
||||||
|
public abstract void onDataLoad();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called after reloadConfig() is called
|
* Called after reloadConfig() is called
|
||||||
*/
|
*/
|
||||||
@ -95,6 +98,8 @@ public abstract class SongodaPlugin extends JavaPlugin {
|
|||||||
locale = Locale.loadDefaultLocale(this, "en_US");
|
locale = Locale.loadDefaultLocale(this, "en_US");
|
||||||
// plugin setup
|
// plugin setup
|
||||||
onPluginEnable();
|
onPluginEnable();
|
||||||
|
// Load Data.
|
||||||
|
Bukkit.getScheduler().runTaskLater(this, this::onDataLoad, dataLoadDelay);
|
||||||
if(emergencyStop) {
|
if(emergencyStop) {
|
||||||
console.sendMessage(ChatColor.RED + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
|
console.sendMessage(ChatColor.RED + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
|
||||||
console.sendMessage(" ");
|
console.sendMessage(" ");
|
||||||
|
Loading…
Reference in New Issue
Block a user