Class RegisterGraveProviders
java.lang.Object
dev.cwhead.GravesX.api.provider.RegisterGraveProviders
Utility for discovering
GraveProvider implementations that have been registered
with the Bukkit Services API. Providers are returned in ascending order
so lower numbers (higher priority) come first.
This method takes a snapshot of the currently-registered providers each time it is called. It does not track future registrations/unregistrations.
- Since:
- 4.9.9.1
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidOne-time (or occasional) rebuild from Bukkit Services.static voidclear()Clear all cached/indexed providers (call on plugin disable, or before a rebuild if you want).static List<GraveProvider> getAll()Retrieves all registeredGraveProviderinstances from the Bukkit Services registry, sorted by ascending order.static GraveProviderO(1) lookup by provider id.static List<GraveProvider> Returns every provider at the highest priority tier (the minimal order value).static Optional<GraveProvider> Returns a single highest-priority provider (arbitrary among ties).static voidindex(GraveProvider provider) If you control registration code, call this right after you register the provider.static voidunindex(GraveProvider provider) If you control unregistration/disable, call this to keep the index clean.
-
Method Details
-
bootstrapFromServices
public static void bootstrapFromServices()One-time (or occasional) rebuild from Bukkit Services. Call after modules/providers have registered their services. This performs the loop ONCE here, so removeGrave() never has to. -
index
If you control registration code, call this right after you register the provider. (Avoids needing to call bootstrapFromServices again.) -
unindex
If you control unregistration/disable, call this to keep the index clean. -
clear
public static void clear()Clear all cached/indexed providers (call on plugin disable, or before a rebuild if you want). -
getById
O(1) lookup by provider id. Intended for hot paths (like removeGrave). -
getHighestPriorityAll
Returns every provider at the highest priority tier (the minimal order value). If none are registered, returns an empty list. -
getAll
Retrieves all registeredGraveProviderinstances from the Bukkit Services registry, sorted by ascending order. The returned list is immutable. NOTE: This remains a snapshot (loops). That's fine outside hot removal paths. As a bonus, this also refreshes the id index. -
getHighestPriorityOne
Returns a single highest-priority provider (arbitrary among ties).
-