MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / isSpawnChunk

Method isSpawnChunk

src/main/java/net/minecraft/world/World.java:3858–3865  ·  view source on GitHub ↗

Returns true if the chunk is located near the spawn point

(int x, int z)

Source from the content-addressed store, hash-verified

3856 * Returns true if the chunk is located near the spawn point
3857 */
3858 public boolean isSpawnChunk(int x, int z)
3859 {
3860 BlockPos blockpos = this.getSpawnPoint();
3861 int i = x * 16 + 8 - blockpos.getX();
3862 int j = z * 16 + 8 - blockpos.getZ();
3863 int k = 128;
3864 return i >= -k && i <= k && j >= -k && j <= k;
3865 }
3866}

Callers 1

dropChunkMethod · 0.80

Calls 3

getSpawnPointMethod · 0.95
getXMethod · 0.65
getZMethod · 0.65

Tested by

no test coverage detected