Class KarmaPlugin

java.lang.Object
net.md_5.bungee.api.plugin.Plugin
ml.karmaconfigs.api.bungee.KarmaPlugin
All Implemented Interfaces:
Serializable, KarmaSource

public abstract class KarmaPlugin extends net.md_5.bungee.api.plugin.Plugin implements KarmaSource
Karma plugin for BungeeCord, to make easier for plugin developers to implement the KarmaAPI in their BungeeCord plugins
See Also:
Serialized Form
  • Constructor Details

    • KarmaPlugin

      public KarmaPlugin()
      Initialize the KarmaPlugin
    • KarmaPlugin

      public KarmaPlugin(boolean defineDefault) throws SecurityException
      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:
      onEnable in class net.md_5.bungee.api.plugin.Plugin
    • async

      public Scheduler async()
      Get the source async scheduler
      Specified by:
      async in interface KarmaSource
      Returns:
      the source async scheduler
    • sync

      public Scheduler sync()
      Get the source sync scheduler
      Specified by:
      sync in interface KarmaSource
      Returns:
      the source sync scheduler
    • console

      public Console console()
      Get the source out
      Specified by:
      console in interface KarmaSource
      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 key
      onRequest - 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 key
      onRequest - 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 key
      onRequest - 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 key
      onRequest - 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 key
      onRequest - on placeholder request
      Returns:
      the placeholder
    • registerPlayerPlaceholder

      public static void registerPlayerPlaceholder(Placeholder<?>... placeholders)
      Register globally a player placeholder
      Parameters:
      placeholders - the player placeholder