Class UpgradeTriggerHandler

java.lang.Object
de.marcely.bedwars.api.game.upgrade.UpgradeTriggerHandler

public abstract class UpgradeTriggerHandler extends Object
Represents the logical handler of a upgrade trigger.
  • Constructor Details

    • UpgradeTriggerHandler

      public UpgradeTriggerHandler(String id, boolean isTrap, Plugin plugin)
      Parameters:
      id - The id of this handler, should be unique to others. Default ones start with bedwars:
      plugin - The plugin that constructs this handler
  • Method Details

    • getPlugin

      public Plugin getPlugin()
      Returns the plugin that's in charge of this handler
      Returns:
      The plugin that created this handler
    • getId

      public String getId()
      Returns the id of this handler
      Returns:
      The id of this handler
    • isTrap

      public boolean isTrap()
      Returns weather or not this is a trap handler. If this is a trap handler the handler will be put into a queue, and will be executed when a base is invaded.
      Returns:
      Is this handler is a trap handler
    • getName

      public String getName()
      Returns the name of this handler in the default language.

      This name may be used in the upgrade shop lore

      Returns:
      The generic name of this handler
    • getName

      public String getName(CommandSender sender)
      Returns the name of this handler.

      This name may be used in the upgrade shop lore

      Returns:
      The name of the handler
    • getDescriptionLines

      public List<String> getDescriptionLines()
      Returns the description of this handler in the default language.

      This description may be used in the upgrade shop lore

      Returns:
      The generic description lines
    • getDescriptionLines

      public List<String> getDescriptionLines(CommandSender sender)
      Returns the description of this handler.

      This description may be used in the upgrade shop lore

      Returns:
      The description lines for this handler
    • getType

      public UpgradeTriggerHandlerType getType()
      Returns the type of this handler. Custom ones should return UpgradeTriggerHandlerType.PLUGIN.
      Returns:
      The type of this handler
    • onTrigger

      public abstract void onTrigger(PlayerTriggerUpgradeEvent event)
      Handles the execution of the upgrade.
      Parameters:
      event - The information needed to handle the event
    • isRegistered

      public final boolean isRegistered()
      Returns whether this handler is registered.

      Use GameAPI.registerUpgradeTriggerHandler(UpgradeTriggerHandler) to register it, or GameAPI.unregisterUpgradeTriggerHandler(UpgradeTriggerHandler) to unregister it.

      Returns:
      true if it's registered