mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-24 03:35:11 +01:00
Made the loading time much more accurate
This commit is contained in:
parent
c60e790749
commit
7a39e04a85
@ -97,7 +97,7 @@ public class BentoBox extends JavaPlugin {
|
|||||||
// Not loaded
|
// Not loaded
|
||||||
isLoaded = false;
|
isLoaded = false;
|
||||||
// Store the current millis time so we can tell how many ms it took for BSB to fully load.
|
// Store the current millis time so we can tell how many ms it took for BSB to fully load.
|
||||||
final long startMillis = System.currentTimeMillis();
|
final long loadStart = System.currentTimeMillis();
|
||||||
|
|
||||||
// Save the default config from config.yml
|
// Save the default config from config.yml
|
||||||
saveDefaultConfig();
|
saveDefaultConfig();
|
||||||
@ -150,7 +150,10 @@ public class BentoBox extends JavaPlugin {
|
|||||||
addonsManager = new AddonsManager(this);
|
addonsManager = new AddonsManager(this);
|
||||||
addonsManager.loadAddons();
|
addonsManager.loadAddons();
|
||||||
|
|
||||||
|
final long loadTime = System.currentTimeMillis() - loadStart;
|
||||||
|
|
||||||
getServer().getScheduler().runTask(instance, () -> {
|
getServer().getScheduler().runTask(instance, () -> {
|
||||||
|
final long enableStart = System.currentTimeMillis();
|
||||||
hooksManager.registerHook(new PlaceholderAPIHook());
|
hooksManager.registerHook(new PlaceholderAPIHook());
|
||||||
// Setup the Placeholders manager
|
// Setup the Placeholders manager
|
||||||
placeholdersManager = new PlaceholdersManager(this);
|
placeholdersManager = new PlaceholdersManager(this);
|
||||||
@ -192,10 +195,12 @@ public class BentoBox extends JavaPlugin {
|
|||||||
|
|
||||||
webManager = new WebManager(this);
|
webManager = new WebManager(this);
|
||||||
|
|
||||||
|
final long enableTime = System.currentTimeMillis() - enableStart;
|
||||||
|
|
||||||
// Show banner
|
// Show banner
|
||||||
User.getInstance(Bukkit.getConsoleSender()).sendMessage("successfully-loaded",
|
User.getInstance(Bukkit.getConsoleSender()).sendMessage("successfully-loaded",
|
||||||
TextVariables.VERSION, instance.getDescription().getVersion(),
|
TextVariables.VERSION, instance.getDescription().getVersion(),
|
||||||
"[time]", String.valueOf(System.currentTimeMillis() - startMillis));
|
"[time]", String.valueOf(loadTime + enableTime));
|
||||||
|
|
||||||
// Fire plugin ready event - this should go last after everything else
|
// Fire plugin ready event - this should go last after everything else
|
||||||
isLoaded = true;
|
isLoaded = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user