Package net.gcnt.additionsplus.api
Class AdditionsAPI
java.lang.Object
net.gcnt.additionsplus.api.AdditionsAPI
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
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionAdditionsAPI(AdditionsPlus plugin)
Create a new instance of the AdditionsAPI. -
Method Summary
Modifier and TypeMethodDescriptiongetAdditionsEventByName(String name)
Get anAdditionsEvent
from its identifier.Get a list of registered AdditionsPlus events.getBookByName(String name)
Get aBook
getBooks()
Get a list ofBook
getCommandByAlias(String alias)
Get aCustomCommand
getCommandByName(String name)
Get aCustomCommand
net.gcnt.additionsplus.events.CommandEvent
Get a list ofCustomCommand
Get the AdditionsPlusConfig
Get a list of registered custom actions.Get a list ofCustomItem
getIntervalActionByName(String name)
Get anIntervalAction
from its identifier.Get a list of loaded IntervalActions.getItemByName(String name)
Get aCustomItem
getItems()
Get a list ofCustomItem
getMenuByName(String name)
Get a customMenu
by namegetMenus()
Get a list of customMenu
.getNameTag(String group)
Get a NameTag group.Get a list of NameTag group identifiers.getNMS()
Get the AdditionsNMS
class for handling version-based things.getPlayersFile(org.bukkit.entity.Player p)
Get player info stored by the plugingetSignByLocation(org.bukkit.Location loc)
Get aCustomSign
from its location.getSignByName(String name)
Get aCustomSign
from its identifier.getSigns()
Returns a list of custom signsorg.bukkit.scoreboard.Scoreboard
getUtils()
Get the Additions utils classboolean
isCustomActionRegistered(String identifier)
Check if a specific action has been registeredvoid
performActions(ActionSender sender, List<String> actions)
Perform a list of action strings for a sender.boolean
registerCustomAction(CustomAction customAction)
Register a custom action which will be usable in every EventActions call on the server.void
registerCustomEvent(AdditionsEvent event)
-
Constructor Details
-
AdditionsAPI
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. UseAdditionsPlus.getAPI()
instead.
-
-
Method Details
-
getPlugin
-
performActions
Perform a list of action strings for a sender.- Parameters:
sender
- User to execute the actions for.actions
- List ofString
actions to be executed for the player.
-
registerCustomEvent
-
registerCustomAction
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
Get a list of registered custom actions.- Returns:
- List of
CustomAction
that contains all registered custom actions.
-
isCustomActionRegistered
Check if a specific action has been registered- Parameters:
identifier
- Custom action identifier without []- Returns:
Boolean
Whether it is registered or not
-
getUtils
Get the Additions utils class- Returns:
Utils
class
-
getCommands
Get a list ofCustomCommand
- Returns:
- List of
CustomCommand
-
getCommandByName
Get aCustomCommand
- Parameters:
name
- Name of the custom command- Returns:
CustomCommand
if found, null when invalid.
-
getCommandByAlias
Get aCustomCommand
- Parameters:
alias
- Alias of the custom command- Returns:
CustomCommand
if found, null when invalid.
-
getCustomItems
Get a list ofCustomItem
- Returns:
- List of
CustomItem
-
getConfig
Get the AdditionsPlusConfig
- Returns:
Config
.
-
getAdditionsEvents
Get a list of registered AdditionsPlus events.- Returns:
- List of
AdditionsEvent
.
-
getAdditionsEventByName
Get anAdditionsEvent
from its identifier.- Parameters:
name
- Identifier of the AdditionsEvent.- Returns:
AdditionsEvent
when found, null if invalid.
-
getIntervalActions
Get a list of loaded IntervalActions.- Returns:
- List of
IntervalAction
.
-
getIntervalActionByName
Get anIntervalAction
from its identifier.- Parameters:
name
- Identifier of the IntervalAction.- Returns:
IntervalAction
when found, null if invalid.
-
getBooks
Get a list ofBook
- Returns:
- List of
Book
-
getBookByName
Get aBook
- Parameters:
name
- Name of the custom book- Returns:
Book
if found, null when invalid.
-
getSigns
Returns a list of custom signs- Returns:
- List of
Book
>
-
getSignByName
Get aCustomSign
from its identifier.- Parameters:
name
- Identifier of the sign.- Returns:
CustomSign
if found, null when invalid.
-
getSignByLocation
Get aCustomSign
from its location.- Parameters:
loc
- Location of the sign.- Returns:
CustomSign
if found, null when invalid.
-
getNMS
Get the AdditionsNMS
class for handling version-based things.- Returns:
NMS
class matching the server version.
-
getItems
Get a list ofCustomItem
- Returns:
- List of
CustomItem
-
getItemByName
Get aCustomItem
- Parameters:
name
- Name of the custom item- Returns:
CustomItem
if found, null when invalid.
-
getMenus
Get a list of customMenu
.- Returns:
- List of
Menu
-
getMenuByName
Get a customMenu
by name- Parameters:
name
- Name of the custom menu- Returns:
Menu
if found, null when invalid.
-
getNameTagGroups
Get a list of NameTag group identifiers.- Returns:
- List of
String
with nametag groups.
-
getNameTag
Get a NameTag group.- Parameters:
group
- NameTag group name- Returns:
NameTagsFile
group info
-
getPlayersFile
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
-
getSortedTablist
public org.bukkit.scoreboard.Scoreboard getSortedTablist()
-