mirror of
https://github.com/mt-mods/plantlife_modpack.git
synced 2025-07-15 06:10:40 +02:00
add nil checks to on_place
This commit is contained in:
@ -1,5 +1,3 @@
|
|||||||
cavestuff = {}
|
|
||||||
|
|
||||||
dofile(minetest.get_modpath("cavestuff").."/nodes.lua")
|
dofile(minetest.get_modpath("cavestuff").."/nodes.lua")
|
||||||
dofile(minetest.get_modpath("cavestuff").."/mapgen.lua")
|
dofile(minetest.get_modpath("cavestuff").."/mapgen.lua")
|
||||||
|
|
||||||
|
@ -155,5 +155,3 @@ minetest.register_node("cavestuff:stalactite_3",{
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
--Stalagmites
|
|
||||||
|
@ -46,6 +46,10 @@ minetest.register_node("dryplants:juncus", {
|
|||||||
fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16},
|
fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16},
|
||||||
},
|
},
|
||||||
on_place = function(itemstack, placer, pointed_thing)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
|
if not itemstack or not placer or not pointed_thing then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local playername = placer:get_player_name()
|
local playername = placer:get_player_name()
|
||||||
if minetest.is_protected(pointed_thing.above, playername) or
|
if minetest.is_protected(pointed_thing.above, playername) or
|
||||||
minetest.is_protected(pointed_thing.under, playername) then
|
minetest.is_protected(pointed_thing.under, playername) then
|
||||||
|
@ -47,7 +47,11 @@ for i in ipairs(algae_list) do
|
|||||||
liquids_pointable = true,
|
liquids_pointable = true,
|
||||||
drop = "flowers:seaweed",
|
drop = "flowers:seaweed",
|
||||||
on_place = function(itemstack, placer, pointed_thing)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
local keys=placer:get_player_control()
|
if not itemstack or not placer or not pointed_thing then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local keys = placer:get_player_control()
|
||||||
local pt = pointed_thing
|
local pt = pointed_thing
|
||||||
|
|
||||||
local place_pos = nil
|
local place_pos = nil
|
||||||
|
@ -59,7 +59,11 @@ for i in ipairs(lilies_list) do
|
|||||||
liquids_pointable = true,
|
liquids_pointable = true,
|
||||||
drop = "flowers:waterlily",
|
drop = "flowers:waterlily",
|
||||||
on_place = function(itemstack, placer, pointed_thing)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
local keys=placer:get_player_control()
|
if not itemstack or not placer or not pointed_thing then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local keys = placer:get_player_control()
|
||||||
local pt = pointed_thing
|
local pt = pointed_thing
|
||||||
|
|
||||||
local place_pos = nil
|
local place_pos = nil
|
||||||
|
Reference in New Issue
Block a user