Stop searching every block to find somewhere to place a block and instead store the last position we placed one. Then, start searching from there next time
Limit the number of block checks we do. Currently, this is set to 1000 (limited to the surface area of the base of the structure). This is so it doesn't lag when all blocks are filled in.
Limit each module to a specific Y-range. Previously, it would run checks from y -64 to y 320. Now, it simply checks where the module is able to place. For Floor, that's (p1.y - 1, p1.y - 1), for Fill, that's (p1.y, p2.y). For flatten, I've changed it to (p1.y - 10, p2.y). This is a breaking change.
I've tested this on a 60 120 120 cuboid and it performs smoothly, unlike the current implementation which slows the game to ~2tps.
However, there seems to be a bug that prevents the NBT data from saving. Loading a world causes the filler to reset. I'm unsure if this was an already-existing issue or something this change caused. I am not sure where or how to fix it.
Additionally, I changed how modules work. I'm not sure why you had special rules for Fill, Delete, Remove, Box, Level, Torch, and Wall, but now they're modules like the rest of them. I also merged onProcessIn/On/UnderRange into just onProcess since there's no need to separate them anymore.
This is my first time modding MC and writing Java, so sorry for any mistakes or dumb errors haha. Lastly, you should maybe go update https://maven.pitan76.net/ with the latest mcpitanlib! I was crashing with hasNbt when trying to get it running!
How does it work?
1000
(limited to the surface area of the base of the structure). This is so it doesn't lag when all blocks are filled in.(p1.y - 1, p1.y - 1)
, for Fill, that's(p1.y, p2.y)
. For flatten, I've changed it to(p1.y - 10, p2.y)
. This is a breaking change.I've tested this on a 60 120 120 cuboid and it performs smoothly, unlike the current implementation which slows the game to ~2tps.
However, there seems to be a bug that prevents the NBT data from saving. Loading a world causes the filler to reset. I'm unsure if this was an already-existing issue or something this change caused. I am not sure where or how to fix it.
Additionally, I changed how modules work. I'm not sure why you had special rules for Fill, Delete, Remove, Box, Level, Torch, and Wall, but now they're modules like the rest of them. I also merged
onProcessIn/On/UnderRange
into justonProcess
since there's no need to separate them anymore.This is my first time modding MC and writing Java, so sorry for any mistakes or dumb errors haha. Lastly, you should maybe go update https://maven.pitan76.net/ with the latest mcpitanlib! I was crashing with
hasNbt
when trying to get it running!Thank you :3