Cuberite Forum
NoChunkFall - Raspberry Pi REMADE - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Releases (https://forum.cuberite.org/forum-2.html)
+---- Forum: Archived Plugins (https://forum.cuberite.org/forum-18.html)
+---- Thread: NoChunkFall - Raspberry Pi REMADE (/thread-1802.html)



NoChunkFall - Raspberry Pi REMADE - DiamondToaster - 02-22-2015

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/NoChunkFall/archive/master.zip

GitHub repo: https://github.com/DevToaster/NoChunkFall


RE: NoChunkFall - Raspberry Pi REMADE - jan64 - 02-22-2015

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)


RE: NoChunkFall - Raspberry Pi REMADE - xoft - 02-22-2015

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.


RE: NoChunkFall - Raspberry Pi REMADE - DiamondToaster - 02-23-2015

v3 - Now fixes more bugs with wrong chunks being unloaded and uses ChunkStays instead of always ticking chunks


RE: NoChunkFall - Raspberry Pi REMADE - jan64 - 02-23-2015

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.


RE: NoChunkFall - Raspberry Pi REMADE - DiamondToaster - 02-24-2015

Ah, I guess that would work, nice idea. I'll put that fix in and update it.


RE: NoChunkFall - Raspberry Pi REMADE - Pixelfanatic - 05-16-2015

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


RE: NoChunkFall - Raspberry Pi REMADE - DiamondToaster - 05-17-2015

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.