Package com.griefdefender.api
Interface Registry
public interface Registry
-
Method Summary
Modifier and TypeMethodDescription<T> TcreateBuilder(Class<T> builderClass) Gets a builder of the desired class type, examples may include:Claim.Builder, etc.<T extends CatalogType>
Collection<T> Gets a collection of all available found specific types ofCatalogTyperequested.<T extends CatalogType>
Collection<T> Gets a collection of all available found specific types ofCatalogTyperequested.<T extends CatalogType>
Optional<CatalogRegistryModule<T>> getRegistryModuleFor(Class<T> catalogClass) Gets theCatalogRegistryModulefor supplied catalog class.<T extends CatalogType>
Optional<T> Attempts to retrieve the specific type ofCatalogTypebased on the string id given.@Nullable StringAttempts to lookup a given object's identifier in registry.@Nullable StringlookupUsername(UUID uuid) Attempts to lookup a player's username byUUID.@Nullable UUIDlookupUserUniqueId(String username) Attempts to lookup a player'sUUIDby their username.<T> RegistryregisterBuilderSupplier(Class<T> builderClass, Supplier<? extends T> supplier) Registers aSupplierfor creating the desired.invalid reference
BuildervoidregisterClanProvider(ClanProvider provider) Registers aClanProviderto associate with GriefDefender.
-
Method Details
-
registerBuilderSupplier
Registers aSupplierfor creating the desired.invalid reference
Builder- Type Parameters:
T- The type of builder/supplier- Parameters:
builderClass- The builder classsupplier- The supplier- Returns:
- This registry, for chaining
-
createBuilder
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
Attempts to retrieve the specific type ofCatalogTypebased 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 ofCatalogTypeid- The case insensitive string id of the dummy type- Returns:
- The found dummy type, if available
- See Also:
-
getAllOf
Gets a collection of all available found specific types ofCatalogTyperequested.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 ofCatalogType- Parameters:
typeClass- The class ofCatalogType- Returns:
- A collection of all known types of the requested catalog type
-
getAllFor
Gets a collection of all available found specific types ofCatalogTyperequested.- Type Parameters:
T- The type ofCatalogType- Parameters:
pluginId- The plugin id to check for typestypeClass- The class ofCatalogType- Returns:
- A collection of all known types of the requested catalog type
-
getRegistryModuleFor
<T extends CatalogType> Optional<CatalogRegistryModule<T>> getRegistryModuleFor(Class<T> catalogClass) Gets theCatalogRegistryModulefor supplied catalog class.- Returns:
- The catalog registry module
-
registerClanProvider
Registers aClanProviderto associate with GriefDefender.- Parameters:
provider- The clan provider
-
lookupId
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
Attempts to lookup a player's username byUUID.- Parameters:
uuid- The player's UUID- Returns:
- The username, if available
-
lookupUserUniqueId
Attempts to lookup a player'sUUIDby their username.- Parameters:
username- The player username- Returns:
- The UUID, if available
-