Add a Luacheck configuration file and tweak code style

This commit is contained in:
Hugo Locurcio
2019-02-20 23:56:20 +01:00
parent aa1b2f1b08
commit 74da77fb8c
4 changed files with 100 additions and 17 deletions

View File

@ -56,8 +56,19 @@ minetest.register_tool("maptools:pick_admin_with_drops", {
minetest.register_on_punchnode(function(pos, node, puncher)
if puncher:get_wielded_item():get_name() == "maptools:pick_admin"
and minetest.get_node(pos).name ~= "air" then
minetest.log("action", puncher:get_player_name() .. " digs " .. minetest.get_node(pos).name .. " at " .. minetest.pos_to_string(pos) .. " using an Admin Pickaxe.")
minetest.remove_node(pos) -- The node is removed directly, which means it even works on non-empty containers and group-less nodes.
minetest.check_for_falling(pos) -- Run node update actions like falling nodes.
minetest.log(
"action",
puncher:get_player_name() ..
" digs " ..
minetest.get_node(pos).name ..
" at " ..
minetest.pos_to_string(pos) ..
" using an Admin Pickaxe."
)
-- The node is removed directly, which means it even works
-- on non-empty containers and group-less nodes.
minetest.remove_node(pos)
-- Run node update actions like falling nodes.
minetest.check_for_falling(pos)
end
end)