Class BorderBlockRenderer

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

public final class BorderBlockRenderer extends Object
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 Type
    Method
    Description
    static void
    removeAll(org.bukkit.entity.Player player)
    Removes all fake border blocks shown to a specific player.
    static void
    removeRegion(long regionId)
    Removes all fake border blocks for a specific region.
    static void
    Removes all fake border blocks for a specific region.
    static void
    show(org.bukkit.entity.Player player, Region region)
    Shows region borders to a player by sending fake block changes.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • show

      public static void show(org.bukkit.entity.Player player, Region region)
      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 to
      region - 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

      public static void removeRegion(Region region)
      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