generated from your-land/yl_template
46 lines
1.1 KiB
Lua
46 lines
1.1 KiB
Lua
-- log
|
|
--
|
|
local function log(text)
|
|
local logmessage = yl_api_nodestages.t("log_prefix",
|
|
yl_api_nodestages.modname, text)
|
|
if (yl_api_nodestages.settings.debug == true) then
|
|
minetest.log("action", logmessage)
|
|
end
|
|
return logmessage
|
|
end
|
|
|
|
function yl_api_nodestages.log(text) return log(text) end
|
|
|
|
-- get_node_definition
|
|
--
|
|
|
|
local function get_node_definition()
|
|
local t = {
|
|
drawtype = "plantlike",
|
|
paramtype = "light",
|
|
is_ground_content = false,
|
|
walkable = false,
|
|
selection_box = {
|
|
type = "fixed",
|
|
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
|
|
},
|
|
groups = {
|
|
attached_node = 1,
|
|
dig_immediate = 3,
|
|
canned_food = 1,
|
|
vessel = 1
|
|
}
|
|
}
|
|
return t
|
|
end
|
|
|
|
function yl_canned_food.get_node_definition() return get_node_definition() end
|
|
|
|
local function can_set(pos)
|
|
local light = minetest.get_node_light(pos)
|
|
if (light and light > 5) then return false end
|
|
return true
|
|
end
|
|
|
|
function yl_canned_food.can_set(pos) return can_set(pos) end
|