NoChunkFall - Raspberry Pi REMADE
#1
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
Reply
Thanks given by:
#2
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)
Reply
Thanks given by:
#3
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.
Reply
Thanks given by:
#4
v3 - Now fixes more bugs with wrong chunks being unloaded and uses ChunkStays instead of always ticking chunks
Reply
Thanks given by:
#5
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.
Reply
Thanks given by:
#6
Ah, I guess that would work, nice idea. I'll put that fix in and update it.
Reply
Thanks given by:
#7
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
Reply
Thanks given by:
#8
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.
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)