add initial MineClone2 support (thx usrib)

This commit is contained in:
tenplus1 2023-08-31 07:53:19 +01:00
parent 581a1bbaef
commit df64f1117f
45 changed files with 256 additions and 183 deletions

View File

@ -41,7 +41,7 @@ The farming API allows you to easily register plants and hoes.
steps = 8, -- How many steps the plant has to grow, until it can be harvested steps = 8, -- How many steps the plant has to grow, until it can be harvested
-- ^ Always provide a plant texture for each step, format: modname_plantname_i.png (i = stepnumber) -- ^ Always provide a plant texture for each step, format: modname_plantname_i.png (i = stepnumber)
minlight = 13, -- Minimum light to grow minlight = 13, -- Minimum light to grow
maxlight = default.LIGHT_MAX -- Maximum light to grow maxlight = minetest.LIGHT_MAX -- Maximum light to grow
} }
Note: Any crops registered with the above function will use the new growing routines, also if crops are manually added with the {growing=1} group they will also grow. Note: Any crops registered with the above function will use the new growing routines, also if crops are manually added with the {growing=1} group they will also grow.

View File

@ -5,7 +5,7 @@ local S = farming.translate
minetest.register_craftitem("farming:artichoke", { minetest.register_craftitem("farming:artichoke", {
description = S("Artichoke"), description = S("Artichoke"),
inventory_image = "farming_artichoke.png", inventory_image = "farming_artichoke.png",
groups = {seed = 2, food_artichoke = 1, flammable = 2}, groups = {compostability = 65, seed = 2, food_artichoke = 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, "farming:artichoke_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:artichoke_1")
end, end,
@ -24,10 +24,10 @@ local def = {
waving = 1, waving = 1,
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -5,7 +5,7 @@ local S = farming.translate
minetest.register_craftitem("farming:asparagus", { minetest.register_craftitem("farming:asparagus", {
description = S("Asparagus"), description = S("Asparagus"),
inventory_image = "farming_asparagus.png", inventory_image = "farming_asparagus.png",
groups = {seed = 2, food_asparagus = 1, flammable = 2}, groups = {compostability = 65, seed = 2, food_asparagus = 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, "farming:asparagus_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:asparagus_1")
end, end,
@ -26,10 +26,10 @@ local def = {
waving = 1, waving = 1,
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -8,7 +8,7 @@ minetest.register_node("farming:seed_barley", {
inventory_image = "farming_barley_seed.png", inventory_image = "farming_barley_seed.png",
wield_image = "farming_barley_seed.png", wield_image = "farming_barley_seed.png",
drawtype = "signlike", drawtype = "signlike",
groups = {seed = 1, snappy = 3, attached_node = 1, growing = 1}, groups = {compostability = 65, seed = 1, snappy = 3, attached_node = 1, growing = 1},
paramtype = "light", paramtype = "light",
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
walkable = false, walkable = false,
@ -53,10 +53,10 @@ local def = {
waving = 1, waving = 1,
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -71,7 +71,7 @@ end
minetest.register_craftitem("farming:beans", { minetest.register_craftitem("farming:beans", {
description = S("Green Beans"), description = S("Green Beans"),
inventory_image = "farming_beans.png", inventory_image = "farming_beans.png",
groups = {seed = 2, food_beans = 1, flammable = 2}, groups = {compostability = 65, seed = 2, food_beans = 1, flammable = 2},
on_use = minetest.item_eat(1), on_use = minetest.item_eat(1),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return place_beans(itemstack, placer, pointed_thing, "farming:beanpole_1") return place_beans(itemstack, placer, pointed_thing, "farming:beanpole_1")
@ -97,8 +97,8 @@ minetest.register_node("farming:beanpole", {
sunlight_propagates = true, sunlight_propagates = true,
drop = "farming:beanpole", drop = "farming:beanpole",
selection_box = farming.select, selection_box = farming.select,
groups = {snappy = 3, flammable = 2, attached_node = 1}, groups = {handy = 1, snappy = 3, flammable = 2, attached_node = 1},
sounds = default.node_sound_leaves_defaults(), sounds = farming.sounds.node_sound_leaves_defaults(),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
@ -186,10 +186,10 @@ local def = {
}, },
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 3, not_in_creative_inventory = 1, handy = 1, snappy = 3, flammable = 3, not_in_creative_inventory = 1,
attached_node = 1, growing = 1, plant = 1 attached_node = 1, growing = 1, plant = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1
@ -252,7 +252,7 @@ minetest.register_node("farming:beanbush", {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1 not_in_creative_inventory = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
}) })
-- mapgen -- mapgen

View File

@ -5,7 +5,7 @@ local S = farming.translate
minetest.register_craftitem("farming:beetroot", { minetest.register_craftitem("farming:beetroot", {
description = S("Beetroot"), description = S("Beetroot"),
inventory_image = "farming_beetroot.png", inventory_image = "farming_beetroot.png",
groups = {seed = 2, food_beetroot = 1, flammable = 2}, groups = {compostability = 65, seed = 2, food_beetroot = 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, "farming:beetroot_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:beetroot_1")
end, end,
@ -45,10 +45,10 @@ local def = {
drop = "", drop = "",
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -5,8 +5,10 @@ local S = farming.translate
minetest.register_craftitem("farming:blackberry", { minetest.register_craftitem("farming:blackberry", {
description = S("Blackberries"), description = S("Blackberries"),
inventory_image = "farming_blackberry.png", inventory_image = "farming_blackberry.png",
groups = {seed = 2, food_blackberries = 1, food_blackberry = 1, groups = {
food_berry = 1, flammable = 2}, compostability = 65, seed = 2, food_blackberries = 1, food_blackberry = 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, "farming:blackberry_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:blackberry_1")
end, end,
@ -23,10 +25,10 @@ local def = {
drop = "", drop = "",
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -5,8 +5,10 @@ local S = farming.translate
minetest.register_craftitem("farming:blueberries", { minetest.register_craftitem("farming:blueberries", {
description = S("Wild Blueberries"), description = S("Wild Blueberries"),
inventory_image = "farming_blueberries.png", inventory_image = "farming_blueberries.png",
groups = {seed = 2, food_blueberries = 1, food_blueberry = 1, groups = {
food_berry = 1, flammable = 2}, compostability = 65,seed = 2, food_blueberries = 1, food_blueberry = 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, "farming:blueberry_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:blueberry_1")
end, end,
@ -47,7 +49,7 @@ minetest.register_craft({
-- Blue Dye -- Blue Dye
minetest.register_craft({ minetest.register_craft({
output = "dye:blue", output = farming.mcl and "mcl_dye:blue" or "dye:blue",
recipe = {{"farming:blueberries"}} recipe = {{"farming:blueberries"}}
}) })
@ -62,10 +64,10 @@ local def = {
drop = "", drop = "",
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -5,7 +5,7 @@ local S = farming.translate
minetest.register_craftitem("farming:cabbage", { minetest.register_craftitem("farming:cabbage", {
description = S("Cabbage"), description = S("Cabbage"),
inventory_image = "farming_cabbage.png", inventory_image = "farming_cabbage.png",
groups = {seed = 2, food_cabbage = 1, flammable = 2}, groups = {compostability = 65, seed = 2, food_cabbage = 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, "farming:cabbage_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:cabbage_1")
end, end,
@ -23,10 +23,10 @@ local def = {
drop = "", drop = "",
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -10,7 +10,7 @@ local S = farming.translate
minetest.register_craftitem("farming:carrot", { minetest.register_craftitem("farming:carrot", {
description = S("Carrot"), description = S("Carrot"),
inventory_image = "farming_carrot.png", inventory_image = "farming_carrot.png",
groups = {seed = 2, food_carrot = 1, flammable = 2}, groups = {compostability = 65, seed = 2, food_carrot = 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, "farming:carrot_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:carrot_1")
end, end,
@ -63,10 +63,10 @@ local def = {
waving = 1, waving = 1,
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }

View File

@ -5,7 +5,7 @@ local S = farming.translate
minetest.register_craftitem("farming:chili_pepper", { minetest.register_craftitem("farming:chili_pepper", {
description = S("Chili Pepper"), description = S("Chili Pepper"),
inventory_image = "farming_chili_pepper.png", inventory_image = "farming_chili_pepper.png",
groups = {seed = 2, food_chili_pepper = 1, flammable = 4}, groups = {compostability = 65, seed = 2, food_chili_pepper = 1, flammable = 4},
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:chili_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:chili_1")
end, end,
@ -29,7 +29,7 @@ minetest.register_craft({
-- chili can be used for red dye -- chili can be used for red dye
minetest.register_craft({ minetest.register_craft({
output = "dye:red", output = farming.mcl and "mcl_dye:red" or "dye:red",
recipe = {{"farming:chili_pepper"}} recipe = {{"farming:chili_pepper"}}
}) })
@ -63,10 +63,10 @@ local def = {
waving = 1, waving = 1,
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 4, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 4, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -26,7 +26,7 @@ local function place_cocoa(itemstack, placer, pointed_thing, plantname)
end end
-- check if pointing at jungletree -- check if pointing at jungletree
if under.name ~= "default:jungletree" if (under.name ~= "default:jungletree" and under.name ~= "mcl_core:jungletree")
or minetest.get_node(pt.above).name ~= "air" then or minetest.get_node(pt.above).name ~= "air" then
return return
end end
@ -67,7 +67,7 @@ end
minetest.register_craftitem("farming:cocoa_beans_raw", { minetest.register_craftitem("farming:cocoa_beans_raw", {
description = S("Raw Cocoa Beans"), description = S("Raw Cocoa Beans"),
inventory_image = "farming_cocoa_beans.png^[brighten", inventory_image = "farming_cocoa_beans.png^[brighten",
groups = {seed = 1, flammable = 2}, groups = {compostability = 65, seed = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return place_cocoa(itemstack, placer, pointed_thing, "farming:cocoa_1") return place_cocoa(itemstack, placer, pointed_thing, "farming:cocoa_1")
end end
@ -87,7 +87,7 @@ minetest.register_craft({
}) })
minetest.register_craft( { minetest.register_craft( {
output = "dye:brown 2", output = farming.mcl and "mcl_dye:brown 2" or "dye:brown 2",
recipe = {{"farming:cocoa_beans"}} recipe = {{"farming:cocoa_beans"}}
}) })
@ -125,7 +125,7 @@ minetest.register_node("farming:chocolate_block", {
tiles = {"farming_chocolate_block.png"}, tiles = {"farming_chocolate_block.png"},
is_ground_content = false, is_ground_content = false,
groups = {cracky = 2, oddly_breakable_by_hand = 2}, groups = {cracky = 2, oddly_breakable_by_hand = 2},
sounds = default.node_sound_stone_defaults() sounds = farming.sounds.node_sound_stone_defaults()
}) })
minetest.register_craft({ minetest.register_craft({
@ -154,13 +154,14 @@ local def = {
}, },
drop = {}, drop = {},
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, growing = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, growing = 1,
not_in_creative_inventory = 1, leafdecay = 1, leafdecay_drop = 1 not_in_creative_inventory = 1, leafdecay = 1, leafdecay_drop = 1
}, },
sounds = default.node_sound_leaves_defaults(), sounds = farming.sounds.node_sound_leaves_defaults(),
growth_check = function(pos, node_name) growth_check = function(pos, node_name)
if minetest.find_node_near(pos, 1, {"default:jungletree"}) then if minetest.find_node_near(pos, 1,
{"default:jungletree", "mcl_core:jungletree"}) then
return false -- can grow return false -- can grow
end end
@ -218,14 +219,16 @@ minetest.register_on_generated(function(minp, maxp)
end end
local pos, dir local pos, dir
local cocoa = minetest.find_nodes_in_area(minp, maxp, "default:jungletree") local cocoa = minetest.find_nodes_in_area(minp, maxp,
{"default:jungletree", "mcl_core:jungletree"})
for n = 1, #cocoa do for n = 1, #cocoa do
pos = cocoa[n] pos = cocoa[n]
if minetest.find_node_near(pos, 1, if minetest.find_node_near(pos, 1,
{"default:jungleleaves", "moretrees:jungletree_leaves_green"}) then {"default:jungleleaves", "moretrees:jungletree_leaves_green",
"mcl_core:jungleleaves"}) then
dir = random(80) dir = random(80)

View File

@ -5,7 +5,7 @@ local S = farming.translate
minetest.register_craftitem("farming:coffee_beans", { minetest.register_craftitem("farming:coffee_beans", {
description = S("Coffee Beans"), description = S("Coffee Beans"),
inventory_image = "farming_coffee_beans.png", inventory_image = "farming_coffee_beans.png",
groups = {seed = 2, food_coffee = 1, flammable = 2}, groups = {compostability = 65, seed = 2, food_coffee = 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, "farming:coffee_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:coffee_1")
end end
@ -26,7 +26,7 @@ minetest.register_node("farming:coffee_cup", {
}, },
groups = {vessel = 1, dig_immediate = 3, attached_node = 1, drink = 1}, groups = {vessel = 1, dig_immediate = 3, attached_node = 1, drink = 1},
on_use = minetest.item_eat(2, "vessels:drinking_glass"), on_use = minetest.item_eat(2, "vessels:drinking_glass"),
sounds = default.node_sound_glass_defaults() sounds = farming.sounds.node_sound_glass_defaults()
}) })
minetest.register_alias("farming:coffee_cup_hot", "farming:coffee_cup") minetest.register_alias("farming:coffee_cup_hot", "farming:coffee_cup")
@ -57,10 +57,10 @@ local def = {
waving = 1, waving = 1,
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -10,7 +10,7 @@ local S = farming.translate
minetest.register_craftitem("farming:corn", { minetest.register_craftitem("farming:corn", {
description = S("Corn"), description = S("Corn"),
inventory_image = "farming_corn.png", inventory_image = "farming_corn.png",
groups = {seed = 2, food_corn = 1, flammable = 2}, groups = {compostability = 65, seed = 2, food_corn = 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, "farming:corn_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:corn_1")
end, end,
@ -90,7 +90,7 @@ minetest.register_node("farming:bottle_ethanol", {
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
}, },
groups = {vessel = 1, dig_immediate = 3, attached_node = 1}, groups = {vessel = 1, dig_immediate = 3, attached_node = 1},
sounds = default.node_sound_glass_defaults() sounds = farming.sounds.node_sound_glass_defaults()
}) })
minetest.register_craft( { minetest.register_craft( {
@ -121,10 +121,10 @@ local def = {
waving = 1, waving = 1,
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -13,14 +13,14 @@ minetest.register_node("farming:cotton_wild", {
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
buildable_to = true, buildable_to = true,
groups = {snappy = 3, attached_node = 1, flammable = 4}, groups = {handy = 1, snappy = 3, attached_node = 1, flammable = 4},
drop = { drop = {
items = { items = {
{items = {"farming:cotton"}, rarity = 2}, {items = {"farming:cotton"}, rarity = 2},
{items = {"farming:seed_cotton"}, rarity = 1} {items = {"farming:seed_cotton"}, rarity = 1}
} }
}, },
sounds = default.node_sound_leaves_defaults(), sounds = farming.sounds.node_sound_leaves_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-6 / 16, -8 / 16, -6 / 16, 6 / 16, 5 / 16, 6 / 16} fixed = {-6 / 16, -8 / 16, -6 / 16, 6 / 16, 5 / 16, 6 / 16}
@ -34,7 +34,10 @@ minetest.register_node("farming:seed_cotton", {
inventory_image = "farming_cotton_seed.png", inventory_image = "farming_cotton_seed.png",
wield_image = "farming_cotton_seed.png", wield_image = "farming_cotton_seed.png",
drawtype = "signlike", drawtype = "signlike",
groups = {seed = 1, snappy = 3, attached_node = 1, flammable = 4, growing = 1}, groups = {
compostability = 65, seed = 1, snappy = 3, attached_node = 1,
flammable = 4, growing = 1
},
paramtype = "light", paramtype = "light",
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
walkable = false, walkable = false,
@ -103,10 +106,10 @@ local def = {
waving = 1, waving = 1,
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 4, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 4, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -10,7 +10,7 @@ local S = farming.translate
minetest.register_craftitem("farming:cucumber", { minetest.register_craftitem("farming:cucumber", {
description = S("Cucumber"), description = S("Cucumber"),
inventory_image = "farming_cucumber.png", inventory_image = "farming_cucumber.png",
groups = {seed = 2, food_cucumber = 1, flammable = 2}, groups = {compostability = 65, seed = 2, food_cucumber = 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, "farming:cucumber_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:cucumber_1")
end, end,
@ -27,10 +27,10 @@ local def = {
drop = "", drop = "",
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -5,7 +5,7 @@ local S = farming.translate
minetest.register_craftitem("farming:eggplant", { minetest.register_craftitem("farming:eggplant", {
description = S("Eggplant"), description = S("Eggplant"),
inventory_image = "farming_eggplant.png", inventory_image = "farming_eggplant.png",
groups = {seed = 2, food_eggplant = 1, flammable = 2}, groups = {compostability = 65, seed = 2, food_eggplant = 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, "farming:eggplant_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:eggplant_1")
end, end,
@ -25,10 +25,10 @@ local def = {
waving = 1, waving = 1,
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -11,7 +11,7 @@ local S = farming.translate
minetest.register_craftitem("farming:garlic_clove", { minetest.register_craftitem("farming:garlic_clove", {
description = S("Garlic clove"), description = S("Garlic clove"),
inventory_image = "crops_garlic_clove.png", inventory_image = "crops_garlic_clove.png",
groups = {seed = 2, food_garlic_clove = 1, flammable = 3}, groups = {compostability = 65, seed = 2, food_garlic_clove = 1, flammable = 3},
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:garlic_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:garlic_1")
end end
@ -54,7 +54,7 @@ minetest.register_node("farming:garlic_braid", {
"crops_garlic_braid.png","crops_garlic_braid.png" "crops_garlic_braid.png","crops_garlic_braid.png"
}, },
groups = {vessel = 1, dig_immediate = 3, flammable = 3}, groups = {vessel = 1, dig_immediate = 3, flammable = 3},
sounds = default.node_sound_leaves_defaults(), sounds = farming.sounds.node_sound_leaves_defaults(),
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
@ -92,10 +92,10 @@ local def = {
drop = "", drop = "",
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 3, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 3, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -5,7 +5,7 @@ local S = farming.translate
minetest.register_craftitem("farming:ginger", { minetest.register_craftitem("farming:ginger", {
description = S("Ginger"), description = S("Ginger"),
inventory_image = "farming_ginger.png", inventory_image = "farming_ginger.png",
groups = {seed = 2, food_ginger = 1, flammable = 2}, groups = {compostability = 65, seed = 2, food_ginger = 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, "farming:ginger_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:ginger_1")
end, end,
@ -24,10 +24,10 @@ local def = {
waving = 1, waving = 1,
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1
@ -64,7 +64,7 @@ farming.registered_plants["farming:ginger"] = {
crop = "farming:ginger", crop = "farming:ginger",
seed = "farming:ginger", seed = "farming:ginger",
minlight = 5, minlight = 5,
maxlight = default.LIGHT_MAX, maxlight = minetest.LIGHT_MAX,
steps = 4 steps = 4
} }

View File

@ -67,7 +67,7 @@ minetest.register_craftitem("farming:grapes", {
description = S("Grapes"), description = S("Grapes"),
inventory_image = "farming_grapes.png", inventory_image = "farming_grapes.png",
on_use = minetest.item_eat(2), on_use = minetest.item_eat(2),
groups = {seed = 2, food_grapes = 1, flammable = 3}, groups = {compostability = 65, seed = 2, food_grapes = 1, flammable = 3},
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return place_grapes(itemstack, placer, pointed_thing, "farming:grapes_1") return place_grapes(itemstack, placer, pointed_thing, "farming:grapes_1")
end end
@ -75,7 +75,7 @@ minetest.register_craftitem("farming:grapes", {
-- grapes can be used for violet dye -- grapes can be used for violet dye
minetest.register_craft({ minetest.register_craft({
output = "dye:violet", output = farming.mcl and "mcl_dye:violet" or "dye:violet",
recipe = {{"farming:grapes"}} recipe = {{"farming:grapes"}}
}) })
@ -92,8 +92,8 @@ minetest.register_node("farming:trellis", {
sunlight_propagates = true, sunlight_propagates = true,
drop = "farming:trellis", drop = "farming:trellis",
selection_box = farming.select, selection_box = farming.select,
groups = {snappy = 3, flammable = 2, attached_node = 1}, groups = {handy = 1, snappy = 3, flammable = 2, attached_node = 1},
sounds = default.node_sound_leaves_defaults(), sounds = farming.sounds.node_sound_leaves_defaults(),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
@ -181,10 +181,10 @@ local def = {
}, },
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 3, not_in_creative_inventory = 1, handy = 1, snappy = 3, flammable = 3, not_in_creative_inventory = 1,
attached_node = 1, growing = 1, plant = 1 attached_node = 1, growing = 1, plant = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1
@ -256,10 +256,10 @@ minetest.register_node("farming:grapebush", {
}, },
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1 not_in_creative_inventory = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
}) })
-- mapgen -- mapgen

View File

@ -8,7 +8,7 @@ minetest.register_node("farming:seed_hemp", {
inventory_image = "farming_hemp_seed.png", inventory_image = "farming_hemp_seed.png",
wield_image = "farming_hemp_seed.png", wield_image = "farming_hemp_seed.png",
drawtype = "signlike", drawtype = "signlike",
groups = {seed = 1, snappy = 3, attached_node = 1, growing = 1}, groups = {compostability = 65, seed = 1, snappy = 3, attached_node = 1, growing = 1},
paramtype = "light", paramtype = "light",
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
walkable = false, walkable = false,
@ -41,7 +41,7 @@ minetest.register_node("farming:hemp_oil", {
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
}, },
groups = {food_oil = 1, vessel = 1, dig_immediate = 3, attached_node = 1}, groups = {food_oil = 1, vessel = 1, dig_immediate = 3, attached_node = 1},
sounds = default.node_sound_glass_defaults() sounds = farming.sounds.node_sound_glass_defaults()
}) })
minetest.register_craft( { minetest.register_craft( {
@ -102,8 +102,8 @@ minetest.register_node("farming:hemp_block", {
description = S("Hemp Block"), description = S("Hemp Block"),
tiles = {"farming_hemp_block.png"}, tiles = {"farming_hemp_block.png"},
paramtype = "light", paramtype = "light",
groups = {snappy = 2, oddly_breakable_by_hand = 1, flammable = 2}, groups = {handy = 1, snappy = 2, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
}) })
minetest.register_craft( { minetest.register_craft( {
@ -124,7 +124,7 @@ if minetest.global_exists("stairs") then
{snappy = 2, oddly_breakable_by_hand = 1, flammable = 2}, {snappy = 2, oddly_breakable_by_hand = 1, flammable = 2},
{"farming_hemp_block.png"}, {"farming_hemp_block.png"},
"Hemp Block", "Hemp Block",
default.node_sound_leaves_defaults()) farming.sounds.node_sound_leaves_defaults())
else else
stairs.register_stair_and_slab("hemp_block", "farming:hemp_block", stairs.register_stair_and_slab("hemp_block", "farming:hemp_block",
@ -132,7 +132,7 @@ if minetest.global_exists("stairs") then
{"farming_hemp_block.png"}, {"farming_hemp_block.png"},
"Hemp Block Stair", "Hemp Block Stair",
"Hemp Block Slab", "Hemp Block Slab",
default.node_sound_leaves_defaults()) farming.sounds.node_sound_leaves_defaults())
end end
end end
@ -166,7 +166,7 @@ minetest.register_node("farming:hemp_rope", {
inventory_image = "farming_hemp_rope.png", inventory_image = "farming_hemp_rope.png",
drawtype = "plantlike", drawtype = "plantlike",
groups = {flammable = 2, choppy = 3, oddly_breakable_by_hand = 3}, groups = {flammable = 2, choppy = 3, oddly_breakable_by_hand = 3},
sounds = default.node_sound_leaves_defaults(), sounds = farming.sounds.node_sound_leaves_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7} fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}
@ -195,10 +195,10 @@ local def = {
waving = 1, waving = 1,
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -5,7 +5,7 @@ local S = farming.translate
minetest.register_craftitem("farming:lettuce", { minetest.register_craftitem("farming:lettuce", {
description = S("Lettuce"), description = S("Lettuce"),
inventory_image = "farming_lettuce.png", inventory_image = "farming_lettuce.png",
groups = {seed = 2, food_lettuce = 1, flammable = 2}, groups = {compostability = 65, seed = 2, food_lettuce = 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, "farming:lettuce_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:lettuce_1")
end, end,
@ -22,10 +22,10 @@ local def = {
drop = "", drop = "",
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -5,7 +5,7 @@ local S = farming.translate
minetest.register_craftitem("farming:melon_slice", { minetest.register_craftitem("farming:melon_slice", {
description = S("Melon Slice"), description = S("Melon Slice"),
inventory_image = "farming_melon_slice.png", inventory_image = "farming_melon_slice.png",
groups = {seed = 2, food_melon_slice = 1, flammable = 3}, groups = {compostability = 65, seed = 2, food_melon_slice = 1, flammable = 3},
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:melon_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:melon_1")
end, end,
@ -39,10 +39,10 @@ local def = {
drop = "", drop = "",
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1
@ -81,11 +81,11 @@ minetest.register_node("farming:melon_8", {
"farming_melon_side.png" "farming_melon_side.png"
}, },
groups = { groups = {
food_melon = 1, snappy = 3, choppy = 3, oddly_breakable_by_hand = 2, food_melon = 1, handy = 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",
sounds = default.node_sound_wood_defaults(), sounds = farming.sounds.node_sound_wood_defaults(),
paramtype2 = "facedir", paramtype2 = "facedir",
on_place = minetest.rotate_node on_place = minetest.rotate_node
}) })

View File

@ -8,7 +8,10 @@ minetest.register_node("farming:seed_mint", {
inventory_image = "farming_mint_seeds.png", inventory_image = "farming_mint_seeds.png",
wield_image = "farming_mint_seeds.png", wield_image = "farming_mint_seeds.png",
drawtype = "signlike", drawtype = "signlike",
groups = {seed = 1, snappy = 3, attached_node = 1, growing = 1, flammable = 2}, groups = {
compostability = 65, seed = 1, snappy = 3, attached_node = 1, growing = 1,
flammable = 2
},
paramtype = "light", paramtype = "light",
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
walkable = false, walkable = false,
@ -60,10 +63,10 @@ local def = {
waving = 1, waving = 1,
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -11,7 +11,7 @@ local S = farming.translate
minetest.register_craftitem("farming:onion", { minetest.register_craftitem("farming:onion", {
description = S("Onion"), description = S("Onion"),
inventory_image = "crops_onion.png", inventory_image = "crops_onion.png",
groups = {seed = 2, food_onion = 1, flammable = 3}, groups = {compostability = 65, seed = 2, food_onion = 1, flammable = 3},
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:onion_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:onion_1")
end, end,
@ -40,7 +40,7 @@ minetest.register_craft({
-- yellow dye -- yellow dye
minetest.register_craft({ minetest.register_craft({
output = "dye:yellow", output = farming.mcl and "mcl_dye:yellow" or "dye:yellow",
recipe = {{"group:food_onion"}} recipe = {{"group:food_onion"}}
}) })
@ -59,10 +59,10 @@ local def = {
waving = 1, waving = 1,
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 3, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 3, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -5,7 +5,7 @@ local S = farming.translate
minetest.register_craftitem("farming:parsley", { minetest.register_craftitem("farming:parsley", {
description = S("Parsley"), description = S("Parsley"),
inventory_image = "farming_parsley.png", inventory_image = "farming_parsley.png",
groups = {seed = 2, food_parsley = 1, flammable = 2}, groups = {compostability = 65, seed = 2, food_parsley = 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, "farming:parsley_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:parsley_1")
end end
@ -23,10 +23,10 @@ local def = {
waving = 1, waving = 1,
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -7,7 +7,9 @@ local S = farming.translate
minetest.register_craftitem("farming:pea_pod", { minetest.register_craftitem("farming:pea_pod", {
description = S("Pea Pod"), description = S("Pea Pod"),
inventory_image = "farming_pea_pod.png", inventory_image = "farming_pea_pod.png",
groups = {seed = 2, food_peas = 1, food_pea_pod = 1, flammable = 2}, groups = {
compostability = 65, seed = 2, food_peas = 1, food_pea_pod = 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, "farming:pea_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:pea_1")
end, end,
@ -47,10 +49,10 @@ local def = {
drop = "", drop = "",
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -11,7 +11,7 @@ local S = farming.translate
minetest.register_craftitem("farming:peppercorn", { minetest.register_craftitem("farming:peppercorn", {
description = S("Peppercorn"), description = S("Peppercorn"),
inventory_image = "crops_peppercorn.png", inventory_image = "crops_peppercorn.png",
groups = {seed = 1, food_peppercorn = 1, flammable = 3}, groups = {compostability = 65, seed = 1, food_peppercorn = 1, flammable = 3},
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:pepper_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:pepper_1")
end end
@ -59,7 +59,7 @@ minetest.register_node("farming:pepper_ground", {
vessel = 1, food_pepper_ground = 1, vessel = 1, food_pepper_ground = 1,
dig_immediate = 3, attached_node = 1 dig_immediate = 3, attached_node = 1
}, },
sounds = default.node_sound_defaults(), sounds = farming.sounds.node_sound_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
@ -92,10 +92,10 @@ local def = {
drop = "", drop = "",
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 3, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 3, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -5,7 +5,7 @@ local S = farming.translate
minetest.register_craftitem("farming:pineapple_top", { minetest.register_craftitem("farming:pineapple_top", {
description = S("Pineapple Top"), description = S("Pineapple Top"),
inventory_image = "farming_pineapple_top.png", inventory_image = "farming_pineapple_top.png",
groups = {seed = 2, flammable = 2}, groups = {compostability = 65, seed = 2, flammable = 2},
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:pineapple_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:pineapple_1")
end end
@ -90,10 +90,10 @@ local def = {
waving = 1, waving = 1,
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -10,7 +10,7 @@ local S = farming.translate
minetest.register_craftitem("farming:potato", { minetest.register_craftitem("farming:potato", {
description = S("Potato"), description = S("Potato"),
inventory_image = "farming_potato.png", inventory_image = "farming_potato.png",
groups = {seed = 2, food_potato = 1, flammable = 2}, groups = {compostability = 65, seed = 2, food_potato = 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, "farming:potato_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:potato_1")
end, end,
@ -68,10 +68,10 @@ local def = {
drop = "", drop = "",
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -5,7 +5,7 @@ local S = farming.translate
minetest.register_craftitem("farming:pumpkin_slice", { minetest.register_craftitem("farming:pumpkin_slice", {
description = S("Pumpkin Slice"), description = S("Pumpkin Slice"),
inventory_image = "farming_pumpkin_slice.png", inventory_image = "farming_pumpkin_slice.png",
groups = {seed = 2, food_pumpkin_slice = 1, flammable = 2}, groups = {compostability = 65, seed = 2, food_pumpkin_slice = 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, "farming:pumpkin_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:pumpkin_1")
end, end,
@ -37,8 +37,8 @@ minetest.register_node("farming:jackolantern", {
"farming_pumpkin_side.png", "farming_pumpkin_side.png^farming_pumpkin_face_off.png" "farming_pumpkin_side.png", "farming_pumpkin_side.png^farming_pumpkin_face_off.png"
}, },
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, groups = {handy = 1, snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = default.node_sound_wood_defaults(), sounds = farming.sounds.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 ""
if minetest.is_protected(pos, name) then return end if minetest.is_protected(pos, name) then return end
@ -53,13 +53,13 @@ minetest.register_node("farming:jackolantern_on", {
"farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png",
"farming_pumpkin_side.png", "farming_pumpkin_side.png^farming_pumpkin_face_on.png" "farming_pumpkin_side.png", "farming_pumpkin_side.png^farming_pumpkin_face_on.png"
}, },
light_source = default.LIGHT_MAX - 1, light_source = minetest.LIGHT_MAX - 1,
paramtype2 = "facedir", paramtype2 = "facedir",
groups = { groups = {
snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, handy = 1, 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 = farming.sounds.node_sound_wood_defaults(),
drop = "farming:jackolantern", drop = "farming:jackolantern",
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 ""
@ -92,7 +92,7 @@ minetest.register_node("farming:scarecrow_bottom", {
{-12/16, 4/16, -1/16, 12/16, 2/16, 1/16}, {-12/16, 4/16, -1/16, 12/16, 2/16, 1/16},
} }
}, },
groups = {snappy = 3, flammable = 2} groups = {handy = 1, snappy = 3, flammable = 2}
}) })
minetest.register_craft({ minetest.register_craft({
@ -143,10 +143,10 @@ local def = {
drop = "", drop = "",
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1
@ -189,7 +189,7 @@ minetest.register_node("farming:pumpkin_8", {
flammable = 2, plant = 1 flammable = 2, plant = 1
}, },
drop = "farming:pumpkin_8", drop = "farming:pumpkin_8",
sounds = default.node_sound_wood_defaults(), sounds = farming.sounds.node_sound_wood_defaults(),
paramtype2 = "facedir", paramtype2 = "facedir",
on_place = minetest.rotate_node on_place = minetest.rotate_node
}) })

View File

@ -5,7 +5,7 @@ local S = farming.translate
minetest.register_craftitem("farming:raspberries", { minetest.register_craftitem("farming:raspberries", {
description = S("Raspberries"), description = S("Raspberries"),
inventory_image = "farming_raspberries.png", inventory_image = "farming_raspberries.png",
groups = {seed = 2, food_raspberries = 1, food_raspberry = 1, groups = {compostability = 65, seed = 2, food_raspberries = 1, food_raspberry = 1,
food_berry = 1, flammable = 2}, 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, "farming:raspberry_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:raspberry_1")
@ -41,10 +41,10 @@ local def = {
drop = "", drop = "",
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -5,7 +5,7 @@ local S = farming.translate
minetest.register_craftitem("farming:rhubarb", { minetest.register_craftitem("farming:rhubarb", {
description = S("Rhubarb"), description = S("Rhubarb"),
inventory_image = "farming_rhubarb.png", inventory_image = "farming_rhubarb.png",
groups = {seed = 2, food_rhubarb = 1, flammable = 2}, groups = {compostability = 65, seed = 2, food_rhubarb = 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, "farming:rhubarb_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:rhubarb_1")
end, end,
@ -43,10 +43,10 @@ local def = {
waving = 1, waving = 1,
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults(), sounds = farming.sounds.node_sound_leaves_defaults(),
minlight = 10, minlight = 10,
maxlight = 12 maxlight = 12
} }

View File

@ -8,7 +8,10 @@ minetest.register_node("farming:seed_rice", {
inventory_image = "farming_rice_seed.png", inventory_image = "farming_rice_seed.png",
wield_image = "farming_rice_seed.png", wield_image = "farming_rice_seed.png",
drawtype = "signlike", drawtype = "signlike",
groups = {seed = 1, snappy = 3, attached_node = 1, flammable = 4, growing = 1}, groups = {
compostability = 65, seed = 1, snappy = 3, attached_node = 1,
flammable = 4, growing = 1
},
paramtype = "light", paramtype = "light",
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
walkable = false, walkable = false,
@ -81,10 +84,10 @@ local def = {
waving = 1, waving = 1,
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 4, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 4, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -5,7 +5,7 @@ local S = farming.translate
minetest.register_craftitem("farming:soy_pod", { minetest.register_craftitem("farming:soy_pod", {
description = S("Soy Pod"), description = S("Soy Pod"),
inventory_image = "farming_soy_pod.png", inventory_image = "farming_soy_pod.png",
groups = {seed = 2, food_soy = 1, food_soy_pod = 1, flammable = 2}, groups = {compostability = 65, seed = 2, food_soy = 1, food_soy_pod = 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, "farming:soy_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:soy_1")
end end
@ -30,7 +30,7 @@ minetest.register_node("farming:soy_sauce", {
groups = { groups = {
vessel = 1, food_soy_sauce = 1, dig_immediate = 3, attached_node = 1 vessel = 1, food_soy_sauce = 1, dig_immediate = 3, attached_node = 1
}, },
sounds = default.node_sound_glass_defaults() sounds = farming.sounds.node_sound_glass_defaults()
}) })
local tmp = farming.use_utensils and "farming:juicer" or "" local tmp = farming.use_utensils and "farming:juicer" or ""
@ -66,7 +66,7 @@ minetest.register_node("farming:soy_milk", {
vessel = 1, food_milk_glass = 1, dig_immediate = 3, vessel = 1, food_milk_glass = 1, dig_immediate = 3,
attached_node = 1, drink = 1 attached_node = 1, drink = 1
}, },
sounds = default.node_sound_glass_defaults() sounds = farming.sounds.node_sound_glass_defaults()
}) })
minetest.register_craft( { minetest.register_craft( {
@ -130,10 +130,10 @@ local def = {
drop = "", drop = "",
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -5,7 +5,7 @@ local S = farming.translate
minetest.register_craftitem("farming:spinach", { minetest.register_craftitem("farming:spinach", {
description = S("Spinach"), description = S("Spinach"),
inventory_image = "farming_spinach.png", inventory_image = "farming_spinach.png",
groups = {seed = 2, food_spinach = 1, flammable = 2}, groups = {compostability = 65, seed = 2, food_spinach = 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, "farming:spinach_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:spinach_1")
end, end,
@ -24,10 +24,10 @@ local def = {
drop = "", drop = "",
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -5,7 +5,9 @@ local S = farming.translate
minetest.register_craftitem(":ethereal:strawberry", { minetest.register_craftitem(":ethereal:strawberry", {
description = S("Strawberry"), description = S("Strawberry"),
inventory_image = "ethereal_strawberry.png", inventory_image = "ethereal_strawberry.png",
groups = {seed = 2, food_strawberry = 1, food_berry = 1, flammable = 2}, groups = {
compostability = 65, seed = 2, 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,
@ -27,10 +29,10 @@ local def = {
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}
}, },
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
--stage 1 --stage 1

View File

@ -15,8 +15,10 @@ minetest.register_node("farming:seed_sunflower", {
inventory_image = "farming_sunflower_seeds.png", inventory_image = "farming_sunflower_seeds.png",
wield_image = "farming_sunflower_seeds.png", wield_image = "farming_sunflower_seeds.png",
drawtype = "signlike", drawtype = "signlike",
groups = {seed = 1, snappy = 3, attached_node = 1, growing = 1, groups = {
food_sunflower_seeds = 1, flammable = 2}, compostability = 65, seed = 1, snappy = 3, attached_node = 1, growing = 1,
food_sunflower_seeds = 1, flammable = 2
},
paramtype = "light", paramtype = "light",
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
walkable = false, walkable = false,
@ -68,7 +70,7 @@ minetest.register_node("farming:sunflower_oil", {
food_oil = 1, vessel = 1, dig_immediate = 3, attached_node = 1, food_oil = 1, vessel = 1, dig_immediate = 3, attached_node = 1,
flammable = 2 flammable = 2
}, },
sounds = default.node_sound_glass_defaults() sounds = farming.sounds.node_sound_glass_defaults()
}) })
minetest.register_craft( { minetest.register_craft( {
@ -112,10 +114,10 @@ local def = {
waving = 1, waving = 1,
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -10,7 +10,7 @@ local S = farming.translate
minetest.register_craftitem("farming:tomato", { minetest.register_craftitem("farming:tomato", {
description = S("Tomato"), description = S("Tomato"),
inventory_image = "farming_tomato.png", inventory_image = "farming_tomato.png",
groups = {seed = 2, food_tomato = 1, flammable = 2}, groups = {compostability = 65, seed = 2, food_tomato = 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, "farming:tomato_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:tomato_1")
end, end,
@ -46,10 +46,10 @@ local def = {
waving = 1, waving = 1,
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -5,7 +5,7 @@ local S = farming.translate
minetest.register_craftitem("farming:vanilla", { minetest.register_craftitem("farming:vanilla", {
description = S("Vanilla"), description = S("Vanilla"),
inventory_image = "farming_vanilla.png", inventory_image = "farming_vanilla.png",
groups = {seed = 2, food_vanilla = 1, flammable = 2}, groups = {compostability = 65, seed = 2, food_vanilla = 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, "farming:vanilla_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:vanilla_1")
end, end,
@ -24,10 +24,10 @@ local def = {
waving = 1, waving = 1,
selection_box = farming.select, selection_box = farming.select,
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- vanilla extract -- vanilla extract
@ -45,7 +45,7 @@ minetest.register_node("farming:vanilla_extract", {
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
}, },
groups = {vessel = 1, dig_immediate = 3, attached_node = 1}, groups = {vessel = 1, dig_immediate = 3, attached_node = 1},
sounds = default.node_sound_glass_defaults(), sounds = farming.sounds.node_sound_glass_defaults(),
}) })
minetest.register_craft( { minetest.register_craft( {

View File

@ -33,7 +33,7 @@ minetest.register_node("farming:straw", {
tiles = {"farming_straw.png"}, tiles = {"farming_straw.png"},
is_ground_content = false, is_ground_content = false,
groups = {snappy = 3, flammable = 4, fall_damage_add_percent = -30}, groups = {snappy = 3, flammable = 4, fall_damage_add_percent = -30},
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
}) })
minetest.register_craft({ minetest.register_craft({
@ -59,7 +59,7 @@ if minetest.global_exists("stairs") then
{snappy = 3, flammable = 4}, {snappy = 3, flammable = 4},
{"farming_straw.png"}, {"farming_straw.png"},
"Straw", "Straw",
default.node_sound_leaves_defaults()) farming.sounds.node_sound_leaves_defaults())
else else
stairs.register_stair_and_slab("straw", "farming:straw", stairs.register_stair_and_slab("straw", "farming:straw",
@ -67,7 +67,7 @@ if minetest.global_exists("stairs") then
{"farming_straw.png"}, {"farming_straw.png"},
"Straw Stair", "Straw Stair",
"Straw Slab", "Straw Slab",
default.node_sound_leaves_defaults()) farming.sounds.node_sound_leaves_defaults())
end end
end end
@ -169,7 +169,7 @@ local def = {
snappy = 3, flammable = 4, plant = 1, attached_node = 1, snappy = 3, flammable = 4, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1 not_in_creative_inventory = 1, growing = 1
}, },
sounds = default.node_sound_leaves_defaults() sounds = farming.sounds.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -74,7 +74,7 @@ minetest.register_node("farming:sugar_cube", {
tiles = {"farming_sugar_cube.png"}, tiles = {"farming_sugar_cube.png"},
groups = {crumbly = 2}, groups = {crumbly = 2},
floodable = true, floodable = true,
sounds = default.node_sound_gravel_defaults() sounds = farming.sounds.node_sound_gravel_defaults()
}) })
minetest.register_craft({ minetest.register_craft({
@ -117,7 +117,7 @@ minetest.register_node("farming:salt", {
tiles = {"farming_salt.png"}, tiles = {"farming_salt.png"},
groups = {food_salt = 1, vessel = 1, dig_immediate = 3, groups = {food_salt = 1, vessel = 1, dig_immediate = 3,
attached_node = 1}, attached_node = 1},
sounds = default.node_sound_defaults(), sounds = farming.sounds.node_sound_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
@ -185,7 +185,7 @@ minetest.register_node("farming:salt_crystal", {
light_source = 1, light_source = 1,
tiles = {"farming_salt_crystal.png"}, tiles = {"farming_salt_crystal.png"},
groups = { dig_immediate = 3, attached_node = 1}, groups = { dig_immediate = 3, attached_node = 1},
sounds = default.node_sound_defaults(), sounds = farming.sounds.node_sound_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
@ -228,7 +228,7 @@ minetest.register_node("farming:mayonnaise", {
fixed = {-0.25, -0.5, -0.25, 0.25, 0.45, 0.25} fixed = {-0.25, -0.5, -0.25, 0.25, 0.45, 0.25}
}, },
groups = {food_mayonnaise = 1, vessel = 1, dig_immediate = 3, attached_node = 1}, groups = {food_mayonnaise = 1, vessel = 1, dig_immediate = 3, attached_node = 1},
sounds = default.node_sound_glass_defaults() sounds = farming.sounds.node_sound_glass_defaults()
}) })
minetest.register_craft({ minetest.register_craft({
@ -252,7 +252,7 @@ minetest.register_node("farming:rose_water", {
tiles = {"farming_rose_water.png"}, tiles = {"farming_rose_water.png"},
groups = {food_rose_water = 1, vessel = 1, dig_immediate = 3, groups = {food_rose_water = 1, vessel = 1, dig_immediate = 3,
attached_node = 1}, attached_node = 1},
sounds = default.node_sound_defaults(), sounds = farming.sounds.node_sound_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}

View File

@ -7,7 +7,7 @@
farming = { farming = {
mod = "redo", mod = "redo",
version = "20230814", version = "20230831",
path = minetest.get_modpath("farming"), path = minetest.get_modpath("farming"),
select = { select = {
type = "fixed", type = "fixed",
@ -21,10 +21,24 @@ farming = {
min_light = 12, min_light = 12,
max_light = 15, max_light = 15,
mapgen = minetest.get_mapgen_setting("mg_name"), mapgen = minetest.get_mapgen_setting("mg_name"),
use_utensils = minetest.settings:get_bool("farming_use_utensils") ~= false use_utensils = minetest.settings:get_bool("farming_use_utensils") ~= false,
mtg = minetest.get_modpath("default"),
mcl = minetest.get_modpath("mcl_core"),
sounds = {}
} }
-- default sound functions just incase
function farming.sounds.node_sound_defaults() end
function farming.sounds.node_sound_leaves_defaults() end
function farming.sounds.node_sound_glass_defaults() end
function farming.sounds.node_sound_wood_defaults() end
function farming.sounds.node_sound_gravel_defaults() end
-- sounds check
if farming.mtg then farming.sounds = default end
if farming.mcl then farming.sounds = mcl_sounds end
-- check for creative mode or priv
local creative_mode_cache = minetest.settings:get_bool("creative_mode") local creative_mode_cache = minetest.settings:get_bool("creative_mode")
function farming.is_creative(name) function farming.is_creative(name)
@ -614,7 +628,7 @@ farming.register_plant = function(name, def)
drop = drop, drop = drop,
selection_box = sel, selection_box = sel,
groups = g, groups = g,
sounds = default.node_sound_leaves_defaults(), sounds = farming.sounds.node_sound_leaves_defaults(),
minlight = def.minlight, minlight = def.minlight,
maxlight = def.maxlight, maxlight = def.maxlight,
next_plant = next_plant next_plant = next_plant
@ -694,15 +708,34 @@ end
-- important items -- important items
dofile(farming.path.."/soil.lua") if farming.mtg then
dofile(farming.path.."/hoes.lua") dofile(farming.path.."/soil.lua")
dofile(farming.path.."/grass.lua") dofile(farming.path.."/hoes.lua")
dofile(farming.path.."/grass.lua")
end
if farming.mcl then
dofile(farming.path.."/mcl_grass.lua")
end
dofile(farming.path.."/utensils.lua") dofile(farming.path.."/utensils.lua")
-- default crops -- default crops
dofile(farming.path.."/crops/wheat.lua") if farming.mtg then
dofile(farming.path.."/crops/wheat.lua")
end
dofile(farming.path.."/crops/cotton.lua") dofile(farming.path.."/crops/cotton.lua")
-- disable crops Mineclone already has
if farming.mcl then
farming.carrot = nil
farming.potato = nil
farming.melon = nil
farming.cocoa = nil
farming.beetroot = nil
farming.sunflower = nil
end
-- helper function -- helper function
local function ddoo(file, check) local function ddoo(file, check)
@ -754,7 +787,10 @@ ddoo("spinach.lua", farming.eggplant)
ddoo("ginger.lua", farming.ginger) ddoo("ginger.lua", farming.ginger)
dofile(farming.path .. "/food.lua") dofile(farming.path .. "/food.lua")
dofile(farming.path .. "/compatibility.lua") -- Farming Plus compatibility
if farming.mtg then
dofile(farming.path .. "/compatibility.lua") -- Farming Plus compatibility
end
if minetest.get_modpath("lucky_block") then if minetest.get_modpath("lucky_block") then
dofile(farming.path .. "/lucky_block.lua") dofile(farming.path .. "/lucky_block.lua")

16
mcl_grass.lua Normal file
View File

@ -0,0 +1,16 @@
-- Override mcl grass and have it drop Wheat and Oat Seeds
minetest.override_item("mcl_flowers:tallgrass", {
drop = {
max_items = 1,
items = {
{items = {"mcl_farming:wheat_seeds"}, rarity = 5},
{items = {"farming:seed_oat"},rarity = 5},
{items = {"farming:seed_barley"}, rarity = 5},
{items = {"farming:seed_rye"},rarity = 5},
{items = {"farming:seed_cotton"}, rarity = 8},
{items = {"farming:seed_rice"},rarity = 8}
}
}
})

View File

@ -1,5 +1,4 @@
name = farming name = farming
description = Adds many new plants and food into Minetest. description = Adds many new plants and food into Minetest.
depends = default optional_depends = default, mcl_core, mcl_sounds, mcl_farming, mcl_stairs, stairs, lucky_block, toolranks
optional_depends = stairs, lucky_block, toolranks
min_minetest_version = 5.0 min_minetest_version = 5.0