Class Util

java.lang.Object
io.github.addoncommunity.galactifun.util.Util

public final class Util extends Object
Utilities
  • Field Details

    • KM_PER_LY

      public static final double KM_PER_LY
      See Also:
    • COORD_PATTERN

      public static final Pattern COORD_PATTERN
    • SPACE_PATTERN

      public static final Pattern SPACE_PATTERN
    • SURROUNDING_FACES

      public static final org.bukkit.block.BlockFace[] SURROUNDING_FACES
    • IMPERMEABLE_BLOCKS

      public static final Set<org.bukkit.Material> IMPERMEABLE_BLOCKS
    • ALL_SIDES

      public static final org.bukkit.block.BlockFace[] ALL_SIDES
  • Method Details

    • timeSince

      @Nonnull public static String timeSince(double nanoTime)
    • floodFill

      @Nonnull public static Optional<Set<io.github.thebusybiscuit.slimefun5.libraries.dough.blocks.BlockPosition>> floodFill(@Nonnull org.bukkit.Location start, int max)
      Queue-based flood fill algorithm
      Parameters:
      start - starting block
      max - maximum traversed blocks
      Returns:
      blocks traversed, or an empty optional if traversed blocks > max
    • getHighestBlockAt

      public static org.bukkit.Location getHighestBlockAt(@Nonnull org.bukkit.RegionAccessor region, int x, int z)
      Gets the highest block of this RegionAccessor
    • getHighestBlockAt

      public static org.bukkit.block.Block getHighestBlockAt(@Nonnull org.bukkit.World world, int x, int z, @Nonnull Predicate<org.bukkit.block.Block> isSolid)
    • formatDistance

      public static String formatDistance(double distance)
      Formats the given double as a distance string
      Parameters:
      distance - the distance to format, in light years