Class Util
java.lang.Object
io.github.addoncommunity.galactifun.util.Util
Utilities
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfloodFill(org.bukkit.Location start, int max) Queue-based flood fill algorithmstatic StringformatDistance(double distance) Formats the given double as a distance stringstatic org.bukkit.LocationgetHighestBlockAt(org.bukkit.RegionAccessor region, int x, int z) Gets the highest block of thisRegionAccessorstatic org.bukkit.block.BlockgetHighestBlockAt(org.bukkit.World world, int x, int z, Predicate<org.bukkit.block.Block> isSolid) static StringtimeSince(double nanoTime)
-
Field Details
-
KM_PER_LY
public static final double KM_PER_LY- See Also:
-
COORD_PATTERN
-
SPACE_PATTERN
-
SURROUNDING_FACES
public static final org.bukkit.block.BlockFace[] SURROUNDING_FACES -
IMPERMEABLE_BLOCKS
-
ALL_SIDES
public static final org.bukkit.block.BlockFace[] ALL_SIDES
-
-
Method Details
-
timeSince
-
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 blockmax- 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 thisRegionAccessor -
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
Formats the given double as a distance string- Parameters:
distance- the distance to format, in light years
-