Klasse RegionSuggestionCache

java.lang.Object
de.delinkedde.areashopreborn.command.RegionSuggestionCache

public final class RegionSuggestionCache extends Object
Maintains immutable region-name snapshots for non-blocking command completion.

SQLite is queried only on the database executor. Brigadier suggestion calls read volatile immutable lists and therefore never wait for the database on the server thread.

  • Konstruktordetails

    • RegionSuggestionCache

      public RegionSuggestionCache(Database database, EstateRepository estates, int maximumEntries)
      Creates an initially empty suggestion cache.
      Parameter:
      database - asynchronous database executor
      estates - estate repository
      maximumEntries - maximum names retained per suggestion category
  • Methodendetails

    • refresh

      public CompletableFuture<Integer> refresh()
      Rebuilds both snapshots asynchronously.
      Gibt zurück:
      completion future containing the number of cached regions
    • regions

      public List<String> regions()
      Returns a stable snapshot of user-facing names and WorldGuard-compatible identifiers.
      Gibt zurück:
      immutable region identifier list
    • cities

      public List<String> cities()
      Returns a stable snapshot containing city display names and protection identifiers only.
      Gibt zurück:
      immutable city identifier list