Class FakeBorderRegistry

java.lang.Object
me.tayebyassine.homestead.borders.blocks.FakeBorderRegistry

public final class FakeBorderRegistry extends Object
Registry for managing fake border blocks shown to specific players.

This class tracks temporary block changes sent to individual players to visualize region borders. Each fake block is associated with a specific viewer and region, allowing independent border visualization for multiple players simultaneously.

See Also:
  • Method Details

    • add

      public static void add(FakeBorderRegistry.FakeBorderBlock block)
      Registers a fake border block for a specific viewer and region.
      Parameters:
      block - the fake border block to register
    • getRegionBlocks

      public static Set<FakeBorderRegistry.FakeBorderBlock> getRegionBlocks(Region region)
      Retrieves all fake border blocks for a given region.
      Parameters:
      region - the region
      Returns:
      an unmodifiable set of fake border blocks, or empty set if none
    • getRegionBlocks

      public static Set<FakeBorderRegistry.FakeBorderBlock> getRegionBlocks(long regionId)
      Retrieves all fake border blocks for a given region.
      Parameters:
      regionId - the region ID
      Returns:
      an unmodifiable set of fake border blocks, or empty set if none
    • getByLocation

      public static FakeBorderRegistry.FakeBorderBlock getByLocation(org.bukkit.Location loc)
      Retrieves the fake border block at a specific location.
      Parameters:
      loc - the location to check
      Returns:
      the fake border block, or null if none exists at that location
    • removeRegion

      public static Set<FakeBorderRegistry.FakeBorderBlock> removeRegion(Region region)
      Removes all fake border blocks for a region and sends block restoration packets to the associated viewers.
      Parameters:
      region - the region to remove blocks for
      Returns:
      the set of removed blocks
    • removeRegion

      public static Set<FakeBorderRegistry.FakeBorderBlock> removeRegion(long regionId)
      Removes all fake border blocks for a region and sends block restoration packets to the associated viewers.
      Parameters:
      regionId - the region ID to remove blocks for
      Returns:
      the set of removed blocks
    • remove

      public static boolean remove(FakeBorderRegistry.FakeBorderBlock block)
      Removes a specific fake border block for a viewer.
      Parameters:
      block - the block to remove
      Returns:
      true if the block was found and removed
    • clear

      public static void clear()
      Clears all registered fake border blocks.
    • getViewerBlocks

      public static List<FakeBorderRegistry.FakeBorderBlock> getViewerBlocks(UUID viewerId)
      Retrieves all fake border blocks for a specific viewer across all regions.
      Parameters:
      viewerId - the viewer's unique ID
      Returns:
      list of fake border blocks for the viewer