summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2024-10-02 12:48:15 -0500
committercheapie <no-email-for-you@example.com>2024-10-02 12:48:15 -0500
commit039d66fa659c4f9bcc8cecde6ec63f7c97f757c8 (patch)
treeba170e66479464e7215274632c28014ac82e304f
parent718b8bdeff910106b8e5a8a105120099f922f72b (diff)
downloadcb_spill-main.tar
cb_spill-main.tar.gz
cb_spill-main.tar.bz2
cb_spill-main.tar.xz
cb_spill-main.zip
Log when placement is prohibitedHEADmain
-rw-r--r--init.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index 844e4e6..947294f 100644
--- a/init.lua
+++ b/init.lua
@@ -2,12 +2,15 @@ local old_after_place = minetest.registered_nodes["mesecons_commandblock:command
minetest.override_item("mesecons_commandblock:commandblock_off",{
after_place_node = function(pos,player,...)
+ local name = player:get_player_name()
if minetest.check_player_privs(player,"spill") then
return old_after_place(pos,player,...)
else
if not player.is_fake_player then
- minetest.chat_send_player(player:get_player_name(),"You need the 'spill' privilege to use this.")
+ minetest.chat_send_player(name,"You need the 'spill' privilege to use this.")
end
+ local message = string.format("%s was blocked from placing a command block at %s",name,minetest.pos_to_string(pos))
+ minetest.log("action",message)
minetest.remove_node(pos)
return true
end