Class ExpansionRegistry
java.lang.Object
com.olziedev.playertrade.api.expansion.ExpansionRegistry
Handles and manages all expansions for the plugin.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract <T extends PluginExpansion>
voidexecuteExpansionAction
(Class<T> clazz, Consumer<? super T> action) Execute a consumer action on the specified implementation.abstract <T extends PluginExpansion>
TgetExpansion
(Class<T> clazz) Retrieve an expansion based on the class specified.abstract PluginExpansion
getExpansion
(String name) Retrieve an expansion based on the name specified.Retrieve a list of all the expansions.abstract <T extends PluginExpansion>
List<T> getExpansions
(Class<T> clazz) Retrieve a list of all the expansions based on the implementation specified.abstract <T extends PluginExpansion>
Stream<T> getExpansionStream
(Class<T> clazz) Retrieve a stream of all the expansions based on the implementation specified.abstract net.milkbowl.vault.chat.Chat
Retrieve the integrated permission provider in this registry from Vault.abstract net.milkbowl.vault.economy.Economy
Retrieve the integrated permission provider in this registry from Vault.abstract net.milkbowl.vault.permission.Permission
Retrieve the integrated permission provider in this registry from Vault.abstract void
innitPlaceholders
(PluginExpansion pluginExpansion) Initialize the placeholders for the pluginExpansion.abstract boolean
noPlaceholderAPICondition
(ConfigurationSection section, Function<String, String> function, OfflinePlayer player) abstract void
registerExpansion
(PluginExpansion pluginExpansion) Register an pluginExpansion to the registry.abstract void
Reload all the expansions from the registry.abstract void
Unregisters all the loaded expansions from the registry.abstract void
unregisterExpansion
(String name) Unregister an expansion from the registry.
-
Constructor Details
-
ExpansionRegistry
public ExpansionRegistry()
-
-
Method Details
-
registerExpansion
Register an pluginExpansion to the registry.- Parameters:
pluginExpansion
- The pluginExpansion instance.
-
innitPlaceholders
Initialize the placeholders for the pluginExpansion.- Parameters:
pluginExpansion
- The pluginExpansion instance.
-
executeExpansionAction
public abstract <T extends PluginExpansion> void executeExpansionAction(Class<T> clazz, Consumer<? super T> action) Execute a consumer action on the specified implementation.- Type Parameters:
T
- The expansion implementation.- Parameters:
clazz
- The expansion implementation to execute the action for.action
- Action that will be executed for each expansion.
-
unregisterExpansion
Unregister an expansion from the registry.- Parameters:
name
- The expansion name fromPluginExpansion.getName()
.
-
shutdownExpansions
public abstract void shutdownExpansions()Unregisters all the loaded expansions from the registry. -
reloadExpansions
public abstract void reloadExpansions()Reload all the expansions from the registry. -
getExpansions
Retrieve a list of all the expansions based on the implementation specified.- Type Parameters:
T
- The expansion implementation.- Parameters:
clazz
- The expansion implementation to return.- Returns:
- List of all the loaded expansions based on the implementation.
-
getExpansion
Retrieve an expansion based on the class specified.- Type Parameters:
T
- The expansion class.- Parameters:
clazz
- The expansion to return.- Returns:
- The expansion instance.
-
getExpansion
Retrieve an expansion based on the name specified.- Parameters:
name
- The name of the expansion to retrieve.- Returns:
- The expansion instance.
-
getExpansions
Retrieve a list of all the expansions.- Returns:
- List of all the loaded expansions in the registry.
-
getExpansionStream
Retrieve a stream of all the expansions based on the implementation specified.- Type Parameters:
T
- The expansion implementation.- Parameters:
clazz
- The expansion implementation to return.- Returns:
- Stream of all the loaded expansions based on the implementation.
-
getVaultExpansionPermission
public abstract net.milkbowl.vault.permission.Permission getVaultExpansionPermission()Retrieve the integrated permission provider in this registry from Vault.- Returns:
- Permission provider from the internal Vault expansion.
-
getVaultExpansionEconomy
public abstract net.milkbowl.vault.economy.Economy getVaultExpansionEconomy()Retrieve the integrated permission provider in this registry from Vault.- Returns:
- Economy provider from the internal Vault expansion.
-
getVaultExpansionChat
public abstract net.milkbowl.vault.chat.Chat getVaultExpansionChat()Retrieve the integrated permission provider in this registry from Vault.- Returns:
- Chat provider from the internal Vault expansion.
-
noPlaceholderAPICondition
public abstract boolean noPlaceholderAPICondition(ConfigurationSection section, Function<String, String> function, OfflinePlayer player)
-