mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-27 13:15:28 +01:00
Added Addon#registerFlag(...) method (#697)
* Add registerFlag method in Addon class that allows to register a new Flag just from Addon class. This was missing, as request handlers and listeners already has faster methods. * Update src/main/java/world/bentobox/bentobox/api/addons/Addon.java Co-Authored-By: Florian CUNY <poslovitch@bentobox.world> * Update src/main/java/world/bentobox/bentobox/api/addons/Addon.java Co-Authored-By: Florian CUNY <poslovitch@bentobox.world> * Use #getPlugin() instead of the getInstance
This commit is contained in:
parent
deee242b90
commit
f2877da896
@ -7,6 +7,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.event.Listener;
|
||||
import world.bentobox.bentobox.BentoBox;
|
||||
import world.bentobox.bentobox.api.addons.request.AddonRequestHandler;
|
||||
import world.bentobox.bentobox.api.flags.Flag;
|
||||
import world.bentobox.bentobox.managers.IslandsManager;
|
||||
import world.bentobox.bentobox.managers.PlayersManager;
|
||||
|
||||
@ -401,4 +402,15 @@ public abstract class Addon {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register a flag for this addon.
|
||||
* @param flag the flag to register.
|
||||
* @return {@code true} if the flag was registered successfully, {@code false} otherwise.
|
||||
* @since 1.5.0
|
||||
*/
|
||||
public boolean registerFlag(Flag flag) {
|
||||
return getPlugin().getFlagsManager().registerFlag(this, flag);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user