mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-08 09:27:38 +01:00
Adds GameModeAddon method that is called when BentoBox loads all addons.
Required to fix https://github.com/BentoBoxWorld/BentoBox/issues/940
This commit is contained in:
parent
5164b1a02d
commit
deb21e7ed6
@ -215,15 +215,17 @@ public class BentoBox extends JavaPlugin {
|
||||
TextVariables.VERSION, instance.getDescription().getVersion(),
|
||||
"[time]", String.valueOf(loadTime + enableTime));
|
||||
|
||||
// Fire plugin ready event - this should go last after everything else
|
||||
// Tell all addons that everything is loaded
|
||||
isLoaded = true;
|
||||
this.addonsManager.allLoaded();
|
||||
// Fire plugin ready event - this should go last after everything else
|
||||
Bukkit.getServer().getPluginManager().callEvent(new BentoBoxReadyEvent());
|
||||
|
||||
if (getSettings().getDatabaseType().equals(DatabaseSetup.DatabaseType.YAML)) {
|
||||
logWarning("*** You're still using YAML database ! ***");
|
||||
logWarning("This database type is being deprecated from BentoBox as some official addons encountered difficulties supporting it correctly.");
|
||||
logWarning("You should switch ASAP to an alternative database type. Please refer to the comments in BentoBox's config.yml.");
|
||||
logWarning("There is NO warranty YAML database will remain properly supported in the following updates, and its usage should as such be considered a non-viable situation.");
|
||||
logWarning("There is NO guarantee YAML database will remain properly supported in the following updates, and its usage should as such be considered a non-viable situation.");
|
||||
logWarning("*** *** *** *** *** *** *** *** *** *** ***");
|
||||
}
|
||||
});
|
||||
|
@ -418,4 +418,10 @@ public abstract class Addon {
|
||||
public boolean registerFlag(Flag flag) {
|
||||
return getPlugin().getFlagsManager().registerFlag(this, flag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when all addons have been loaded by BentoBox
|
||||
* @since 1.8.0
|
||||
*/
|
||||
public void allLoaded() {}
|
||||
}
|
||||
|
@ -293,7 +293,7 @@ public class User {
|
||||
public int getPermissionValue(String permissionPrefix, int defaultValue) {
|
||||
// If requester is console, then return the default value
|
||||
if (!isPlayer()) return defaultValue;
|
||||
|
||||
|
||||
int value = defaultValue;
|
||||
|
||||
// If there is a dot at the end of the permissionPrefix, remove it
|
||||
|
@ -445,4 +445,12 @@ public class AddonsManager {
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Notifies all addons that BentoBox has loaded all addons
|
||||
* @since 1.8.0
|
||||
*/
|
||||
public void allLoaded() {
|
||||
addons.forEach(Addon::allLoaded);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user