diff --git a/bushes_classic/cooking.lua b/bushes_classic/cooking.lua new file mode 100644 index 0000000..a0d870f --- /dev/null +++ b/bushes_classic/cooking.lua @@ -0,0 +1,81 @@ +-- Basket +minetest.register_node(":bushes:basket_empty", { + description = "Basket", + tiles = { + "bushes_basket_empty_top.png", + "bushes_basket_bottom.png", + "bushes_basket_side.png" + }, + groups = { dig_immediate = 3 }, +}) + +minetest.register_craft({ + output = ':bushes:basket_empty', + recipe = { + { 'default:stick', 'default:stick', 'default:stick' }, + { '', 'default:stick', '' }, + }, +}) + +-- Sugar +minetest.register_craftitem(":bushes:sugar", { + description = "Sugar", + inventory_image = "bushes_sugar.png", + on_use = minetest.item_eat(1), +}) + +minetest.register_craft({ + output = 'bushes:sugar 1', + recipe = { + { 'default:papyrus', 'default:papyrus' }, + }, +}) + +-- Raw pie +minetest.register_craftitem(":bushes:berry_pie_raw", { + description = "Raw berry pie", + inventory_image = "bushes_berry_pie_raw.png", + on_use = minetest.item_eat(3), +}) + +minetest.register_craft({ + output = 'bushes:berry_pie_raw 1', + recipe = { + { 'bushes:sugar', 'default:junglegrass', 'bushes:sugar' }, + { 'bushes:strawberry', 'bushes:strawberry', 'bushes:strawberry' }, + }, +}) + +-- Cooked pie +minetest.register_craftitem(":bushes:berry_pie_cooked", { + description = "Cooked berry pie", + inventory_image = "bushes_berry_pie_cooked.png", + on_use = minetest.item_eat(4), +}) + +minetest.register_craft({ + type = 'cooking', + output = 'bushes:berry_pie_cooked', + recipe = 'bushes:berry_pie_raw', + cooktime = 30, +}) + +-- Basket with pies +minetest.register_node(":bushes:basket_pies", { + description = "Basket with pies", + tiles = { + "bushes_basket_full_top.png", + "bushes_basket_bottom.png", + "bushes_basket_side.png" + }, + on_use = minetest.item_eat(15), + groups = { dig_immediate = 3 }, +}) + +minetest.register_craft({ + output = 'bushes:basket_pies 1', + recipe = { + { 'bushes:berry_pie_cooked', 'bushes:berry_pie_cooked', 'bushes:berry_pie_cooked' }, + { '', 'bushes:basket_empty', '' }, + }, +}) diff --git a/bushes_classic/depends.txt b/bushes_classic/depends.txt new file mode 100644 index 0000000..d1473e1 --- /dev/null +++ b/bushes_classic/depends.txt @@ -0,0 +1,2 @@ +default +plants_lib diff --git a/bushes_classic/init.lua b/bushes_classic/init.lua new file mode 100644 index 0000000..a49a72f --- /dev/null +++ b/bushes_classic/init.lua @@ -0,0 +1,67 @@ +local BUSHES = { + "strawberry", +} + +local BUSHES_DESCRIPTIONS = { + "Strawberry", +} + +local spawn_list = {} + +for i, bush_name in ipairs(BUSHES) do + minetest.register_node(":bushes:" .. bush_name .. "_bush", { + description = BUSHES_DESCRIPTIONS[i] .. " bush", + drawtype = "plantlike", + visual_scale = 1.3, + tiles = { "bushes_" .. bush_name .. "_bush.png" }, + inventory_image = "bushes_" .. bush_name .. "_bush.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + drop = 'bushes:' .. bush_name .. ' 4', + groups = { snappy = 3, bush = 1, flammable = 2}, + sounds = default.node_sound_leaves_defaults(), + }) + + minetest.register_craftitem(":bushes:" .. bush_name, { + description = BUSHES_DESCRIPTIONS[i], + inventory_image = "bushes_" .. bush_name .. ".png", + stack_max = 99, + on_use = minetest.item_eat(1), + }) + + minetest.register_craft({ + output = 'bushes:' .. bush_name .. '_bush', + recipe = { + { 'bushes:' .. bush_name, 'bushes:' .. bush_name, 'bushes:' .. bush_name }, + { 'bushes:' .. bush_name, 'bushes:' .. bush_name, 'bushes:' .. bush_name }, + } + }) + + table.insert(spawn_list, "bushes:"..bush_name.."_bush") +end + +plantslib:spawn_on_surfaces({ + spawn_delay = 3600, + spawn_plants = spawn_list, + avoid_radius = 10, + spawn_chance = 100, + spawn_surfaces = { + "default:dirt_with_grass", + "woodsoils:dirt_with_leaves_1", + "woodsoils:grass_with_leaves_1", + "woodsoils:grass_with_leaves_2" + }, + avoid_nodes = {"group:bush"}, + seed_diff = 545342534, -- guaranteed to be random :P + plantlife_limit = -0.1, + light_min = 10, + temp_min = 0.15, -- approx 20C + temp_max = -0.15, -- approx 35C + humidity_min = 0, -- 50% RH + humidity_max = -1, -- 100% RH +}) + +dofile(minetest.get_modpath('bushes_classic') .. '/cooking.lua') + +print("[Bushes] Loaded.") diff --git a/bushes_classic/textures/bushes_basket_bottom.png b/bushes_classic/textures/bushes_basket_bottom.png new file mode 100644 index 0000000..4c84f0f Binary files /dev/null and b/bushes_classic/textures/bushes_basket_bottom.png differ diff --git a/bushes_classic/textures/bushes_basket_empty_top.png b/bushes_classic/textures/bushes_basket_empty_top.png new file mode 100644 index 0000000..29ade35 Binary files /dev/null and b/bushes_classic/textures/bushes_basket_empty_top.png differ diff --git a/bushes_classic/textures/bushes_basket_full_top.png b/bushes_classic/textures/bushes_basket_full_top.png new file mode 100644 index 0000000..95bb54d Binary files /dev/null and b/bushes_classic/textures/bushes_basket_full_top.png differ diff --git a/bushes_classic/textures/bushes_basket_side.png b/bushes_classic/textures/bushes_basket_side.png new file mode 100644 index 0000000..8357893 Binary files /dev/null and b/bushes_classic/textures/bushes_basket_side.png differ diff --git a/bushes_classic/textures/bushes_berry_pie_cooked.png b/bushes_classic/textures/bushes_berry_pie_cooked.png new file mode 100644 index 0000000..6dca983 Binary files /dev/null and b/bushes_classic/textures/bushes_berry_pie_cooked.png differ diff --git a/bushes_classic/textures/bushes_berry_pie_raw.png b/bushes_classic/textures/bushes_berry_pie_raw.png new file mode 100644 index 0000000..add8bdb Binary files /dev/null and b/bushes_classic/textures/bushes_berry_pie_raw.png differ diff --git a/bushes_classic/textures/bushes_strawberry.png b/bushes_classic/textures/bushes_strawberry.png new file mode 100644 index 0000000..58282b1 Binary files /dev/null and b/bushes_classic/textures/bushes_strawberry.png differ diff --git a/bushes_classic/textures/bushes_strawberry_bush.png b/bushes_classic/textures/bushes_strawberry_bush.png new file mode 100644 index 0000000..b0ed963 Binary files /dev/null and b/bushes_classic/textures/bushes_strawberry_bush.png differ diff --git a/bushes_classic/textures/bushes_sugar.png b/bushes_classic/textures/bushes_sugar.png new file mode 100644 index 0000000..10ecf70 Binary files /dev/null and b/bushes_classic/textures/bushes_sugar.png differ