Closed algj closed 4 years ago
bot.on('chunkColumnUnload',(point)=>{
console.log(point);
})
// output:
// Vec3 { x: NaN, y: 0, z: NaN }
This is weird. delColumn gets undefined chunkX, chunkY.
I'll do a PR.
In 1.12, the x/z values are names chunkX, chunkZ: https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.12.2/protocol.json#L1478 It needs to be fixed here https://github.com/PrismarineJS/mineflayer/blob/master/lib/plugins/blocks.js#L262 But first, check if it was always missnamed, or if it change from one version to an other.
Edit: I checked, it seems the unload_chunk packet was introduced in 1.9 and already used chunkX/chunkZ 1.8 doesnt seems to have an unload packet.
Made a PR. I wonder how this problem was unnoticed for so long?
I guess people don't move their bot around that much. If you don't look for it it'll get noticable only if you load like 10x the view size. You'd have to do something a bit special (auto exploration I guess) to get to this point
Thanks for finding and fixing this bug !
On Fri, Jul 10, 2020, 16:53 Alg notifications@github.com wrote:
Made a PR. I wonder how this problem was unnoticed for so long?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PrismarineJS/mineflayer/issues/1123#issuecomment-656717632, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR437V2CT2M7T7CLHSFOQLR24TO5ANCNFSM4OV5TXQA .
must have missed it when i wrote that, my bad :disappointed_relieved:
thanks
Versions
Detailed description of a problem
Memory leak when traveling, chunks don't unload. Node.js will crash if you load too many chunks.
Current code
Expected behavior
Unload chunks when bot is out of rendering distance.
Additional context
I manually teleported bot around the world just to make sure that it wasn't some bug in my code. I noticed that heap memory doesn't go lower.