Cuberite Forum

Full Version: NoChunkFall - Raspberry Pi REMADE
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Well, the old thread was deleted, don't really know why but I rewrote this plugin.
Its MUCH better and I actually had a chance to test it a bit.

It uses tables and chunk hooks instead of spamming World:TryGetHeight() and the code is much easier to understand.

Download: https://github.com/DevToaster/NoChunkFal...master.zip

GitHub repo: https://github.com/DevToaster/NoChunkFall
You could replace these 9 calls in OnWorldInitialised(World) with two for loops:
Code:
for i in -1 ... 1 do
   for j in -1 ... 1 do
        World:SetChunkAlwaysTicked(World:GetSpawnX() / 16 + i, World:GetSpawnZ() / 16 + j, true)
   end
end
* (Mostlikely not a piece of working lua code)
I don't think the SetChunkAlwaysTicked() will keep the chunks loaded; if it does now, it is a bug that may be fixed. The proper way of doing this is to use the HOOK_CHUNK_UNLOADING hook ( http://mc-server.xoft.cz/LuaAPI/OnChunkUnloading.html ) and disallow the unloading of the correct chunks.
v3 - Now fixes more bugs with wrong chunks being unloaded and uses ChunkStays instead of always ticking chunks
Something like:
Code:
for i = -1, 1 do
  for j = -1, 1 do
      table.insert(SpawnChunks[World:GetName()], {World:GetSpawnX() / 16 + i, World:GetSpawnZ() / 16 + j})
  end
end
should do the trick as well.
Ah, I guess that would work, nice idea. I'll put that fix in and update it.
When enabling the plugin I am not able to move anymore?!
What am I doing wrong?

Edit:
Nevermind....
The error occures when enabling the plugin while standing on the floor (well, at least on my installation).
After killing myself everything is ok Wink
The plugin doesn't handle reloads properly, you have to restart the server to make it work. That way, every loaded chunk is kept in memory.