- pos: (26.8, 8.3, 33.1)
- https://codeberg.org/rudzik8
-
Siberian 15yo Minetest player and modder, MineClone 2 contributor
#nowar
- Joined on
2022-02-18
I know this isn't something that this PR is responsible for, but man would it be nice to add linebreaks to this since you're already modifying that file.
You are adding one more level of nesting for no real reason. I'm not a never nester, but still it's very annoying.
Really you can just do for _, column in ...
, and then assign these local variables by column
. That's much more intuitive since you're working with tables here, and doesn't involve variable shadowing.
So a few lines prior you do #decay_chain
instead of 4
, and then here you hardcode the value. That's a pretty weird inconsistency.
This section is very, very repetitive. You are generating and then returning a table based on the name passed. The name
parameter itself is also very weird, because it apparently can sometimes contain the modname (as with name == "mcl_copper:door"
). Strange cases like that should be resolved outside of this function.
You don't have to check twice for groups.solid
and def.node_box and ...
. These checks are already performed by mcl_autogroup
when assigning solid
to a node. See 026ea5940c/mods/CORE/_mcl_autogroup/init.lua (L322)
This is more for readability reasons, to mark that we are returning top_inv
and bottom_inv
here (hence why all calls to this functions are through local top_inv, bottom_inv = ...
)