Class FakeBorderRegistry
java.lang.Object
me.tayebyassine.homestead.borders.blocks.FakeBorderRegistry
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRecord representing a fake border block shown to a specific viewer. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidRegisters a fake border block for a specific viewer and region.static voidclear()Clears all registered fake border blocks.getByLocation(org.bukkit.Location loc) Retrieves the fake border block at a specific location.getRegionBlocks(long regionId) Retrieves all fake border blocks for a given region.getRegionBlocks(Region region) Retrieves all fake border blocks for a given region.getViewerBlocks(UUID viewerId) Retrieves all fake border blocks for a specific viewer across all regions.static booleanRemoves a specific fake border block for a viewer.removeRegion(long regionId) Removes all fake border blocks for a region and sends block restoration packets to the associated viewers.removeRegion(Region region) Removes all fake border blocks for a region and sends block restoration packets to the associated viewers.
-
Method Details
-
add
Registers a fake border block for a specific viewer and region.- Parameters:
block- the fake border block to register
-
getRegionBlocks
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
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
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
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
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
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
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
-