Klasse HomeProtectionCache

java.lang.Object
de.delinkedde.areashopreborn.application.HomeProtectionCache

public final class HomeProtectionCache extends Object
Maintains a lock-free destination authorization snapshot for synchronous teleport events.
  • Konstruktordetails

    • HomeProtectionCache

      public HomeProtectionCache(Database database, HomeProtectionRepository repository, int maximumRegions, int maximumAuthorizationLinks)
      Creates the cache.
      Parameter:
      database - asynchronous database executor
      repository - snapshot repository
      maximumRegions - maximum complete region snapshot size
      maximumAuthorizationLinks - maximum complete authorization-link count
  • Methodendetails

    • refresh

      public CompletableFuture<Integer> refresh()
      Rebuilds the complete cache asynchronously and swaps it atomically.
      Gibt zurück:
      future containing the loaded region count
    • isReady

      public boolean isReady()
      Reports whether at least one complete snapshot has been published.
      Gibt zurück:
      true after the first successful refresh
    • find

      public Optional<HomeProtectionSnapshot> find(String worldKey, int x, int y, int z)
      Finds the most specific managed region containing a destination.
      Parameter:
      worldKey - destination world key
      x - block X
      y - block Y
      z - block Z
      Gibt zurück:
      parcel-first, smallest-volume match