Bukkit/CraftBukkit — comment on commit 19e3eff96a8404fba6e88c147d15d4ad4be1a7f5
File:  line 0
By Majiir:

Forgive me if my math is wrong...

I believe the code here marks any chunks within a 33x33 player-centered grid as "in use", not 21x21 as mentioned in the comments. To my knowledge, the server only loads 17x17 chunks for each player. This means at most 289 chunks are in use by a player, while Bukkit declares 1089 chunks (nearly four times as many!) as in use. The expression should check for bounds within 128 blocks, not 256, to accurately reflect chunk loading behavior.

"This is larger than the distance of loaded chunks that actually surround a player" seems to indicate that this is intentional, but I must wonder why. I'm writing a plugin which uses this function (via `org.bukkit.World.unloadChunkRequest()`), but I end up keeping hundreds of chunks loaded that aren't actually being used. Can @Dinnerbone comment since he wrote the original commit?