LocationQueryRegistry

public final class LocationQueryRegistry

Static registry of DungeonLocators and RegionProtectionProviders.

Because Magmacore is shaded + relocated into some consumer plugins (e.g. FMM relocates to com.magmaguy.freeminecraftmodels.magmacore.*) while others ship it at its original package (EliteMobs), each consumer ends up with its own isolated copy of this class. Dungeon providers must therefore push themselves into each consumer's registry directly on plugin enable — EliteMobs registers with its own copy here and also calls FMM's com.magmaguy.freeminecraftmodels.api.LocationAPI so FMM's isolated registry gets populated too.

Built-in region-protection adapters (WorldGuard, GriefPrevention) are auto-registered on the first protection query. Protection check classes live inside Magmacore itself, so they work uniformly across shaded and non-shaded consumers — each consumer builds its own adapter using its own class copies.

Reads are lock-free via copy-on-write lists: registrations happen a handful of times at plugin start-up and queries can occur many thousands of times per second from scripts.

Functions

Link copied to clipboard
public static boolean canBuild(Player player, Location location)
Asks each provider whether the player may build.
Link copied to clipboard
public static int getDungeonLocatorCount()
Link copied to clipboard
public static int getProtectionProviderCount()
Link copied to clipboard
Force the built-in protection providers to attempt registration now rather than on first query.
Link copied to clipboard
public static boolean isInAnyDungeon(Location location)
Link copied to clipboard
public static boolean isInAnyProtectedRegion(Location location)
Link copied to clipboard
public static void registerDungeonLocator(DungeonLocator locator)
Link copied to clipboard
Link copied to clipboard
public static void shutdown()
Link copied to clipboard
public static void unregisterDungeonLocator(DungeonLocator locator)
Link copied to clipboard