mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-25 14:34:44 +00:00
Compare commits
3
Commits
master
...
release/2.9.x
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7be7720fe | ||
|
|
aae90342e5 | ||
|
|
0d13cd0993 |
No files matched your search
@@ -3,9 +3,9 @@ name: Build and test
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master, main ]
|
branches: [ master, main, release/** ]
|
||||||
push:
|
push:
|
||||||
branches: [ master, main ]
|
branches: [ master, main, release/** ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
|
|||||||
@@ -50,14 +50,16 @@ public class BlockUtil {
|
|||||||
|
|
||||||
public static List<Chunk> getChunksInSearchRange(World world, int xCoord, int zCoord, int searchRadius) {
|
public static List<Chunk> getChunksInSearchRange(World world, int xCoord, int zCoord, int searchRadius) {
|
||||||
List<Chunk> searchChunks = new ArrayList<Chunk>();
|
List<Chunk> searchChunks = new ArrayList<Chunk>();
|
||||||
int chunkRange = (int) Math.ceil(searchRadius / 16.0);
|
int minChunkX = (xCoord - searchRadius) >> 4;
|
||||||
int minChunkX = xCoord / 16 - chunkRange;
|
int maxChunkX = (xCoord + searchRadius) >> 4;
|
||||||
int maxChunkX = xCoord / 16 + chunkRange;
|
int minChunkZ = (zCoord - searchRadius) >> 4;
|
||||||
int minChunkZ = zCoord / 16 - chunkRange;
|
int maxChunkZ = (zCoord + searchRadius) >> 4;
|
||||||
int maxChunkZ = zCoord / 16 + chunkRange;
|
|
||||||
|
|
||||||
for (int chunkX = minChunkX; chunkX <= maxChunkX; ++chunkX) {
|
for (int chunkX = minChunkX; chunkX <= maxChunkX; ++chunkX) {
|
||||||
for (int chunkZ = minChunkZ; chunkZ <= maxChunkZ; ++chunkZ) {
|
for (int chunkZ = minChunkZ; chunkZ <= maxChunkZ; ++chunkZ) {
|
||||||
|
if (!world.blockExists(chunkX << 4, 0, chunkZ << 4)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Chunk chunk = world.getChunkFromChunkCoords(chunkX, chunkZ);
|
Chunk chunk = world.getChunkFromChunkCoords(chunkX, chunkZ);
|
||||||
if (chunk != null) searchChunks.add(chunk);
|
if (chunk != null) searchChunks.add(chunk);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user