Class AdditionsAPI

java.lang.Object
net.gcnt.additionsplus.api.AdditionsAPI

public class AdditionsAPI extends Object
Official API class for the AdditionsPlus plugin. This class contains all methods that can be used to access different aspects of the plugin. Use this class to execute methods from instead of accessing subclasses directly.
Since:
2.4.0
  • Constructor Details

    • AdditionsAPI

      public AdditionsAPI(AdditionsPlus plugin)
      Create a new instance of the AdditionsAPI. Do not use this to get the API as it will not have all the data you're looking for. Use AdditionsPlus.getAPI() instead.
  • Method Details

    • getPlugin

      public AdditionsPlus getPlugin()
    • performActions

      public void performActions(ActionSender sender, List<String> actions)
      Perform a list of action strings for a sender.
      Parameters:
      sender - User to execute the actions for.
      actions - List of String actions to be executed for the player.
    • registerCustomEvent

      public void registerCustomEvent(AdditionsEvent event)
    • registerCustomAction

      public boolean registerCustomAction(CustomAction customAction)
      Register a custom action which will be usable in every EventActions call on the server.
      Parameters:
      customAction - CustomAction instance that contains all information about the custom action.
      Returns:
      Boolean whether the action has been registered.
    • getCustomActions

      public List<CustomAction> getCustomActions()
      Get a list of registered custom actions.
      Returns:
      List of CustomAction that contains all registered custom actions.
    • isCustomActionRegistered

      public boolean isCustomActionRegistered(String identifier)
      Check if a specific action has been registered
      Parameters:
      identifier - Custom action identifier without []
      Returns:
      Boolean Whether it is registered or not
    • getUtils

      public Utils getUtils()
      Get the Additions utils class
      Returns:
      Utils class
    • getCommands

      public List<CustomCommand> getCommands()
      Get a list of CustomCommand
      Returns:
      List of CustomCommand
    • getCommandByName

      public CustomCommand getCommandByName(String name)
      Parameters:
      name - Name of the custom command
      Returns:
      CustomCommand if found, null when invalid.
    • getCommandByAlias

      public CustomCommand getCommandByAlias(String alias)
      Parameters:
      alias - Alias of the custom command
      Returns:
      CustomCommand if found, null when invalid.
    • getCustomItems

      public List<CustomItem> getCustomItems()
      Get a list of CustomItem
      Returns:
      List of CustomItem
    • getConfig

      public Config getConfig()
      Get the AdditionsPlus Config
      Returns:
      Config.
    • getAdditionsEvents

      public List<AdditionsEvent> getAdditionsEvents()
      Get a list of registered AdditionsPlus events.
      Returns:
      List of AdditionsEvent.
    • getAdditionsEventByName

      public AdditionsEvent getAdditionsEventByName(String name)
      Get an AdditionsEvent from its identifier.
      Parameters:
      name - Identifier of the AdditionsEvent.
      Returns:
      AdditionsEvent when found, null if invalid.
    • getIntervalActions

      public List<IntervalAction> getIntervalActions()
      Get a list of loaded IntervalActions.
      Returns:
      List of IntervalAction.
    • getIntervalActionByName

      public IntervalAction getIntervalActionByName(String name)
      Get an IntervalAction from its identifier.
      Parameters:
      name - Identifier of the IntervalAction.
      Returns:
      IntervalAction when found, null if invalid.
    • getBooks

      public List<Book> getBooks()
      Get a list of Book
      Returns:
      List of Book
    • getBookByName

      public Book getBookByName(String name)
      Get a Book
      Parameters:
      name - Name of the custom book
      Returns:
      Book if found, null when invalid.
    • getSigns

      public List<CustomSign> getSigns()
      Returns a list of custom signs
      Returns:
      List of Book>
    • getSignByName

      public CustomSign getSignByName(String name)
      Get a CustomSign from its identifier.
      Parameters:
      name - Identifier of the sign.
      Returns:
      CustomSign if found, null when invalid.
    • getSignByLocation

      public CustomSign getSignByLocation(org.bukkit.Location loc)
      Get a CustomSign from its location.
      Parameters:
      loc - Location of the sign.
      Returns:
      CustomSign if found, null when invalid.
    • getNMS

      public NMS getNMS()
      Get the Additions NMS class for handling version-based things.
      Returns:
      NMS class matching the server version.
    • getItems

      public List<CustomItem> getItems()
      Get a list of CustomItem
      Returns:
      List of CustomItem
    • getItemByName

      public CustomItem getItemByName(String name)
      Parameters:
      name - Name of the custom item
      Returns:
      CustomItem if found, null when invalid.
    • getMenus

      public List<Menu> getMenus()
      Get a list of custom Menu.
      Returns:
      List of Menu
    • getMenuByName

      public Menu getMenuByName(String name)
      Get a custom Menu by name
      Parameters:
      name - Name of the custom menu
      Returns:
      Menu if found, null when invalid.
    • getNameTagGroups

      public List<String> getNameTagGroups()
      Get a list of NameTag group identifiers.
      Returns:
      List of String with nametag groups.
    • getNameTag

      public NameTagsFile getNameTag(String group)
      Get a NameTag group.
      Parameters:
      group - NameTag group name
      Returns:
      NameTagsFile group info
    • getPlayersFile

      public PlayersFile getPlayersFile(org.bukkit.entity.Player p)
      Get player info stored by the plugin
      Parameters:
      p - Player to get the info from
      Returns:
      PlayerFile with player info
    • getCommandEvent

      public net.gcnt.additionsplus.events.CommandEvent getCommandEvent()
    • getFilesAPI

      public AdditionsAPI.AdditionsFileAPI getFilesAPI()
    • getSortedTablist

      public org.bukkit.scoreboard.Scoreboard getSortedTablist()