Interface Registry


public interface Registry
  • Method Details

    • registerBuilderSupplier

      <T> Registry registerBuilderSupplier(Class<T> builderClass, Supplier<? extends T> supplier)
      Registers a Supplier for creating the desired
      invalid reference
      Builder
      .
      Type Parameters:
      T - The type of builder/supplier
      Parameters:
      builderClass - The builder class
      supplier - The supplier
      Returns:
      This registry, for chaining
    • createBuilder

      <T> T createBuilder(Class<T> builderClass) throws IllegalArgumentException
      Gets a builder of the desired class type, examples may include: Claim.Builder, etc.
      Type Parameters:
      T - The type of builder
      Parameters:
      builderClass - The class of the builder
      Returns:
      The builder, if available
      Throws:
      IllegalArgumentException - If there is no supplier for the given builder class
    • getType

      <T extends CatalogType> Optional<T> getType(Class<T> typeClass, String id)
      Attempts to retrieve the specific type of CatalogType based on the string id given.

      Some types may not be available for various reasons including but not restricted to: mods adding custom types, plugins providing custom types, game version changes.

      Type Parameters:
      T - The type of dummy type
      Parameters:
      typeClass - The class of the type of CatalogType
      id - The case insensitive string id of the dummy type
      Returns:
      The found dummy type, if available
      See Also:
    • getAllOf

      <T extends CatalogType> Collection<T> getAllOf(Class<T> typeClass)
      Gets a collection of all available found specific types of CatalogType requested.

      The presented CatalogTypes may not exist in default catalogs due to various reasons including but not restricted to: mods, plugins, game changes.

      Type Parameters:
      T - The type of CatalogType
      Parameters:
      typeClass - The class of CatalogType
      Returns:
      A collection of all known types of the requested catalog type
    • getAllFor

      <T extends CatalogType> Collection<T> getAllFor(String pluginId, Class<T> typeClass)
      Gets a collection of all available found specific types of CatalogType requested.
      Type Parameters:
      T - The type of CatalogType
      Parameters:
      pluginId - The plugin id to check for types
      typeClass - The class of CatalogType
      Returns:
      A collection of all known types of the requested catalog type
    • getRegistryModuleFor

      <T extends CatalogType> Optional<CatalogRegistryModule<T>> getRegistryModuleFor(Class<T> catalogClass)
      Gets the CatalogRegistryModule for supplied catalog class.
      Returns:
      The catalog registry module
    • registerClanProvider

      void registerClanProvider(ClanProvider provider)
      Registers a ClanProvider to associate with GriefDefender.
      Parameters:
      provider - The clan provider
    • lookupId

      @Nullable String lookupId(Object object)
      Attempts to lookup a given object's identifier in registry. Note: Accepts common Minecraft objects such as Block, Entity, TileEntity, Item, and ItemStack. Note: The object passed should represent the API object version of the platform.
      Parameters:
      object - The object
      Returns:
      The identifier, if available
    • lookupUsername

      @Nullable String lookupUsername(UUID uuid)
      Attempts to lookup a player's username by UUID.
      Parameters:
      uuid - The player's UUID
      Returns:
      The username, if available
    • lookupUserUniqueId

      @Nullable UUID lookupUserUniqueId(String username)
      Attempts to lookup a player's UUID by their username.
      Parameters:
      username - The player username
      Returns:
      The UUID, if available