Class ExpansionRegistry

java.lang.Object
com.olziedev.playertrade.api.expansion.ExpansionRegistry

public abstract class ExpansionRegistry extends Object
Handles and manages all expansions for the plugin.
  • Constructor Details

    • ExpansionRegistry

      public ExpansionRegistry()
  • Method Details

    • registerExpansion

      public abstract void registerExpansion(PluginExpansion pluginExpansion)
      Register an pluginExpansion to the registry.
      Parameters:
      pluginExpansion - The pluginExpansion instance.
    • innitPlaceholders

      public abstract void innitPlaceholders(PluginExpansion pluginExpansion)
      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

      public abstract void unregisterExpansion(String name)
      Unregister an expansion from the registry.
      Parameters:
      name - The expansion name from PluginExpansion.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

      public abstract <T extends PluginExpansion> List<T> getExpansions(Class<T> clazz)
      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

      public abstract <T extends PluginExpansion> T getExpansion(Class<T> clazz)
      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

      public abstract PluginExpansion getExpansion(String name)
      Retrieve an expansion based on the name specified.
      Parameters:
      name - The name of the expansion to retrieve.
      Returns:
      The expansion instance.
    • getExpansions

      public List<PluginExpansion> getExpansions()
      Retrieve a list of all the expansions.
      Returns:
      List of all the loaded expansions in the registry.
    • getExpansionStream

      public abstract <T extends PluginExpansion> Stream<T> getExpansionStream(Class<T> clazz)
      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)