Class DimensionsAddon
java.lang.Object
me.xxastaspastaxx.dimensions.addons.DimensionsAddon
The abstract class that is parent to all the addons that are being loaded by Dimensions
-
Constructor Summary
ConstructorDescriptionDimensionsAddon(String addonName, String addonVersion, String addonDescription, DimensionsAddonPriority addonPriority)
Constructor of DimensionsAddon -
Method Summary
Modifier and TypeMethodDescriptionGet the priority of the addonGet the description of the addongetName()
Get the name of the addonstatic Object
getOption(CompletePortal complete, String key)
Get the option for the portal.static Object
getOption(CustomPortal portal, String key)
Get the option for the type of the portal for the given keyGet the version of the addonvoid
Run when disabling the addonvoid
onEnable(Dimensions pl)
Run when the addon is being enabledboolean
onLoad(Dimensions pl)
Run when loading the addonvoid
registerPortal(org.bukkit.configuration.file.YamlConfiguration portalConfig, CustomPortal portal)
This function provides the portal config file for each portal that is being loaded and addons can get data from it.static void
This runs when we reload the plugin AFTER all the addons have been disabled in order to reset all the datastatic void
setOption(CompletePortal complete, String key, Object value)
Store an Object with a String key for this specific portalstatic void
setOption(CustomPortal portal, String key, Object value)
Store an Object with a String key for all portals that are the given CustomPortal
-
Constructor Details
-
DimensionsAddon
public DimensionsAddon(String addonName, String addonVersion, String addonDescription, DimensionsAddonPriority addonPriority)Constructor of DimensionsAddon- Parameters:
addonName
- The name of the addonaddonVersion
- The version of the addonaddonDescription
- A short description of the addonaddonPriority
- Priority to enable the addon
-
-
Method Details
-
getName
Get the name of the addon- Returns:
- the name of the addon
-
getVersion
Get the version of the addon- Returns:
- the version of the addon
-
getDescription
Get the description of the addon- Returns:
- the description of the addon
-
getAddonPriority
Get the priority of the addon- Returns:
- the priority of the addon
-
setOption
Store an Object with a String key for all portals that are the given CustomPortal- Parameters:
portal
- the CustomPortal that contains the optionkey
- the key to store and access the valuevalue
- the value to be stored
-
setOption
Store an Object with a String key for this specific portal- Parameters:
complete
- the portal that contains the optionkey
- the key to store and access the valuevalue
- the value to be stored
-
getOption
Get the option for the portal. If the portal does not contain the key, then we check the type of the portal for the given key- Parameters:
complete
- the portal to get the option forkey
- the key to access the value- Returns:
-
getOption
Get the option for the type of the portal for the given key- Parameters:
CustomPortal
- to get the option forkey
- the key to access the value- Returns:
-
onLoad
Run when loading the addon- Parameters:
pl
- the instance of the Dimensions plugin- Returns:
- true if the addon was loaded without any missing dependencies
-
onEnable
Run when the addon is being enabled- Parameters:
pl
- the instance of the Dimensions plugin
-
onDisable
public void onDisable()Run when disabling the addon -
registerPortal
public void registerPortal(org.bukkit.configuration.file.YamlConfiguration portalConfig, CustomPortal portal)This function provides the portal config file for each portal that is being loaded and addons can get data from it.- Parameters:
portalConfig
- the YamlConfiguration for the portal loadingportal
- the portal loading
-
resetOptions
public static void resetOptions()This runs when we reload the plugin AFTER all the addons have been disabled in order to reset all the data
-