Package ml.karmaconfigs.api.bukkit
Class KarmaPlugin
java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
ml.karmaconfigs.api.bukkit.KarmaPlugin
- All Implemented Interfaces:
Serializable,KarmaSource,org.bukkit.command.CommandExecutor,org.bukkit.command.TabCompleter,org.bukkit.command.TabExecutor,org.bukkit.plugin.Plugin
Karma plugin
- See Also:
- Serialized Form
-
Constructor Summary
ConstructorsConstructorDescriptionInitialize the KarmaPluginKarmaPlugin(boolean defineDefault)Initialize the KarmaPlugin -
Method Summary
Modifier and TypeMethodDescriptionasync()Get the source async schedulerconsole()Get the source outstatic <T> Placeholder<T>createAnyPlaceholder(String key, BiConsumer<org.bukkit.entity.Player,T> onRequest)Create a player placeholderstatic Placeholder<Double>createDoublePlaceholder(String key, BiConsumer<org.bukkit.entity.Player,Double> onRequest)Create a player placeholderstatic Placeholder<Float>createFloatPlaceholder(String key, BiConsumer<org.bukkit.entity.Player,Float> onRequest)Create a player placeholderstatic Placeholder<Integer>createIntegerPlaceholder(String key, BiConsumer<org.bukkit.entity.Player,Integer> onRequest)Create a player placeholderstatic Placeholder<String>createTextPlaceholder(String key, BiConsumer<org.bukkit.entity.Player,String> onRequest)Create a player placeholderabstract voidenable()Enable the KarmaPluginvoidonEnable()On plugin enablestatic voidregisterPlayerPlaceholder(Placeholder<?>... placeholders)Register globally a player placeholdersync()Get the source sync schedulerMethods inherited from class org.bukkit.plugin.java.JavaPlugin
getClassLoader, getCommand, getConfig, getDataFolder, getDefaultBiomeProvider, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, isEnabled, isNaggable, onCommand, onDisable, onLoad, onTabComplete, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toStringMethods inherited from class org.bukkit.plugin.PluginBase
equals, getName, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ml.karmaconfigs.api.common.karma.KarmaSource
authors, authors, description, getDataPath, getSourceFile, isSource, name, srcEquals, stopTasks, updateURL, version
-
Constructor Details
-
KarmaPlugin
public KarmaPlugin()Initialize the KarmaPlugin -
KarmaPlugin
Initialize the KarmaPlugin- Parameters:
defineDefault- if this source should be defined as the default source- Throws:
SecurityException- if the default module is already set
-
-
Method Details
-
enable
public abstract void enable()Enable the KarmaPlugin -
onEnable
public final void onEnable()On plugin enable- Specified by:
onEnablein interfaceorg.bukkit.plugin.Plugin- Overrides:
onEnablein classorg.bukkit.plugin.java.JavaPlugin
-
async
Get the source async scheduler- Specified by:
asyncin interfaceKarmaSource- Returns:
- the source async scheduler
-
sync
Get the source sync scheduler- Specified by:
syncin interfaceKarmaSource- Returns:
- the source sync scheduler
-
console
Get the source out- Specified by:
consolein interfaceKarmaSource- Returns:
- the source out
-
createTextPlaceholder
public static Placeholder<String> createTextPlaceholder(String key, BiConsumer<org.bukkit.entity.Player,String> onRequest)Create a player placeholder- Parameters:
key- the placeholder keyonRequest- on placeholder request- Returns:
- the placeholder
-
createIntegerPlaceholder
public static Placeholder<Integer> createIntegerPlaceholder(String key, BiConsumer<org.bukkit.entity.Player,Integer> onRequest)Create a player placeholder- Parameters:
key- the placeholder keyonRequest- on placeholder request- Returns:
- the placeholder
-
createDoublePlaceholder
public static Placeholder<Double> createDoublePlaceholder(String key, BiConsumer<org.bukkit.entity.Player,Double> onRequest)Create a player placeholder- Parameters:
key- the placeholder keyonRequest- on placeholder request- Returns:
- the placeholder
-
createFloatPlaceholder
public static Placeholder<Float> createFloatPlaceholder(String key, BiConsumer<org.bukkit.entity.Player,Float> onRequest)Create a player placeholder- Parameters:
key- the placeholder keyonRequest- on placeholder request- Returns:
- the placeholder
-
createAnyPlaceholder
public static <T> Placeholder<T> createAnyPlaceholder(String key, BiConsumer<org.bukkit.entity.Player,T> onRequest)Create a player placeholder- Type Parameters:
T- the placeholder type- Parameters:
key- the placeholder keyonRequest- on placeholder request- Returns:
- the placeholder
-
registerPlayerPlaceholder
Register globally a player placeholder- Parameters:
placeholders- the player placeholder
-