Class ChunkRangeUtils

java.lang.Object
net.minestom.server.coordinate.ChunkRangeUtils

public final class ChunkRangeUtils extends Object
Helper class to iterate over chunks within a range.
  • Constructor Details

    • ChunkRangeUtils

      public ChunkRangeUtils()
  • Method Details

    • chunkCountFromRange

      public static int chunkCountFromRange(int range)
      Get the amount of chunks in a square range.
      Parameters:
      range - the range
      Returns:
      the amount of chunks in the square range
    • forDifferingChunksInRange

      public static void forDifferingChunksInRange(int newChunkX, int newChunkZ, int oldChunkX, int oldChunkZ, int range, @NotNull @NotNull ChunkRangeUtils.ChunkConsumer callback)
    • forDifferingChunksInRange

      public static void forDifferingChunksInRange(int newChunkX, int newChunkZ, int oldChunkX, int oldChunkZ, int range, @NotNull @NotNull ChunkRangeUtils.ChunkConsumer newCallback, @NotNull @NotNull ChunkRangeUtils.ChunkConsumer oldCallback)
    • forChunksInRange

      public static void forChunksInRange(int chunkX, int chunkZ, int range, ChunkRangeUtils.ChunkConsumer consumer)
      New implementation comes from Krypton which comes from kotlin port by Esophose, which comes from a stackoverflow answer.
    • forChunksInRange

      public static void forChunksInRange(@NotNull @NotNull Point point, int range, ChunkRangeUtils.ChunkConsumer consumer)