Package: Large Bricks
So i like this mod. But it has a problem where players are able to place large bricks in protected areas.
I made a fix myself. If there was a Git repo i would submit a pull request.
Basically i use the after_place_node func instead of on_place.
This is better because it happens after the node is placed and only if its allowed to be placed in the area.
if you change
on_place = function(itemstack, placer, pointed_thing)
to
after_place_node = function(pos, placer, itemstack, pointed_thing)
You can also remove a few lines of code after making this change. the line
if not minetest.settings:get_bool("creative_mode") then itemstack:take_item() end
and
return itemstack
can be removed as that is handled by the default on_place function.
and instead of using pointed_thing.above, you can use the pos parameter.
Thank you for the feedback. I have implemented your suggested change in the latest version (v1.1).
So i like this mod. But it has a problem where players are able to place large bricks in protected areas.
I made a fix myself. If there was a Git repo i would submit a pull request.
Basically i use the after_place_node func instead of on_place.
This is better because it happens after the node is placed and only if its allowed to be placed in the area.
if you change
to
You can also remove a few lines of code after making this change. the line
and
can be removed as that is handled by the default on_place function.
and instead of using pointed_thing.above, you can use the pos parameter.
Thank you for the feedback. I have implemented your suggested change in the latest version (v1.1).