summaryrefslogtreecommitdiff
path: root/init.lua
blob: 844e4e61ab7eb9bcaac487934183742049c7dd55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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,
})