From 85b3fef4bf9741db1cc1952990c708d6c77bcd32 Mon Sep 17 00:00:00 2001 From: kay27 Date: Mon, 21 Jun 2021 03:58:18 +0400 Subject: [PATCH] [mineclone5] Move sweet berries into farming as a quick fix --- mods/ITEMS/mcl_farming/init.lua | 3 + mods/ITEMS/mcl_farming/sweet_berry.lua | 56 +++++++++++ .../textures/mcl_farming_sweet_berry.png} | Bin .../mcl_farming_sweet_berry_bush_0.png} | Bin .../mcl_farming_sweet_berry_bush_1.png} | Bin .../mcl_farming_sweet_berry_bush_2.png} | Bin .../mcl_farming_sweet_berry_bush_3.png} | Bin mods/ITEMS/mcl_sweet_berry/init.lua | 89 ------------------ mods/ITEMS/mcl_sweet_berry/mod.conf | 2 - 9 files changed, 59 insertions(+), 91 deletions(-) create mode 100644 mods/ITEMS/mcl_farming/sweet_berry.lua rename mods/ITEMS/{mcl_sweet_berry/textures/sweet_berry.png => mcl_farming/textures/mcl_farming_sweet_berry.png} (100%) rename mods/ITEMS/{mcl_sweet_berry/textures/sweet_berry_bush_0.png => mcl_farming/textures/mcl_farming_sweet_berry_bush_0.png} (100%) rename mods/ITEMS/{mcl_sweet_berry/textures/sweet_berry_bush_1.png => mcl_farming/textures/mcl_farming_sweet_berry_bush_1.png} (100%) rename mods/ITEMS/{mcl_sweet_berry/textures/sweet_berry_bush_2.png => mcl_farming/textures/mcl_farming_sweet_berry_bush_2.png} (100%) rename mods/ITEMS/{mcl_sweet_berry/textures/sweet_berry_bush_3.png => mcl_farming/textures/mcl_farming_sweet_berry_bush_3.png} (100%) delete mode 100644 mods/ITEMS/mcl_sweet_berry/init.lua delete mode 100644 mods/ITEMS/mcl_sweet_berry/mod.conf diff --git a/mods/ITEMS/mcl_farming/init.lua b/mods/ITEMS/mcl_farming/init.lua index adce058ee3..60b10105de 100644 --- a/mods/ITEMS/mcl_farming/init.lua +++ b/mods/ITEMS/mcl_farming/init.lua @@ -27,3 +27,6 @@ dofile(minetest.get_modpath("mcl_farming").."/potatoes.lua") -- ========= BEETROOT ========= dofile(minetest.get_modpath("mcl_farming").."/beetroot.lua") + +-- ========= SWEET BERRY ========= +dofile(minetest.get_modpath("mcl_farming").."/sweet_berry.lua") diff --git a/mods/ITEMS/mcl_farming/sweet_berry.lua b/mods/ITEMS/mcl_farming/sweet_berry.lua new file mode 100644 index 0000000000..2feba11268 --- /dev/null +++ b/mods/ITEMS/mcl_farming/sweet_berry.lua @@ -0,0 +1,56 @@ +local S = minetest.get_translator(minetest.get_current_modname()) + +for i=0, 3 do + local texture = "mcl_farming_sweet_berry_bush_" .. i .. ".png" + local node_name = "mcl_farming:sweet_berry_bush_" .. i + minetest.register_node(node_name, { + drawtype = "plantlike", + tiles = {texture}, + description = S("Sweet Berry Bush (Stage @1)", i), + paramtype = "light", + sunlight_propagates = true, + paramtype2 = "meshoptions", + place_param2 = 3, + walkable = false, + drop = "mcl_farming:sweet_berry", + selection_box = { + type = "fixed", + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16}, + }, + inventory_image = texture, + wield_image = texture, + groups = {dig_immediate=3, not_in_creative_inventory=1,plant=1,attached_node=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1}, + sounds = mcl_sounds.node_sound_leaves_defaults(), + _mcl_blast_resistance = 0, + }) + minetest.register_alias("mcl_sweet_berry:sweet_berry_bush_" .. i, node_name) +end + +minetest.register_craftitem("mcl_farming:sweet_berry", { + description = S("Sweet Berry"), + inventory_image = "mcl_farming_sweet_berry.png", + _mcl_saturation = 0.2, + stack_max = 64, + groups = { food = 2, eatable = 1 }, + on_secondary_use = minetest.item_eat(1), + on_place = function(itemstack, placer, pointed_thing) + local new = mcl_farming:place_seed(itemstack, placer, pointed_thing, "mcl_sweet_berry:sweet_berry_bush_0") + if new then + return new + else + return minetest.do_item_eat(1, nil, itemstack, placer, pointed_thing) + end + end, +}) +minetest.register_alias("mcl_sweet_berry:sweet_berry", "mcl_farming:sweet_berry") + +minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_core:dirt_with_grass"}, + sidelen = 16, + noise_params = {offset=0, scale=.45, spread={x=100, y=100, z=100}, seed=354, octaves=3, persist=0.7}, + biomes = {"Taiga","Forest"}, + y_max = mcl_vars.mg_overworld_max, + y_min = mcl_vars.mg_overworld_min, + decoration = "mcl_sweet_berry:sweet_berry_bush_2" +}) diff --git a/mods/ITEMS/mcl_sweet_berry/textures/sweet_berry.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry.png similarity index 100% rename from mods/ITEMS/mcl_sweet_berry/textures/sweet_berry.png rename to mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry.png diff --git a/mods/ITEMS/mcl_sweet_berry/textures/sweet_berry_bush_0.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry_bush_0.png similarity index 100% rename from mods/ITEMS/mcl_sweet_berry/textures/sweet_berry_bush_0.png rename to mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry_bush_0.png diff --git a/mods/ITEMS/mcl_sweet_berry/textures/sweet_berry_bush_1.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry_bush_1.png similarity index 100% rename from mods/ITEMS/mcl_sweet_berry/textures/sweet_berry_bush_1.png rename to mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry_bush_1.png diff --git a/mods/ITEMS/mcl_sweet_berry/textures/sweet_berry_bush_2.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry_bush_2.png similarity index 100% rename from mods/ITEMS/mcl_sweet_berry/textures/sweet_berry_bush_2.png rename to mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry_bush_2.png diff --git a/mods/ITEMS/mcl_sweet_berry/textures/sweet_berry_bush_3.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry_bush_3.png similarity index 100% rename from mods/ITEMS/mcl_sweet_berry/textures/sweet_berry_bush_3.png rename to mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry_bush_3.png diff --git a/mods/ITEMS/mcl_sweet_berry/init.lua b/mods/ITEMS/mcl_sweet_berry/init.lua deleted file mode 100644 index bc79a76678..0000000000 --- a/mods/ITEMS/mcl_sweet_berry/init.lua +++ /dev/null @@ -1,89 +0,0 @@ -minetest.register_craftitem("mcl_sweet_berry:sweet_berry", { - description = "Sweet Berry", - inventory_image = "sweet_berry.png", - on_use = minetest.item_eat(2) -}) -minetest.register_node("mcl_sweet_berry:sweet_berry_bush_0", { - drawtype = "plantlike", - tiles = {"sweet_berry_bush_0.png"}, - damage_per_second = 1, - selection_box = { - type = "fixed", - fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16}, - }, - drop = "" -}) -minetest.register_node("mcl_sweet_berry:sweet_berry_bush_1", { - drawtype = "plantlike", - tiles = {"sweet_berry_bush_1.png"}, - damage_per_second = 1, - selection_box = { - type = "fixed", - fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16}, - }, - drop = "" -}) -minetest.register_node("mcl_sweet_berry:sweet_berry_bush_2", { - drawtype = "plantlike", - tiles = {"sweet_berry_bush_2.png"}, - damage_per_second = 2, - selection_box = { - type = "fixed", - fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16}, - }, - drop = "mcl_sweet_berry:sweet_berry 2" -}) -minetest.register_node("mcl_sweet_berry:sweet_berry_bush_3", { - drawtype = "plantlike", - tiles = {"sweet_berry_bush_3.png"}, - damage_per_second = 2, - selection_box = { - type = "fixed", - fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16}, - }, - drop = "mcl_sweet_berry:sweet_berry 3" -}) -minetest.register_decoration({ - deco_type = "simple", - place_on = {"mcl_core:dirt_with_grass"}, - sidelen = 16, - fill_ratio = 0.1, - biomes = {"Taiga","Forest"}, - y_max = mcl_vars.mg_overworld_max, - y_min = mcl_vars.mg_overworld_min, - decoration = "mcl_sweet_berry:sweet_berry_bush_2" -}) -minetest.register_abm({ - nodenames = {"mcl_sweet_berry:sweet_berry_bush_0"}, - interval = 10.0, - chance = 16, - action = function(pos, node, active_object_count, active_object_count_wider) - minetest.set_node(pos, {name = "mcl_sweet_berry:sweet_berry_bush_1"}) - end -}) -minetest.register_abm({ - nodenames = {"mcl_sweet_berry:sweet_berry_bush_1"}, - interval = 10.0, - chance = 16, - action = function(pos, node, active_object_count, active_object_count_wider) - minetest.set_node(pos, {name = "mcl_sweet_berry:sweet_berry_bush_2"}) - end -}) -minetest.register_abm({ - nodenames = {"mcl_sweet_berry:sweet_berry_bush_2"}, - interval = 10.0, - chance = 16, - action = function(pos, node, active_object_count, active_object_count_wider) - minetest.set_node(pos, {name = "mcl_sweet_berry:sweet_berry_bush_3"}) - end -}) - ---taken from mc modpack by TechDude/TechDudie - - - - - - - - diff --git a/mods/ITEMS/mcl_sweet_berry/mod.conf b/mods/ITEMS/mcl_sweet_berry/mod.conf deleted file mode 100644 index 026f1e260b..0000000000 --- a/mods/ITEMS/mcl_sweet_berry/mod.conf +++ /dev/null @@ -1,2 +0,0 @@ -name=mcl_sweet_berry -depends=mcl_init