1
0
mirror of https://codeberg.org/tenplus1/farming.git synced 2024-12-27 11:10:20 +01:00

increase selection box to show crop has matured, fix strawberry plant issue, add step to rhubarb growth

This commit is contained in:
tenplus1 2022-09-15 08:03:41 +01:00
parent 6ac255d4c0
commit 2a41f1e9d5
43 changed files with 92 additions and 41 deletions

View File

@ -46,6 +46,7 @@ minetest.register_node("farming:artichoke_4", table.copy(def))
-- stage 5 (final) -- stage 5 (final)
def.tiles = {"farming_artichoke_5.png"} def.tiles = {"farming_artichoke_5.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:artichoke 2"}, rarity = 1}, {items = {"farming:artichoke 2"}, rarity = 1},

View File

@ -53,6 +53,8 @@ minetest.register_node("farming:asparagus_4", table.copy(def))
-- stage 5 -- stage 5
def.tiles = {"farming_asparagus_5.png"} def.tiles = {"farming_asparagus_5.png"}
def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:asparagus"}, rarity = 1}, {items = {"farming:asparagus"}, rarity = 1},

View File

@ -93,6 +93,7 @@ minetest.register_node("farming:barley_6", table.copy(def))
-- stage 7 (final) -- stage 7 (final)
def.tiles = {"farming_barley_7.png"} def.tiles = {"farming_barley_7.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:barley"}, rarity = 1}, {items = {"farming:barley"}, rarity = 1},

View File

@ -210,6 +210,7 @@ minetest.register_node("farming:beanpole_4", table.copy(def))
-- stage 5 (final) -- stage 5 (final)
def.tiles = {"farming_beanpole_5.png"} def.tiles = {"farming_beanpole_5.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:beanpole"}, rarity = 1}, {items = {"farming:beanpole"}, rarity = 1},

View File

@ -69,6 +69,7 @@ minetest.register_node("farming:beetroot_4", table.copy(def))
-- stage 5 -- stage 5
def.tiles = {"farming_beetroot_5.png"} def.tiles = {"farming_beetroot_5.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
max_items = 4, items = { max_items = 4, items = {
{items = {"farming:beetroot"}, rarity = 1}, {items = {"farming:beetroot"}, rarity = 1},

View File

@ -43,6 +43,7 @@ minetest.register_node("farming:blackberry_3", table.copy(def))
-- stage 4 -- stage 4
def.tiles = {"farming_blackberry_4.png"} def.tiles = {"farming_blackberry_4.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {'farming:blackberry 2'}, rarity = 1}, {items = {'farming:blackberry 2'}, rarity = 1},

View File

@ -80,6 +80,7 @@ minetest.register_node("farming:blueberry_3", table.copy(def))
-- stage 4 (final) -- stage 4 (final)
def.tiles = {"farming_blueberry_4.png"} def.tiles = {"farming_blueberry_4.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:blueberries 2"}, rarity = 1}, {items = {"farming:blueberries 2"}, rarity = 1},

View File

@ -51,6 +51,7 @@ minetest.register_node("farming:cabbage_5", table.copy(def))
-- stage 6 -- stage 6
def.tiles = {"farming_cabbage_6.png"} def.tiles = {"farming_cabbage_6.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
max_items = 2, items = { max_items = 2, items = {
{items = {"farming:cabbage 2"}, rarity = 1}, {items = {"farming:cabbage 2"}, rarity = 1},

View File

@ -103,6 +103,7 @@ minetest.register_node("farming:carrot_7", table.copy(def))
-- stage 8 (final) -- stage 8 (final)
def.tiles = {"farming_carrot_8.png"} def.tiles = {"farming_carrot_8.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:carrot 2"}, rarity = 1}, {items = {"farming:carrot 2"}, rarity = 1},

View File

@ -96,6 +96,7 @@ minetest.register_node("farming:chili_7", table.copy(def))
-- stage 8 (final) -- stage 8 (final)
def.tiles = {"farming_chili_8.png"} def.tiles = {"farming_chili_8.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:chili_pepper 3"}, rarity = 1}, {items = {"farming:chili_pepper 3"}, rarity = 1},

View File

@ -78,6 +78,7 @@ minetest.register_node("farming:coffee_4", table.copy(def))
-- stage 5 (final) -- stage 5 (final)
def.tiles = {"farming_coffee_5.png"} def.tiles = {"farming_coffee_5.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:coffee_beans 2"}, rarity = 1}, {items = {"farming:coffee_beans 2"}, rarity = 1},

View File

@ -159,6 +159,7 @@ minetest.register_node("farming:corn_7", table.copy(def))
-- stage 8 (final) -- stage 8 (final)
def.tiles = {"farming_corn_8.png"} def.tiles = {"farming_corn_8.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:corn 2"}, rarity = 1}, {items = {"farming:corn 2"}, rarity = 1},

View File

@ -156,6 +156,7 @@ minetest.register_node("farming:cotton_7", table.copy(def))
-- stage 8 (final) -- stage 8 (final)
def.tiles = {"farming_cotton_8.png"} def.tiles = {"farming_cotton_8.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:cotton"}, rarity = 1}, {items = {"farming:cotton"}, rarity = 1},

View File

@ -47,6 +47,7 @@ minetest.register_node("farming:cucumber_3", table.copy(def))
-- stage 4 (final) -- stage 4 (final)
def.tiles = {"farming_cucumber_4.png"} def.tiles = {"farming_cucumber_4.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:cucumber 2"}, rarity = 1}, {items = {"farming:cucumber 2"}, rarity = 1},

View File

@ -50,6 +50,7 @@ minetest.register_node("farming:eggplant_3", table.copy(def))
-- stage 4 -- stage 4
def.tiles = {"farming_eggplant_4.png"} def.tiles = {"farming_eggplant_4.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:eggplant 2"}, rarity = 1}, {items = {"farming:eggplant 2"}, rarity = 1},

View File

@ -117,6 +117,7 @@ minetest.register_node("farming:garlic_4", table.copy(def))
-- stage 5 -- stage 5
def.tiles = {"crops_garlic_plant_5.png"} def.tiles = {"crops_garlic_plant_5.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:garlic 3"}, rarity = 1}, {items = {"farming:garlic 3"}, rarity = 1},

View File

@ -217,6 +217,7 @@ minetest.register_node("farming:grapes_7", table.copy(def))
-- stage 8 (final) -- stage 8 (final)
def.tiles = {"farming_grapes_8.png"} def.tiles = {"farming_grapes_8.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:trellis"}, rarity = 1}, {items = {"farming:trellis"}, rarity = 1},

View File

@ -243,6 +243,7 @@ minetest.register_node("farming:hemp_7", table.copy(def))
-- stage 8 (final) -- stage 8 (final)
def.tiles = {"farming_hemp_8.png"} def.tiles = {"farming_hemp_8.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:hemp_leaf 2"}, rarity = 1}, {items = {"farming:hemp_leaf 2"}, rarity = 1},

View File

@ -45,6 +45,7 @@ minetest.register_node("farming:lettuce_4", table.copy(def))
-- stage 5 -- stage 5
def.tiles = {"farming_lettuce_5.png"} def.tiles = {"farming_lettuce_5.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {'farming:lettuce 2'}, rarity = 1}, {items = {'farming:lettuce 2'}, rarity = 1},

View File

@ -79,7 +79,7 @@ minetest.register_node("farming:melon_8", {
"farming_melon_side.png" "farming_melon_side.png"
}, },
groups = { groups = {
food_melon = 1, snappy = 2, oddly_breakable_by_hand = 1, food_melon = 1, snappy = 3, choppy = 3, oddly_breakable_by_hand = 2,
flammable = 2, plant = 1 flammable = 2, plant = 1
}, },
drop = "farming:melon_8", drop = "farming:melon_8",

View File

@ -69,6 +69,7 @@ minetest.register_node("farming:mint_3", table.copy(def))
-- stage 4 (final) -- stage 4 (final)
def.tiles = {"farming_mint_4.png"} def.tiles = {"farming_mint_4.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:mint_leaf 2"}, rarity = 1}, {items = {"farming:mint_leaf 2"}, rarity = 1},

View File

@ -74,6 +74,7 @@ minetest.register_node("farming:onion_4", table.copy(def))
-- stage 5 -- stage 5
def.tiles = {"crops_onion_plant_5.png"} def.tiles = {"crops_onion_plant_5.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
max_items = 5, items = { max_items = 5, items = {
{items = {"farming:onion"}, rarity = 1}, {items = {"farming:onion"}, rarity = 1},

View File

@ -37,6 +37,7 @@ minetest.register_node("farming:parsley_2", table.copy(def))
-- stage 3 (final) -- stage 3 (final)
def.tiles = {"farming_parsley_3.png"} def.tiles = {"farming_parsley_3.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:parsley 2"}, rarity = 1}, {items = {"farming:parsley 2"}, rarity = 1},

View File

@ -71,6 +71,7 @@ minetest.register_node("farming:pea_4", table.copy(def))
-- stage 5 -- stage 5
def.tiles = {"farming_pea_5.png"} def.tiles = {"farming_pea_5.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
max_items = 5, items = { max_items = 5, items = {
{items = {"farming:pea_pod"}, rarity = 1}, {items = {"farming:pea_pod"}, rarity = 1},

View File

@ -113,6 +113,7 @@ minetest.register_node("farming:pepper_4", table.copy(def))
-- stage 5 (green pepper) -- stage 5 (green pepper)
def.tiles = {"crops_pepper_plant_5.png"} def.tiles = {"crops_pepper_plant_5.png"}
def.selection_box = farming.select_final
def.drop = { def.drop = {
max_items = 2, items = { max_items = 2, items = {
{items = {"farming:pepper 2"}, rarity = 1}, {items = {"farming:pepper 2"}, rarity = 1},

View File

@ -123,6 +123,7 @@ minetest.register_node("farming:pineapple_7", table.copy(def))
-- stage 8 (final) -- stage 8 (final)
def.tiles = {"farming_pineapple_8.png"} def.tiles = {"farming_pineapple_8.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:pineapple"}, rarity = 1}, {items = {"farming:pineapple"}, rarity = 1},

View File

@ -94,6 +94,7 @@ minetest.register_node("farming:potato_3", table.copy(def))
-- stage 4 -- stage 4
def.tiles = {"farming_potato_4.png"} def.tiles = {"farming_potato_4.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:potato 2"}, rarity = 1}, {items = {"farming:potato 2"}, rarity = 1},

View File

@ -39,7 +39,7 @@ minetest.register_node("farming:jackolantern", {
"farming_pumpkin_side.png", "farming_pumpkin_face_off.png" "farming_pumpkin_side.png", "farming_pumpkin_face_off.png"
}, },
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {choppy = 1, oddly_breakable_by_hand = 1, flammable = 2}, groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
on_punch = function(pos, node, puncher) on_punch = function(pos, node, puncher)
local name = puncher:get_player_name() or "" local name = puncher:get_player_name() or ""
@ -58,7 +58,7 @@ minetest.register_node("farming:jackolantern_on", {
light_source = default.LIGHT_MAX - 1, light_source = default.LIGHT_MAX - 1,
paramtype2 = "facedir", paramtype2 = "facedir",
groups = { groups = {
choppy = 1, oddly_breakable_by_hand = 1, flammable = 2, snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2,
not_in_creative_inventory = 1 not_in_creative_inventory = 1
}, },
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
@ -187,7 +187,7 @@ minetest.register_node("farming:pumpkin_8", {
"farming_pumpkin_side.png" "farming_pumpkin_side.png"
}, },
groups = { groups = {
food_pumpkin = 1, choppy = 2, oddly_breakable_by_hand = 1, food_pumpkin = 1, snappy = 3, choppy = 3, oddly_breakable_by_hand = 2,
flammable = 2, plant = 1 flammable = 2, plant = 1
}, },
drop = "farming:pumpkin_8", drop = "farming:pumpkin_8",

View File

@ -61,6 +61,7 @@ minetest.register_node("farming:raspberry_3", table.copy(def))
-- stage 4 (final) -- stage 4 (final)
def.tiles = {"farming_raspberry_4.png"} def.tiles = {"farming_raspberry_4.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:raspberries 2"}, rarity = 1}, {items = {"farming:raspberries 2"}, rarity = 1},

View File

@ -55,9 +55,14 @@ minetest.register_node("farming:rhubarb_1", table.copy(def))
def.tiles = {"farming_rhubarb_2.png"} def.tiles = {"farming_rhubarb_2.png"}
minetest.register_node("farming:rhubarb_2", table.copy(def)) minetest.register_node("farming:rhubarb_2", table.copy(def))
-- stage 3 (final) -- stage3
def.tiles = {"farming_rhubarb_3.png"} def.tiles = {"farming_rhubarb_3.png"}
minetest.register_node("farming:rhubarb_3", table.copy(def))
-- stage 4 (final)
def.tiles = {"farming_rhubarb_4.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:rhubarb 2"}, rarity = 1}, {items = {"farming:rhubarb 2"}, rarity = 1},
@ -65,7 +70,7 @@ def.drop = {
{items = {"farming:rhubarb"}, rarity = 3} {items = {"farming:rhubarb"}, rarity = 3}
} }
} }
minetest.register_node("farming:rhubarb_3", table.copy(def)) minetest.register_node("farming:rhubarb_4", table.copy(def))
-- add to registered_plants -- add to registered_plants
farming.registered_plants["farming:rhubarb"] = { farming.registered_plants["farming:rhubarb"] = {
@ -73,7 +78,7 @@ farming.registered_plants["farming:rhubarb"] = {
seed = "farming:rhubarb", seed = "farming:rhubarb",
minlight = 10, minlight = 10,
maxlight = 12, maxlight = 12,
steps = 3 steps = 4
} }
-- mapgen -- mapgen

View File

@ -108,6 +108,7 @@ minetest.register_node("farming:rice_7", table.copy(def))
-- stage 8 (final) -- stage 8 (final)
def.tiles = {"farming_rice_8.png"} def.tiles = {"farming_rice_8.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:rice 2"}, rarity = 1}, {items = {"farming:rice 2"}, rarity = 1},

View File

@ -171,6 +171,7 @@ minetest.register_node("farming:soy_6", table.copy(def))
-- stage 7 -- stage 7
def.tiles = {"farming_soy_7.png"} def.tiles = {"farming_soy_7.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
max_items = 5, items = { max_items = 5, items = {
{items = {"farming:soy_pod"}, rarity = 1}, {items = {"farming:soy_pod"}, rarity = 1},

View File

@ -50,6 +50,7 @@ minetest.register_node("farming:spinach_3", table.copy(def))
-- stage 4 -- stage 4
def.tiles = {"farming_spinach_4.png"} def.tiles = {"farming_spinach_4.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:spinach 2"}, rarity = 1}, {items = {"farming:spinach 2"}, rarity = 1},

View File

@ -2,19 +2,22 @@
local S = farming.intllib local S = farming.intllib
-- Strawberry (can also be planted as seed) -- Strawberry (can also be planted as seed)
minetest.register_craftitem(":ethereal:strawberry", { minetest.register_craftitem("farming:strawberry", {
description = S("Strawberry"), description = S("Strawberry"),
inventory_image = "ethereal_strawberry.png", inventory_image = "ethereal_strawberry.png",
wield_image = "ethereal_strawberry.png", groups = {seed = 2, food_strawberry = 1, food_berry = 1, flammable = 2},
groups = {food_strawberry = 1, food_berry = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "ethereal:strawberry_1") return farming.place_seed(itemstack, placer, pointed_thing, "ethereal:strawberry_1")
end, end,
on_use = minetest.item_eat(1) on_use = minetest.item_eat(1)
}) })
-- weird engine bug stops us from using on_place for ethereal: item when mod not active
-- so instead use farming:strawberry and do quick alias for compatibility.
minetest.register_alias("farming:strawberry", "ethereal:strawberry")
-- Define Strawberry Bush growth stages -- Define Strawberry Bush growth stages
local crop_def = { local def = {
drawtype = "plantlike", drawtype = "plantlike",
tiles = {"ethereal_strawberry_1.png"}, tiles = {"ethereal_strawberry_1.png"},
paramtype = "light", paramtype = "light",
@ -35,59 +38,60 @@ local crop_def = {
} }
--stage 1 --stage 1
minetest.register_node(":ethereal:strawberry_1", table.copy(crop_def)) minetest.register_node(":ethereal:strawberry_1", table.copy(def))
-- stage 2 -- stage 2
crop_def.tiles = {"ethereal_strawberry_2.png"} def.tiles = {"ethereal_strawberry_2.png"}
minetest.register_node(":ethereal:strawberry_2", table.copy(crop_def)) minetest.register_node(":ethereal:strawberry_2", table.copy(def))
-- stage 3 -- stage 3
crop_def.tiles = {"ethereal_strawberry_3.png"} def.tiles = {"ethereal_strawberry_3.png"}
minetest.register_node(":ethereal:strawberry_3", table.copy(crop_def)) minetest.register_node(":ethereal:strawberry_3", table.copy(def))
-- stage 4 -- stage 4
crop_def.tiles = {"ethereal_strawberry_4.png"} def.tiles = {"ethereal_strawberry_4.png"}
minetest.register_node(":ethereal:strawberry_4", table.copy(crop_def)) minetest.register_node(":ethereal:strawberry_4", table.copy(def))
-- stage 5 -- stage 5
crop_def.tiles = {"ethereal_strawberry_5.png"} def.tiles = {"ethereal_strawberry_5.png"}
minetest.register_node(":ethereal:strawberry_5", table.copy(crop_def)) minetest.register_node(":ethereal:strawberry_5", table.copy(def))
-- stage 6 -- stage 6
crop_def.tiles = {"ethereal_strawberry_6.png"} def.tiles = {"ethereal_strawberry_6.png"}
crop_def.drop = { def.drop = {
items = { items = {
{items = {"ethereal:strawberry 1"}, rarity = 2}, {items = {"farming:strawberry 1"}, rarity = 2},
{items = {"ethereal:strawberry 2"}, rarity = 3} {items = {"farming:strawberry 2"}, rarity = 3}
} }
} }
minetest.register_node(":ethereal:strawberry_6", table.copy(crop_def)) minetest.register_node(":ethereal:strawberry_6", table.copy(def))
-- stage 7 -- stage 7
crop_def.tiles = {"ethereal_strawberry_7.png"} def.tiles = {"ethereal_strawberry_7.png"}
crop_def.drop = { def.drop = {
items = { items = {
{items = {"ethereal:strawberry 1"}, rarity = 1}, {items = {"farming:strawberry 1"}, rarity = 1},
{items = {"ethereal:strawberry 2"}, rarity = 3} {items = {"farming:strawberry 2"}, rarity = 3}
} }
} }
minetest.register_node(":ethereal:strawberry_7", table.copy(crop_def)) minetest.register_node(":ethereal:strawberry_7", table.copy(def))
-- stage 8 -- stage 8
crop_def.tiles = {"ethereal_strawberry_8.png"} def.tiles = {"ethereal_strawberry_8.png"}
crop_def.groups.growing = nil def.groups.growing = nil
crop_def.drop = { def.selection_box = farming.select_final
def.drop = {
items = { items = {
{items = {"ethereal:strawberry 2"}, rarity = 1}, {items = {"farming:strawberry 2"}, rarity = 1},
{items = {"ethereal:strawberry 3"}, rarity = 3} {items = {"farming:strawberry 3"}, rarity = 3}
} }
} }
minetest.register_node(":ethereal:strawberry_8", table.copy(crop_def)) minetest.register_node(":ethereal:strawberry_8", table.copy(def))
-- add to registered_plants -- add to registered_plants
farming.registered_plants["ethereal:strawberry"] = { farming.registered_plants["ethereal:strawberry"] = {
crop = "ethereal:strawberry", crop = "farming:strawberry",
seed = "ethereal:strawberry", seed = "farming:strawberry",
minlight = farming.min_light, minlight = farming.min_light,
maxlight = farming.max_light, maxlight = farming.max_light,
steps = 8 steps = 8
@ -108,5 +112,5 @@ minetest.register_decoration({
}, },
y_min = 20, y_min = 20,
y_max = 55, y_max = 55,
decoration = "farming:strawberry_7" decoration = "ethereal:strawberry_7"
}) })

View File

@ -137,6 +137,7 @@ minetest.register_node("farming:sunflower_7", table.copy(def))
-- stage 8 (final) -- stage 8 (final)
def.tiles = {"farming_sunflower_8.png"} def.tiles = {"farming_sunflower_8.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:sunflower"}, rarity = 1}, {items = {"farming:sunflower"}, rarity = 1},

View File

@ -87,6 +87,7 @@ minetest.register_node("farming:tomato_7", table.copy(def))
-- stage 8 (final) -- stage 8 (final)
def.tiles = {"farming_tomato_8.png"} def.tiles = {"farming_tomato_8.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:tomato 3"}, rarity = 1}, {items = {"farming:tomato 3"}, rarity = 1},

View File

@ -102,6 +102,7 @@ minetest.register_node("farming:vanilla_7", table.copy(def))
-- stage 8 (final) -- stage 8 (final)
def.tiles = {"farming_vanilla_8.png"} def.tiles = {"farming_vanilla_8.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:vanilla 2"}, rarity = 1}, {items = {"farming:vanilla 2"}, rarity = 1},

View File

@ -216,6 +216,7 @@ minetest.register_node("farming:wheat_7", table.copy(def))
-- stage 8 (final) -- stage 8 (final)
def.tiles = {"farming_wheat_8.png"} def.tiles = {"farming_wheat_8.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = { def.drop = {
items = { items = {
{items = {"farming:wheat"}, rarity = 1}, {items = {"farming:wheat"}, rarity = 1},

View File

@ -7,12 +7,16 @@
farming = { farming = {
mod = "redo", mod = "redo",
version = "20220913", version = "20220915",
path = minetest.get_modpath("farming"), path = minetest.get_modpath("farming"),
select = { select = {
type = "fixed", type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5} fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
}, },
select_final = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -2.5/16, 0.5}
},
registered_plants = {}, registered_plants = {},
min_light = 12, min_light = 12,
max_light = 15, max_light = 15,
@ -575,13 +579,16 @@ farming.register_plant = function(name, def)
} }
} }
local sel = farming.select
local g = { local g = {
snappy = 3, flammable = 2, plant = 1, growing = 1, snappy = 3, flammable = 2, plant = 1, growing = 1,
attached_node = 1, not_in_creative_inventory = 1, attached_node = 1, not_in_creative_inventory = 1,
} }
-- Last step doesn't need growing=1 so Abm never has to check these -- Last step doesn't need growing=1 so Abm never has to check these
-- also increase selection box for visual indication plant has matured
if i == def.steps then if i == def.steps then
sel = farming.select_final
g.growing = 0 g.growing = 0
end end
@ -604,7 +611,7 @@ farming.register_plant = function(name, def)
buildable_to = true, buildable_to = true,
sunlight_propagates = true, sunlight_propagates = true,
drop = drop, drop = drop,
selection_box = farming.select, selection_box = sel,
groups = g, groups = g,
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
minlight = def.minlight, minlight = def.minlight,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 B

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 B

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B