Package net.minestom.server.coordinate
Class ChunkRangeUtils
java.lang.Object
net.minestom.server.coordinate.ChunkRangeUtils
Helper class to iterate over chunks within a range.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intchunkCountFromRange(int range) Get the amount of chunks in a square range.static voidforChunksInRange(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.static voidforChunksInRange(@NotNull Point point, int range, ChunkRangeUtils.ChunkConsumer consumer) static voidforDifferingChunksInRange(int newChunkX, int newChunkZ, int oldChunkX, int oldChunkZ, int range, @NotNull ChunkRangeUtils.ChunkConsumer callback) static voidforDifferingChunksInRange(int newChunkX, int newChunkZ, int oldChunkX, int oldChunkZ, int range, @NotNull ChunkRangeUtils.ChunkConsumer newCallback, @NotNull ChunkRangeUtils.ChunkConsumer oldCallback)
-
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)
-