Klasse WorldGuardGateway

java.lang.Object
de.delinkedde.areashopreborn.integration.WorldGuardGateway

public final class WorldGuardGateway extends Object
Provides the controlled WorldGuard operations required by the application layer. Methods must be called from the Paper server thread.
  • Konstruktordetails

    • WorldGuardGateway

      public WorldGuardGateway()
      Creates a stateless WorldGuard gateway.
  • Methodendetails

    • fullHeightBounds

      public CuboidBounds fullHeightBounds(String worldKey, CuboidBounds selectedBounds)
      Expands an X/Z selection to the complete build height of its Bukkit world.
      Parameter:
      worldKey - Bukkit namespaced world key
      selectedBounds - original selection whose horizontal footprint is retained
      Gibt zurück:
      bounds from the world's minimum build height through its inclusive maximum
    • find

      public Optional<WorldGuardGateway.ProtectionRegion> find(String worldKey, String protectionId)
      Reads an existing WorldGuard region.
      Parameter:
      worldKey - Bukkit world key or name
      protectionId - WorldGuard region identifier
      Gibt zurück:
      immutable region snapshot when present
    • availableManagerCount

      public int availableManagerCount()
      Counts loaded Bukkit worlds for which WorldGuard exposes a region manager.
      Gibt zurück:
      available region-manager count
    • listTopLevelCuboids

      public List<WorldGuardGateway.ProtectionRegion> listTopLevelCuboids(String worldKey)
      Lists top-level cuboid regions suitable for explicit city import.
      Parameter:
      worldKey - Bukkit world key or name
      Gibt zurück:
      immutable snapshots sorted by WorldGuard identifier
    • createCuboid

      public void createCuboid(String worldKey, String protectionId, CuboidBounds bounds, String parentProtectionId) throws Exception
      Creates a protected cuboid and optionally assigns a parent.
      Parameter:
      worldKey - Bukkit world key or name
      protectionId - generated WorldGuard region identifier
      bounds - cuboid bounds
      parentProtectionId - optional parent WorldGuard identifier
      Löst aus:
      Exception - when WorldGuard rejects the parent or cannot save the region
    • createGeometry

      public void createGeometry(String worldKey, String protectionId, RegionGeometry geometry, int priority) throws Exception
      Creates a root WorldGuard region with the supplied geometry and priority.

      Estate hierarchy remains in SQLite. No WorldGuard parent is assigned because parent domains are inherited and would grant a city landlord access to sold parcels.

      Parameter:
      worldKey - Bukkit world key or name
      protectionId - stable WorldGuard identifier
      geometry - exact polygon and height range
      priority - WorldGuard priority
      Löst aus:
      Exception - when the identifier exists or WorldGuard cannot save the region
    • replaceGeometry

      public void replaceGeometry(String worldKey, String protectionId, RegionGeometry geometry, int priority) throws Exception
      Replaces only the shape and height of an existing WorldGuard region.

      Owners, members, flags, and the requested Estate priority survive the replacement. Any legacy WorldGuard parent is deliberately removed.

      Parameter:
      worldKey - Bukkit world key or name
      protectionId - existing WorldGuard identifier
      geometry - replacement geometry
      priority - Estate priority to enforce
      Löst aus:
      Exception - when the region is missing or WorldGuard cannot save the change
    • mergeGeometry

      public WorldGuardGateway.GeometryMergeRollback mergeGeometry(String worldKey, String targetProtectionId, String sourceProtectionId, RegionGeometry geometry) throws Exception
      Replaces a target parcel geometry and removes a merged source region in one manager save.
      Parameter:
      worldKey - Bukkit world key or name
      targetProtectionId - retained parcel identifier
      sourceProtectionId - archived source identifier
      geometry - combined target geometry
      Gibt zurück:
      rollback handle that can restore the exact in-memory WorldGuard objects
      Löst aus:
      Exception - when either region is missing or WorldGuard cannot save the change
    • applyEstatePriority

      public void applyEstatePriority(String worldKey, String protectionId, int priority) throws Exception
      Enforces the Estate priority model on an existing WorldGuard region.
      Parameter:
      worldKey - Bukkit world key or name
      protectionId - existing WorldGuard identifier
      priority - city priority 1 or parcel priority 2
      Löst aus:
      Exception - when the region is missing or WorldGuard cannot persist the change
    • applyEstatePriorities

      public void applyEstatePriorities(String worldKey, Collection<WorldGuardGateway.RegionPriority> definitions) throws Exception
      Enforces priorities and removes legacy parents for a complete world batch.
      Parameter:
      worldKey - Bukkit world key or name
      definitions - region priorities
      Löst aus:
      Exception - when a region is missing or WorldGuard cannot persist the batch
    • contains

      public boolean contains(String worldKey, String protectionId, int x, int y, int z)
      Tests exact WorldGuard containment for one block.
      Parameter:
      worldKey - Bukkit world key or name
      protectionId - existing WorldGuard identifier
      x - block X coordinate
      y - block Y coordinate
      z - block Z coordinate
      Gibt zurück:
      true when the region contains the block
    • applyAccess

      public void applyAccess(String worldKey, String protectionId, Collection<UUID> owners, Collection<UUID> members) throws Exception
      Replaces WorldGuard owners and members with the supplied UUID sets.
      Parameter:
      worldKey - Bukkit world key or name
      protectionId - WorldGuard region identifier
      owners - owner UUIDs
      members - member UUIDs
      Löst aus:
      Exception - when the region is missing or cannot be saved
    • applyAccessBatch

      public void applyAccessBatch(String worldKey, Collection<WorldGuardGateway.RegionAccess> definitions) throws Exception
      Replaces access domains of several regions and performs one WorldGuard save.
      Parameter:
      worldKey - Bukkit world key or name
      definitions - complete region access definitions
      Löst aus:
      Exception - when a region is missing or WorldGuard cannot save the batch
    • setStateFlag

      public void setStateFlag(String worldKey, String protectionId, String flagName, String value) throws Exception
      Sets, denies, or removes a WorldGuard state flag on a protected region.
      Parameter:
      worldKey - Bukkit world key or name
      protectionId - WorldGuard region identifier
      flagName - registered state-flag name
      value - allow, deny, or unset
      Löst aus:
      Exception - when the region, flag, or value is invalid or saving fails
    • delete

      public void delete(String worldKey, String protectionId) throws Exception
      Deletes an existing WorldGuard region.
      Parameter:
      worldKey - Bukkit world key or name
      protectionId - WorldGuard region identifier
      Löst aus:
      Exception - when WorldGuard cannot save the change