Class BorderUtil

java.lang.Object
com.palmergames.bukkit.towny.utils.BorderUtil

public class BorderUtil extends Object
Author:
Chris H (Zren / Shade) Date: 4/15/12
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<org.bukkit.block.BlockState>
    allowedBlocks(List<org.bukkit.block.BlockState> blocks, org.bukkit.block.Block originBlock)
    Will return a list of blocks which all either have the same town as an owner, or the same player as owner.
    static List<org.bukkit.block.BlockState>
    allowedBlocks(List<org.bukkit.block.BlockState> blocks, org.bukkit.block.Block originBlock, org.bukkit.entity.Player player)
    Will return a list of blocks which all either have the same town as an owner, or the same player as owner.
    static boolean
    allowedMove(org.bukkit.block.Block block, org.bukkit.block.Block blockTo)
    Decides whether a block is in a same-owner relation ship with the given block.
    static boolean
    allowedMove(org.bukkit.block.Block block, org.bukkit.block.Block blockTo, @Nullable org.bukkit.entity.Player player)
    Decides whether a block is in a same-owner relation ship with the given block.
    static List<org.bukkit.block.BlockState>
    disallowedBlocks(List<org.bukkit.block.BlockState> blocks, org.bukkit.block.Block originBlock)
    Will return a list of blocks which all either do not have the same town as an owner, or do not have the same player as owner.
    static List<org.bukkit.block.BlockState>
    disallowedBlocks(List<org.bukkit.block.BlockState> blocks, org.bukkit.block.Block originBlock, org.bukkit.entity.Player player)
    Will return a list of blocks which all either do not have the same town as an owner, or do not have the same player as owner.
    getFloodFillableCoords(@NotNull Town town, @NotNull WorldCoord origin)
     
     
    static CellBorder
     
     

    Methods inherited from class java.lang.Object

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

    • BorderUtil

      public BorderUtil()
  • Method Details

    • getOuterBorder

      public static List<CellBorder> getOuterBorder(List<WorldCoord> worldCoords)
    • getPlotBorder

      public static List<CellBorder> getPlotBorder(List<WorldCoord> worldCoords)
    • getPlotBorder

      public static CellBorder getPlotBorder(WorldCoord worldCoord)
    • allowedBlocks

      public static List<org.bukkit.block.BlockState> allowedBlocks(List<org.bukkit.block.BlockState> blocks, org.bukkit.block.Block originBlock)
      Will return a list of blocks which all either have the same town as an owner, or the same player as owner. Any block in the wilderness is considered allowed.
      Parameters:
      blocks - List<BlockState> which hasn't been filtered yet.
      originBlock - Block from which to test against.
      Returns:
      List<BlockState> which has been filtered to same-owner and wilderness.
    • allowedBlocks

      public static List<org.bukkit.block.BlockState> allowedBlocks(List<org.bukkit.block.BlockState> blocks, org.bukkit.block.Block originBlock, org.bukkit.entity.Player player)
      Will return a list of blocks which all either have the same town as an owner, or the same player as owner. Any block in the wilderness is considered allowed. Takes the player involved into account.
      Parameters:
      blocks - List<BlockState> which hasn't been filtered yet.
      originBlock - Block from which to test against.
      player - Player which is involved in the test.
      Returns:
      List<BlockState> which has been filtered to same-owner and wilderness.
    • disallowedBlocks

      public static List<org.bukkit.block.BlockState> disallowedBlocks(List<org.bukkit.block.BlockState> blocks, org.bukkit.block.Block originBlock)
      Will return a list of blocks which all either do not have the same town as an owner, or do not have the same player as owner. Any block in the wilderness is considered allowed.
      Parameters:
      blocks - List<BlockState> which hasn't been filtered yet.
      originBlock - Block from which to test against.
      Returns:
      List<BlockState> which has been filtered to same-owner and wilderness.
    • disallowedBlocks

      public static List<org.bukkit.block.BlockState> disallowedBlocks(List<org.bukkit.block.BlockState> blocks, org.bukkit.block.Block originBlock, org.bukkit.entity.Player player)
      Will return a list of blocks which all either do not have the same town as an owner, or do not have the same player as owner. Any block in the wilderness is considered allowed. When Player is not null, player cache will be used to determine build rights.
      Parameters:
      blocks - List<BlockState> which hasn't been filtered yet.
      originBlock - Block from which to test against.
      player - Player the player involved in the move, when not null.
      Returns:
      List<BlockState> which has been filtered to same-owner and wilderness.
    • allowedMove

      public static boolean allowedMove(org.bukkit.block.Block block, org.bukkit.block.Block blockTo)
      Decides whether a block is in a same-owner relation ship with the given block. Wilderness blocks are considered allowed.
      Parameters:
      block - Block which is the original.
      blockTo - Block to test the relation to.
      Returns:
      true if the blocks are considered same-owner or wilderness.
    • allowedMove

      public static boolean allowedMove(org.bukkit.block.Block block, org.bukkit.block.Block blockTo, @Nullable @Nullable org.bukkit.entity.Player player)
      Decides whether a block is in a same-owner relation ship with the given block. Wilderness blocks are considered allowed. When player isn't null, the player cache is checked.
      Parameters:
      block - Block which is the original.
      blockTo - Block to test the relation to.
      player - Player involved in the move, when not null.
      Returns:
      true if the blocks are considered same-owner or wilderness or allowed via player cache.
    • getFloodFillableCoords

      @Internal @NotNull public static @NotNull BorderUtil.FloodfillResult getFloodFillableCoords(@NotNull @NotNull Town town, @NotNull @NotNull WorldCoord origin)