Class BorderBlockRenderer
java.lang.Object
me.tayebyassine.homestead.borders.blocks.BorderBlockRenderer
Renders region borders using fake block changes sent to individual players.
This class creates visual border outlines by sending Player.sendBlockChange(Location, BlockData)
packets to show temporary blocks at chunk boundaries. Each player sees their own independent
border visualization, allowing multiple players to view different regions simultaneously.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidremoveAll(org.bukkit.entity.Player player) Removes all fake border blocks shown to a specific player.static voidremoveRegion(long regionId) Removes all fake border blocks for a specific region.static voidremoveRegion(Region region) Removes all fake border blocks for a specific region.static voidShows region borders to a player by sending fake block changes.
-
Method Details
-
show
Shows region borders to a player by sending fake block changes.This calculates the outer edges of all chunks in the region and places border blocks along chunk boundaries that border unclaimed or other regions.
- Parameters:
player- the player to show borders toregion- the region whose borders to display- Throws:
IllegalArgumentException- if player or region is null
-
removeAll
public static void removeAll(org.bukkit.entity.Player player) Removes all fake border blocks shown to a specific player.Sends block restoration packets to the player for all borders they currently see.
- Parameters:
player- the player whose borders to remove
-
removeRegion
Removes all fake border blocks for a specific region.Sends block restoration packets to all viewers who had borders for this region.
- Parameters:
region- the region to remove borders for
-
removeRegion
public static void removeRegion(long regionId) Removes all fake border blocks for a specific region.Sends block restoration packets to all viewers who had borders for this region.
- Parameters:
regionId- the region ID to remove borders for
-