Package ml.karmaconfigs.api.bungee
Class KarmaPlugin
java.lang.Object
net.md_5.bungee.api.plugin.Plugin
ml.karmaconfigs.api.bungee.KarmaPlugin
- All Implemented Interfaces:
Serializable,KarmaSource
Karma plugin for BungeeCord, to make easier for plugin developers to implement
the KarmaAPI in their BungeeCord plugins
- 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<net.md_5.bungee.api.connection.ProxiedPlayer,T> onRequest)Create a player placeholderstatic Placeholder<Double>createDoublePlaceholder(String key, BiConsumer<net.md_5.bungee.api.connection.ProxiedPlayer,Double> onRequest)Create a player placeholderstatic Placeholder<Float>createFloatPlaceholder(String key, BiConsumer<net.md_5.bungee.api.connection.ProxiedPlayer,Float> onRequest)Create a player placeholderstatic Placeholder<Integer>createIntegerPlaceholder(String key, BiConsumer<net.md_5.bungee.api.connection.ProxiedPlayer,Integer> onRequest)Create a player placeholderstatic Placeholder<String>createTextPlaceholder(String key, BiConsumer<net.md_5.bungee.api.connection.ProxiedPlayer,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 net.md_5.bungee.api.plugin.Plugin
getDataFolder, getDescription, getExecutorService, getFile, getLogger, getProxy, getResourceAsStream, onDisable, onLoadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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- Overrides:
onEnablein classnet.md_5.bungee.api.plugin.Plugin
-
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<net.md_5.bungee.api.connection.ProxiedPlayer,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<net.md_5.bungee.api.connection.ProxiedPlayer,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<net.md_5.bungee.api.connection.ProxiedPlayer,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<net.md_5.bungee.api.connection.ProxiedPlayer,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<net.md_5.bungee.api.connection.ProxiedPlayer,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
-