minetest.register_craftitem("farming:orange_seed", { description = "Orange Seeds", inventory_image = "farming_orange_seed.png", on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:orange_1") end }) minetest.register_craftitem("farming:orange_item", { description = "Orange", inventory_image = "farming_orange.png", on_use = minetest.item_eat(4), on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:orange_1") end }) -- orange definition local crop_def = { paramtype = "plantlike", walkable = false, paramtype = "light", sunlight_propagates = true, buildable_to = true, drawtype = "plantlike", drop = "", tiles = {"farming_orange_1.png"}, selection_box = farming.select, groups = {snappy=3, flammable=2, not_in_creative_inventory=1,plant=1,growing=1}, sounds = default.node_sound_leaves_defaults(), } -- stage 1 minetest.register_node("farming:orange_1", table.copy(crop_def)) -- stage 2 crop_def.tiles = {"farming_orange_2.png"} minetest.register_node("farming:orange_2", table.copy(crop_def)) -- stage 3 crop_def.tiles = {"farming_orange_3.png"} minetest.register_node("farming:orange_3", table.copy(crop_def)) -- stage 4 crop_def.tiles = {"farming_orange_4.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { { items = {'farming:orange_seed'} }, { items = {'farming:orange_seed'}, rarity = 2}, { items = {'farming:orange_seed'}, rarity = 5}, { items = {'farming:orange_item'} }, { items = {'farming:orange_item'}, rarity = 2 }, { items = {'farming:orange_item'}, rarity = 5 }, } } minetest.register_node("farming:orange_4", table.copy(crop_def))