====== OnChunkUnloading hook callback function ======
MCServer calls this function when a chunk is about to be unloaded from the memory. A plugin may force MCServer to keep the chunk in memory by returning true.

FIXME: The return value should be used only for event propagation stopping, not for the actual decision whether to unload.

===== Function signature =====
<code lua>
function OnChunkUnloading(World, ChunkX, ChunkZ)
</code>
Parameters:
| World | [[API::cWorld|cWorld]] | The world to which the chunk belongs |
| ChunkX | number | X-coord of the chunk |
| ChunkZ | number | Z-coord of the chunk |

===== Return values =====
If the function returns false or no value, the next plugin's callback is called and finally MCServer unloads the chunk. If the function returns true, no other callback is called for this event and the chunk is left in the memory.

===== Registering the callback =====
To register your plugin to receive a callback through this function, use the hook [[api:plugin:hooks|HOOK_CHUNK_UNLOADING]]
<code lua>
cPluginManager:Get():AddHook(Plugin, cPluginManager.HOOK_CHUNK_UNLOADING);
</code>