Fix invalid function signature for `on_place` callbacks + handling of possible nil value

This commit is contained in:
AFCMS 2022-12-04 18:36:54 +01:00
parent da7e437666
commit 2fa9f9484d
Signed by untrusted user: AFCMS
GPG Key ID: 8720389A25B652E3
1 changed files with 10 additions and 6 deletions

View File

@ -246,9 +246,11 @@ minetest.register_node("mcl_core:realm_barrier", {
_mcl_hardness = -1,
-- Prevent placement to protect player from screwing up the world, because the node is not pointable and hard to get rid of.
node_placement_prediction = "",
on_place = function(pos, placer, itemstack, pointed_thing)
on_place = function(_, placer, _)
if placer then
minetest.chat_send_player(placer:get_player_name(),
minetest.colorize(mcl_colors.RED, "You can't just place a realm barrier by hand!"))
end
return
end,
})
@ -277,9 +279,11 @@ minetest.register_node("mcl_core:void", {
on_blast = function() end,
-- Prevent placement to protect player from screwing up the world, because the node is not pointable and hard to get rid of.
node_placement_prediction = "",
on_place = function(pos, placer, itemstack, pointed_thing)
on_place = function(_, placer, _)
if placer then
minetest.chat_send_player(placer:get_player_name(),
minetest.colorize(mcl_colors.RED, "You can't just place the void by hand!"))
end
return
end,
drop = "",