mirror of
https://codeberg.org/tenplus1/farming.git
synced 2025-06-29 23:01:00 +02:00
separate food /non-food items from crop files, tidy code
This commit is contained in:
@ -1,22 +1,23 @@
|
||||
|
||||
local S = farming.translate
|
||||
local S = minetest.get_translator("farming")
|
||||
|
||||
-- item/seed
|
||||
|
||||
-- asparagus
|
||||
minetest.register_craftitem("farming:asparagus", {
|
||||
description = S("Asparagus"),
|
||||
inventory_image = "farming_asparagus.png",
|
||||
groups = {
|
||||
compostability = 48, seed = 2, food_asparagus = 1
|
||||
},
|
||||
groups = {compostability = 48, seed = 2, food_asparagus = 1},
|
||||
on_use = minetest.item_eat(1),
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return farming.place_seed(itemstack, placer, pointed_thing, "farming:asparagus_1")
|
||||
end,
|
||||
on_use = minetest.item_eat(1)
|
||||
end
|
||||
})
|
||||
|
||||
farming.add_eatable("farming:asparagus", 1)
|
||||
|
||||
-- asparagus definition
|
||||
-- crop definition
|
||||
|
||||
local def = {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_asparagus_1.png"},
|
||||
@ -39,17 +40,21 @@ local def = {
|
||||
}
|
||||
|
||||
-- stage 1
|
||||
|
||||
minetest.register_node("farming:asparagus_1", table.copy(def))
|
||||
|
||||
-- stage 2
|
||||
|
||||
def.tiles = {"farming_asparagus_2.png"}
|
||||
minetest.register_node("farming:asparagus_2", table.copy(def))
|
||||
|
||||
-- stage 3
|
||||
|
||||
def.tiles = {"farming_asparagus_3.png"}
|
||||
minetest.register_node("farming:asparagus_3", table.copy(def))
|
||||
|
||||
-- stage 4
|
||||
|
||||
def.tiles = {"farming_asparagus_4.png"}
|
||||
def.drop = {
|
||||
items = {
|
||||
@ -58,7 +63,8 @@ def.drop = {
|
||||
}
|
||||
minetest.register_node("farming:asparagus_4", table.copy(def))
|
||||
|
||||
-- stage 5
|
||||
-- stage 5 (final)
|
||||
|
||||
def.tiles = {"farming_asparagus_5.png"}
|
||||
def.groups.growing = nil
|
||||
def.selection_box = farming.select_final
|
||||
@ -71,6 +77,7 @@ def.drop = {
|
||||
minetest.register_node("farming:asparagus_5", table.copy(def))
|
||||
|
||||
-- add to registered_plants
|
||||
|
||||
farming.registered_plants["farming:asparagus"] = {
|
||||
crop = "farming:asparagus",
|
||||
seed = "farming:asparagus",
|
||||
@ -80,6 +87,7 @@ farming.registered_plants["farming:asparagus"] = {
|
||||
}
|
||||
|
||||
-- mapgen
|
||||
|
||||
minetest.register_decoration({
|
||||
name = "farming:asparagus_5",
|
||||
deco_type = "simple",
|
||||
|
Reference in New Issue
Block a user