Package net.minestom.server.coordinate
Class ChunkRange
java.lang.Object
net.minestom.server.coordinate.ChunkRange
Helper class to iterate over chunks within a range.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
chunksCount
(int range) Get the amount of chunks in a square range.static void
chunksInRange
(int chunkX, int chunkZ, int range, ChunkRange.ChunkConsumer consumer) New implementation comes from Krypton which comes from kotlin port by Esophose, which comes from a stackoverflow answer.static void
chunksInRange
(@NotNull Point point, int range, ChunkRange.ChunkConsumer consumer) static void
chunksInRangeDiffering
(int newChunkX, int newChunkZ, int oldChunkX, int oldChunkZ, int range, @NotNull ChunkRange.ChunkConsumer callback) static void
chunksInRangeDiffering
(int newChunkX, int newChunkZ, int oldChunkX, int oldChunkZ, int range, @NotNull ChunkRange.ChunkConsumer newCallback, @NotNull ChunkRange.ChunkConsumer oldCallback)
-
Constructor Details
-
ChunkRange
public ChunkRange()
-
-
Method Details
-
chunksCount
public static int chunksCount(int range) Get the amount of chunks in a square range.- Parameters:
range
- the range- Returns:
- the amount of chunks in the square range
-
chunksInRangeDiffering
public static void chunksInRangeDiffering(int newChunkX, int newChunkZ, int oldChunkX, int oldChunkZ, int range, @NotNull @NotNull ChunkRange.ChunkConsumer callback) -
chunksInRangeDiffering
public static void chunksInRangeDiffering(int newChunkX, int newChunkZ, int oldChunkX, int oldChunkZ, int range, @NotNull @NotNull ChunkRange.ChunkConsumer newCallback, @NotNull @NotNull ChunkRange.ChunkConsumer oldCallback) -
chunksInRange
public static void chunksInRange(int chunkX, int chunkZ, int range, ChunkRange.ChunkConsumer consumer) New implementation comes from Krypton which comes from kotlin port by Esophose, which comes from a stackoverflow answer. -
chunksInRange
public static void chunksInRange(@NotNull @NotNull Point point, int range, ChunkRange.ChunkConsumer consumer)
-