1
0
mirror of https://codeberg.org/tenplus1/farming.git synced 2024-12-26 18:50: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)
def.tiles = {"farming_artichoke_5.png"}
def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = {
items = {
{items = {"farming:artichoke 2"}, rarity = 1},

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -96,6 +96,7 @@ minetest.register_node("farming:chili_7", table.copy(def))
-- stage 8 (final)
def.tiles = {"farming_chili_8.png"}
def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = {
items = {
{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)
def.tiles = {"farming_coffee_5.png"}
def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = {
items = {
{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)
def.tiles = {"farming_corn_8.png"}
def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = {
items = {
{items = {"farming:corn 2"}, rarity = 1},

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -79,7 +79,7 @@ minetest.register_node("farming:melon_8", {
"farming_melon_side.png"
},
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
},
drop = "farming:melon_8",

View File

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

View File

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

View File

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

View File

@ -71,6 +71,7 @@ minetest.register_node("farming:pea_4", table.copy(def))
-- stage 5
def.tiles = {"farming_pea_5.png"}
def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = {
max_items = 5, items = {
{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)
def.tiles = {"crops_pepper_plant_5.png"}
def.selection_box = farming.select_final
def.drop = {
max_items = 2, items = {
{items = {"farming:pepper 2"}, rarity = 1},

View File

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

View File

@ -94,6 +94,7 @@ minetest.register_node("farming:potato_3", table.copy(def))
-- stage 4
def.tiles = {"farming_potato_4.png"}
def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = {
items = {
{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"
},
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(),
on_punch = function(pos, node, puncher)
local name = puncher:get_player_name() or ""
@ -58,7 +58,7 @@ minetest.register_node("farming:jackolantern_on", {
light_source = default.LIGHT_MAX - 1,
paramtype2 = "facedir",
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
},
sounds = default.node_sound_wood_defaults(),
@ -187,7 +187,7 @@ minetest.register_node("farming:pumpkin_8", {
"farming_pumpkin_side.png"
},
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
},
drop = "farming:pumpkin_8",

View File

@ -61,6 +61,7 @@ minetest.register_node("farming:raspberry_3", table.copy(def))
-- stage 4 (final)
def.tiles = {"farming_raspberry_4.png"}
def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = {
items = {
{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"}
minetest.register_node("farming:rhubarb_2", table.copy(def))
-- stage 3 (final)
-- stage3
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.selection_box = farming.select_final
def.drop = {
items = {
{items = {"farming:rhubarb 2"}, rarity = 1},
@ -65,7 +70,7 @@ def.drop = {
{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
farming.registered_plants["farming:rhubarb"] = {
@ -73,7 +78,7 @@ farming.registered_plants["farming:rhubarb"] = {
seed = "farming:rhubarb",
minlight = 10,
maxlight = 12,
steps = 3
steps = 4
}
-- mapgen

View File

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

View File

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

View File

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

View File

@ -2,19 +2,22 @@
local S = farming.intllib
-- Strawberry (can also be planted as seed)
minetest.register_craftitem(":ethereal:strawberry", {
minetest.register_craftitem("farming:strawberry", {
description = S("Strawberry"),
inventory_image = "ethereal_strawberry.png",
wield_image = "ethereal_strawberry.png",
groups = {food_strawberry = 1, food_berry = 1, flammable = 2},
groups = {seed = 2, food_strawberry = 1, food_berry = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "ethereal:strawberry_1")
end,
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
local crop_def = {
local def = {
drawtype = "plantlike",
tiles = {"ethereal_strawberry_1.png"},
paramtype = "light",
@ -35,59 +38,60 @@ local crop_def = {
}
--stage 1
minetest.register_node(":ethereal:strawberry_1", table.copy(crop_def))
minetest.register_node(":ethereal:strawberry_1", table.copy(def))
-- stage 2
crop_def.tiles = {"ethereal_strawberry_2.png"}
minetest.register_node(":ethereal:strawberry_2", table.copy(crop_def))
def.tiles = {"ethereal_strawberry_2.png"}
minetest.register_node(":ethereal:strawberry_2", table.copy(def))
-- stage 3
crop_def.tiles = {"ethereal_strawberry_3.png"}
minetest.register_node(":ethereal:strawberry_3", table.copy(crop_def))
def.tiles = {"ethereal_strawberry_3.png"}
minetest.register_node(":ethereal:strawberry_3", table.copy(def))
-- stage 4
crop_def.tiles = {"ethereal_strawberry_4.png"}
minetest.register_node(":ethereal:strawberry_4", table.copy(crop_def))
def.tiles = {"ethereal_strawberry_4.png"}
minetest.register_node(":ethereal:strawberry_4", table.copy(def))
-- stage 5
crop_def.tiles = {"ethereal_strawberry_5.png"}
minetest.register_node(":ethereal:strawberry_5", table.copy(crop_def))
def.tiles = {"ethereal_strawberry_5.png"}
minetest.register_node(":ethereal:strawberry_5", table.copy(def))
-- stage 6
crop_def.tiles = {"ethereal_strawberry_6.png"}
crop_def.drop = {
def.tiles = {"ethereal_strawberry_6.png"}
def.drop = {
items = {
{items = {"ethereal:strawberry 1"}, rarity = 2},
{items = {"ethereal:strawberry 2"}, rarity = 3}
{items = {"farming:strawberry 1"}, rarity = 2},
{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
crop_def.tiles = {"ethereal_strawberry_7.png"}
crop_def.drop = {
def.tiles = {"ethereal_strawberry_7.png"}
def.drop = {
items = {
{items = {"ethereal:strawberry 1"}, rarity = 1},
{items = {"ethereal:strawberry 2"}, rarity = 3}
{items = {"farming:strawberry 1"}, rarity = 1},
{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
crop_def.tiles = {"ethereal_strawberry_8.png"}
crop_def.groups.growing = nil
crop_def.drop = {
def.tiles = {"ethereal_strawberry_8.png"}
def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = {
items = {
{items = {"ethereal:strawberry 2"}, rarity = 1},
{items = {"ethereal:strawberry 3"}, rarity = 3}
{items = {"farming:strawberry 2"}, rarity = 1},
{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
farming.registered_plants["ethereal:strawberry"] = {
crop = "ethereal:strawberry",
seed = "ethereal:strawberry",
crop = "farming:strawberry",
seed = "farming:strawberry",
minlight = farming.min_light,
maxlight = farming.max_light,
steps = 8
@ -108,5 +112,5 @@ minetest.register_decoration({
},
y_min = 20,
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)
def.tiles = {"farming_sunflower_8.png"}
def.groups.growing = nil
def.selection_box = farming.select_final
def.drop = {
items = {
{items = {"farming:sunflower"}, rarity = 1},

View File

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

View File

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

View File

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

View File

@ -7,12 +7,16 @@
farming = {
mod = "redo",
version = "20220913",
version = "20220915",
path = minetest.get_modpath("farming"),
select = {
type = "fixed",
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 = {},
min_light = 12,
max_light = 15,
@ -575,13 +579,16 @@ farming.register_plant = function(name, def)
}
}
local sel = farming.select
local g = {
snappy = 3, flammable = 2, plant = 1, growing = 1,
attached_node = 1, not_in_creative_inventory = 1,
}
-- 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
sel = farming.select_final
g.growing = 0
end
@ -604,7 +611,7 @@ farming.register_plant = function(name, def)
buildable_to = true,
sunlight_propagates = true,
drop = drop,
selection_box = farming.select,
selection_box = sel,
groups = g,
sounds = default.node_sound_leaves_defaults(),
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