Adds preconditions

This commit is contained in:
AliasAlreadyTaken 2024-07-02 22:53:01 +02:00
parent 6467bd7f7e
commit 219a886ab4
2 changed files with 16 additions and 4 deletions

View File

@ -19,3 +19,15 @@ local function get_node_definition()
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

View File

@ -24,10 +24,10 @@ table.insert(stages, {
duration = 10,
--duration = "10",
next_stages = {
{ "yl_canned_food:melon_jam_3", 50 },
{ "yl_canned_food:melon_jam_4", 50 },
{ "default:cobble", 50 }
},
{ "yl_canned_food:melon_jam_3", 50, yl_canned_food.can_set},
{ "yl_canned_food:melon_jam_4", 50},
{ "default:cobble", 50, yl_canned_food.can_set}
},
--node definition
tiles = {"yl_canned_food_melon_jam_2.png"},
description = "Awesome melon jam Stage 2",