diff options
author | cheapie <no-email-for-you@example.com> | 2024-10-02 11:46:12 -0500 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2024-10-02 11:46:12 -0500 |
commit | 50249987378c8715aa2b9ff9be4f4c1be7b227c5 (patch) | |
tree | b76e9eb01cb3e8afc05e5304efe748b850aa73bf | |
download | cb_spill-50249987378c8715aa2b9ff9be4f4c1be7b227c5.tar cb_spill-50249987378c8715aa2b9ff9be4f4c1be7b227c5.tar.gz cb_spill-50249987378c8715aa2b9ff9be4f4c1be7b227c5.tar.bz2 cb_spill-50249987378c8715aa2b9ff9be4f4c1be7b227c5.tar.xz cb_spill-50249987378c8715aa2b9ff9be4f4c1be7b227c5.zip |
Add initial content
-rw-r--r-- | .luacheckrc | 5 | ||||
-rw-r--r-- | init.lua | 15 | ||||
-rw-r--r-- | mod.conf | 3 |
3 files changed, 23 insertions, 0 deletions
diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..3c2038b --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,5 @@ +max_line_length = 160 + +read_globals = { + "minetest", +} diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..844e4e6 --- /dev/null +++ b/init.lua @@ -0,0 +1,15 @@ +local old_after_place = minetest.registered_nodes["mesecons_commandblock:commandblock_off"].after_place_node + +minetest.override_item("mesecons_commandblock:commandblock_off",{ + after_place_node = function(pos,player,...) + 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.") + end + minetest.remove_node(pos) + return true + end + end, +}) diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..a6ea961 --- /dev/null +++ b/mod.conf @@ -0,0 +1,3 @@ +name = cb_spill +depends = mesecons_commandblock +description = Require 'spill' privilege to place mesecons command blocks |