Class UpgradeTriggerHandler
java.lang.Object
de.marcely.bedwars.api.game.upgrade.UpgradeTriggerHandler
Represents the logical handler of a upgrade trigger.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the description of this handler in the default language.getDescriptionLines
(CommandSender sender) Returns the description of this handler.getId()
Returns the id of this handlergetName()
Returns the name of this handler in the default language.getName
(CommandSender sender) Returns the name of this handler.Returns the plugin that's in charge of this handlergetType()
Returns the type of this handler.final boolean
Returns whether this handler is registered.boolean
isTrap()
Returns weather or not this is a trap handler.abstract void
Handles the execution of the upgrade.
-
Constructor Details
-
UpgradeTriggerHandler
- 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
Returns the plugin that's in charge of this handler- Returns:
- The plugin that created this handler
-
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
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
Returns the name of this handler.This name may be used in the upgrade shop lore
- Returns:
- The name of the handler
-
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
Returns the description of this handler.This description may be used in the upgrade shop lore
- Returns:
- The description lines for this handler
-
getType
Returns the type of this handler. Custom ones should returnUpgradeTriggerHandlerType.PLUGIN
.- Returns:
- The type of this handler
-
onTrigger
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, orGameAPI.unregisterUpgradeTriggerHandler(UpgradeTriggerHandler)
to unregister it.- Returns:
true
if it's registered
-