@@ -305,9 +305,6 @@ function core.item_place_node(itemstack, placer, pointed_thing, param2,
305
305
return itemstack , nil
306
306
end
307
307
308
- log (" action" , playername .. " places node "
309
- .. def .name .. " at " .. core .pos_to_string (place_to ))
310
-
311
308
local oldnode = core .get_node (place_to )
312
309
local newnode = {name = def .name , param1 = 0 , param2 = param2 or 0 }
313
310
@@ -333,7 +330,7 @@ function core.item_place_node(itemstack, placer, pointed_thing, param2,
333
330
z = above .z - placer_pos .z
334
331
}
335
332
newnode .param2 = core .dir_to_facedir (dir )
336
- log (" action " , " facedir: " .. newnode .param2 )
333
+ log (" info " , " facedir: " .. newnode .param2 )
337
334
end
338
335
end
339
336
@@ -364,9 +361,20 @@ function core.item_place_node(itemstack, placer, pointed_thing, param2,
364
361
return itemstack , nil
365
362
end
366
363
364
+ log (" action" , playername .. " places node "
365
+ .. def .name .. " at " .. core .pos_to_string (place_to ))
366
+
367
367
-- Add node and update
368
368
core .add_node (place_to , newnode )
369
369
370
+ -- Play sound if it was done by a player
371
+ if playername ~= " " and def .sounds and def .sounds .place then
372
+ core .sound_play (def .sounds .place , {
373
+ pos = place_to ,
374
+ exclude_player = playername ,
375
+ }, true )
376
+ end
377
+
370
378
local take_item = true
371
379
372
380
-- Run callback
@@ -606,6 +614,14 @@ function core.node_dig(pos, node, digger)
606
614
-- Remove node and update
607
615
core .remove_node (pos )
608
616
617
+ -- Play sound if it was done by a player
618
+ if diggername ~= " " and def .sounds and def .sounds .dug then
619
+ core .sound_play (def .sounds .dug , {
620
+ pos = pos ,
621
+ exclude_player = diggername ,
622
+ }, true )
623
+ end
624
+
609
625
-- Run callback
610
626
if def and def .after_dig_node then
611
627
-- Copy pos and node because callback can modify them
0 commit comments