LocationOwnership

public final class LocationOwnership

Cross-plugin location ownership API.

Plugins that "own" certain locations (worlds, regions, instanced content, scripted areas) register themselves once on enable. Any other plugin can then ask whether a given location is owned, by whom, and with what kind tags — without taking a hard dependency on the owning plugin.

Backed by Bukkit's ServicesManager, so registrations propagate across plugin classloaders even when MagmaCore is shaded into multiple consumer plugins. Registrations are keyed under Predicate (a JDK class with stable identity across classloaders); each plugin's shaded copy of LocationOwnershipEntry is identified by its simple class name — which the shade relocation does not rename — and dispatched via reflection on JDK-stable method signatures.

Bukkit auto-unregisters all of a plugin's services when the plugin disables, so callers don't need to clean up.

Functions

Link copied to clipboard
public static boolean anyOwnerAt(Location loc)
True if at least one owner claims this location.
Link copied to clipboard
public static boolean anyProtectedOwnerAt(Location loc)
True if at least one owner protects this location (write/grief restrictions apply).
Link copied to clipboard
public static boolean hasKind(Location loc, String kind)
True if any registered owner reports kind at loc.
Link copied to clipboard
public static Set<String> kindsAt(Location loc)
Aggregate kind tags at loc from every owner that claims it.
Link copied to clipboard
public static boolean ownedBy(Location loc, String namespace)
True if namespace owns the given location.
Link copied to clipboard
public static Set<String> ownersAt(Location loc)
All namespaces that own this location, across every consumer plugin.
Link copied to clipboard
public static void register(Plugin plugin, LocationOwnershipEntry entry)
Lower-level escape hatch — register a pre-built entry directly.
public static void register(Plugin plugin, String namespace, Predicate<Location> ownsLocation)
Register a plugin as owning certain locations.
public static void register(Plugin plugin, String namespace, Predicate<Location> ownsLocation, Predicate<Location> protectionFn)
Register a plugin as owning certain locations, with an explicit protection check.
Link copied to clipboard
public static void registerTyped(Plugin plugin, String namespace, Function<Location, Set<String>> kindsFn)
Register a plugin as owning certain locations with kind metadata.
public static void registerTyped(Plugin plugin, String namespace, Function<Location, Set<String>> kindsFn, Predicate<Location> protectionFn)
Typed registration with an explicit protection check (see register).