Skip to content

Commit 0d86f2c

Browse files
authored
Prevent unauthorized players from changing the noteblock sound. (#547)
1 parent d356f90 commit 0d86f2c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mesecons_noteblock/init.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ minetest.register_node("mesecons_noteblock:noteblock", {
33
tiles = {"mesecons_noteblock.png"},
44
is_ground_content = false,
55
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2},
6-
on_punch = function(pos, node) -- change sound when punched
6+
on_punch = function(pos, node, puncher) -- change sound when punched
7+
if minetest.is_protected(pos, puncher and puncher:get_player_name()) then
8+
return
9+
end
10+
711
node.param2 = (node.param2+1)%12
812
mesecon.noteblock_play(pos, node.param2)
913
minetest.set_node(pos, node)

0 commit comments

Comments
 (0)