From eb313f94820a912ce7581a54403fa24b2be98a8b Mon Sep 17 00:00:00 2001 From: kay27 Date: Mon, 21 Jun 2021 03:58:18 +0400 Subject: [PATCH 01/14] [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 0 -> 462 bytes .../mcl_farming_sweet_berry_bush_0.png | Bin 0 -> 318 bytes .../mcl_farming_sweet_berry_bush_1.png | Bin 0 -> 759 bytes .../mcl_farming_sweet_berry_bush_2.png | Bin 0 -> 800 bytes .../mcl_farming_sweet_berry_bush_3.png | Bin 0 -> 858 bytes 7 files changed, 59 insertions(+) create mode 100644 mods/ITEMS/mcl_farming/sweet_berry.lua create mode 100644 mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry.png create mode 100644 mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry_bush_0.png create mode 100644 mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry_bush_1.png create mode 100644 mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry_bush_2.png create mode 100644 mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry_bush_3.png diff --git a/mods/ITEMS/mcl_farming/init.lua b/mods/ITEMS/mcl_farming/init.lua index adce058ee..60b10105d 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 000000000..2feba1126 --- /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_farming/textures/mcl_farming_sweet_berry.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry.png new file mode 100644 index 0000000000000000000000000000000000000000..7c2349971a2e174a47503ff35b02042f9ac1fbc8 GIT binary patch literal 462 zcmV;<0WtoGP)^X9;Q12-i!Br-q88fN zh=q+H5>5-{un3n#ECji+$R06g3=s>b+MS*EF|z~wG1yNJO2}mZ698cNZfRgfCFJz! zs!6x|2c(1~C8Xc4p7+SD0KoIfS$Iz>A5>NC)?uGV;=@v;a=cDgX6#B6A&zUeck3p#sB~S07*qoM6N<$ Ef}ml$+yDRo literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry_bush_0.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry_bush_0.png new file mode 100644 index 0000000000000000000000000000000000000000..6f8c0d833dd5b5b8e805381bbaa837cc5714f15d GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;RN#5=* zK)Q}WWwyT57a)tXz$3Dlfq`2Xgc%uT&5-~Kp7V5Z46!)L&*h~4y1#r2U$xa{tevmgzW2+W{ST^)Bjvav#OJQNS;J+%TrBU=5hmjV2A)7(-UHdjYaV=d ziIiP+rN!!L&zTBE;V>*$%MP5lioGA7innIIzetvs*gm;JRn-)C$C`i#NT L)z4*}Q$iB}C5wK% literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry_bush_1.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry_bush_1.png new file mode 100644 index 0000000000000000000000000000000000000000..2ac3c205d8de804a93cce796b342b78adf868f02 GIT binary patch literal 759 zcmV;|K8)5Ms#YD~H@Zrr#~lqd7pb-I4FyHw&ywD^L@_wJ%J~!#km`9Z>3$k z7~>n8N1vM-{seVP>&e;D;0cEVWbvM@+7-vGIj!D=D^I+YDIUTT&X>m*|=* ztl^TKlglRZU!Z{yTUbY&>FbX6A(P7aj8rgh?_|cETFLlO)lha1ui_zk7(xy8w1v?S zvzW8G|FPMTNAlUSaz3Y*3?ic)4;TqUOrnBgI!*!C#p^ z>C_}K7FCT!=TuseQkW=&iAE=j002ovPDHLkV1iO?W`6(x literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry_bush_2.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_sweet_berry_bush_2.png new file mode 100644 index 0000000000000000000000000000000000000000..5e9a6dd1473581ec441c431004954550cc7968f9 GIT binary patch literal 800 zcmV+*1K<3KP)L$Ol^4@_fX_R{*>pgZ%cyX7N_l~$cCe_d4}tqt7;k zt}M4VDFc7)y`AxNNY`@8dI(&^<=l?61UW%1ys#k-puzSr5WUh^x4X1(bq)=}Y4AAHG?g$wXm%bR=F>uBJ59RBD0k z-K0$NhA8^kQ+@AY3%mbD`DE&>c=)1cANUF{W8}+1>FBGEWUg5$WiMUd89tdTl~tp> zRQz4f^nZ?eu&)E5A8(!0kr|Rr9Mhj$ZGL+f%N91eRO%}p&Y#C>^N~^TpCTpEjl*tk zoDl|TQKS6zQvLby=ko8EU4B!wR&spc?PjSO!T&TdkAA4npx eM#Fd23-C8XMgbTICgrjK0000Nc*%TVBmik8Wg6nNw*^^Q`ET9%#7iukB+^R` zCG~J!ueK`ErkqpTn(GA6fw_PSNN_w91I%f_EI{e|tK@R0Pw*oO3+tb1e*zFswL~`f zU*Vr|6KDVmz)TL5M1|Kuna9_%OBrfeU!)`8C6f;TjSs7jo{2^W zPuZu{097K82ZlpW)2$iZ6o^kWoP97FqVG#Z&zh62=-kI7QX+*Z>D0 zIRO#yuMC$R0UEk`M%P;-S&8|6<8{X_2f1(G61FUsRSa{|28;no(I$yNet$x(3?_5# zeNDkhKxo~pXQa{63XUDa`jkJ$ zbn#-Z<|xx(cMdE1|7a~0-iN>h;0EMr4br%r-BKRplqFtBj!R%=DRE`n!@)tN<3ei1 zjn4s5w?yCt&<_j%s_=vRWMC1`hocm^-QD58OU=F8JX@D}GTT4rq*bpB*QRB1AExv+u5cW5|MtiJq5G^Xqu@ajmU` z;ry0?70MNQhMc?|TZ&f-{sPTyVAu#%8y?7M0Lp}U<5D$OZX*7GEfRs z(VuEY6x^7WhJ`_u?>di@ZR8D=MrDs3D$DT`V9hMk4vR*yE5@)|ik453HAX4--Xi$N kb^0e}5Ff9ld!!fOE6@cdU4}wSs{jB107*qoM6N<$g3s%Fu>b%7 literal 0 HcmV?d00001 From a7c3878caeeb53e0a665d021b928aff904c3a9cc Mon Sep 17 00:00:00 2001 From: kay27 Date: Mon, 21 Jun 2021 04:51:05 +0400 Subject: [PATCH 02/14] [mineclone5] Tune sweet berries a bit --- mods/ITEMS/mcl_farming/sweet_berry.lua | 27 +++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/mods/ITEMS/mcl_farming/sweet_berry.lua b/mods/ITEMS/mcl_farming/sweet_berry.lua index 2feba1126..d74739aaa 100644 --- a/mods/ITEMS/mcl_farming/sweet_berry.lua +++ b/mods/ITEMS/mcl_farming/sweet_berry.lua @@ -12,7 +12,7 @@ for i=0, 3 do paramtype2 = "meshoptions", place_param2 = 3, walkable = false, - drop = "mcl_farming:sweet_berry", + drop = (i>=2) and ("mcl_farming:sweet_berry" .. (i==3 and " 3" or "")) or "", selection_box = { type = "fixed", fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16}, @@ -45,12 +45,21 @@ minetest.register_craftitem("mcl_farming:sweet_berry", { 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" + deco_type = "simple", + place_on = {"mcl_core:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = 0, + scale = 0.001, + spread = {x = 100, y = 100, z = 100}, + seed = 354, + octaves = 1, + persist = 0.5, + lacunarity = 1.0, + flags = "absvalue" + }, + biomes = {"Taiga","Forest"}, + y_max = mcl_vars.mg_overworld_max, + y_min = 2, + decoration = "mcl_sweet_berry:sweet_berry_bush_3" }) From 5f4d7774ae5a866907d556b5f998458cee1a23d7 Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 24 Oct 2022 01:00:41 +0200 Subject: [PATCH 03/14] Add sweet berry compostability --- mods/ITEMS/mcl_farming/sweet_berry.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_farming/sweet_berry.lua b/mods/ITEMS/mcl_farming/sweet_berry.lua index d74739aaa..f215851e3 100644 --- a/mods/ITEMS/mcl_farming/sweet_berry.lua +++ b/mods/ITEMS/mcl_farming/sweet_berry.lua @@ -31,7 +31,7 @@ minetest.register_craftitem("mcl_farming:sweet_berry", { inventory_image = "mcl_farming_sweet_berry.png", _mcl_saturation = 0.2, stack_max = 64, - groups = { food = 2, eatable = 1 }, + groups = { food = 2, eatable = 1, compostability=30 }, 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") From 495378b85ec6047e3a6bc238f8862678ca864ef8 Mon Sep 17 00:00:00 2001 From: balazsszalab Date: Sat, 18 Jun 2022 15:41:22 +0000 Subject: [PATCH 04/14] Register sweet berry bush by add_plant function to enable plant growth Without calling the add_plant function, sweet berry bushes will not go through growth stages and it is impossible to farm them. Sweet berry bush and beetroot have the same number of growth stages, so I used beetroot's interval and chance values here. If somebody has a better approximation of these values, feel free to change them. --- mods/ITEMS/mcl_farming/sweet_berry.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mods/ITEMS/mcl_farming/sweet_berry.lua b/mods/ITEMS/mcl_farming/sweet_berry.lua index f215851e3..cde2f8d97 100644 --- a/mods/ITEMS/mcl_farming/sweet_berry.lua +++ b/mods/ITEMS/mcl_farming/sweet_berry.lua @@ -63,3 +63,6 @@ minetest.register_decoration({ y_min = 2, decoration = "mcl_sweet_berry:sweet_berry_bush_3" }) + +-- TODO: Find proper interval and chance values for sweet berry bushes. Current interval and chance values are copied from mcl_farming:beetroot which has similar growth stages. +mcl_farming:add_plant("plant_sweet_berry_bush", "mcl_farming:sweet_berry_bush_3", {"mcl_farming:sweet_berry_bush_0", "mcl_farming:sweet_berry_bush_1", "mcl_farming:sweet_berry_bush_2"}, 68, 3) \ No newline at end of file From 280bcddcb2c32c55a737be4441207061d29c6e45 Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 24 Oct 2022 01:13:44 +0200 Subject: [PATCH 05/14] Move sweet berry decoration to mcl_biomes --- mods/ITEMS/mcl_farming/sweet_berry.lua | 22 +--------------------- mods/MAPGEN/mcl_biomes/init.lua | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/mods/ITEMS/mcl_farming/sweet_berry.lua b/mods/ITEMS/mcl_farming/sweet_berry.lua index cde2f8d97..773cdf1d8 100644 --- a/mods/ITEMS/mcl_farming/sweet_berry.lua +++ b/mods/ITEMS/mcl_farming/sweet_berry.lua @@ -44,25 +44,5 @@ minetest.register_craftitem("mcl_farming:sweet_berry", { }) 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 = 0.001, - spread = {x = 100, y = 100, z = 100}, - seed = 354, - octaves = 1, - persist = 0.5, - lacunarity = 1.0, - flags = "absvalue" - }, - biomes = {"Taiga","Forest"}, - y_max = mcl_vars.mg_overworld_max, - y_min = 2, - decoration = "mcl_sweet_berry:sweet_berry_bush_3" -}) - -- TODO: Find proper interval and chance values for sweet berry bushes. Current interval and chance values are copied from mcl_farming:beetroot which has similar growth stages. -mcl_farming:add_plant("plant_sweet_berry_bush", "mcl_farming:sweet_berry_bush_3", {"mcl_farming:sweet_berry_bush_0", "mcl_farming:sweet_berry_bush_1", "mcl_farming:sweet_berry_bush_2"}, 68, 3) \ No newline at end of file +mcl_farming:add_plant("plant_sweet_berry_bush", "mcl_farming:sweet_berry_bush_3", {"mcl_farming:sweet_berry_bush_0", "mcl_farming:sweet_berry_bush_1", "mcl_farming:sweet_berry_bush_2"}, 68, 3) diff --git a/mods/MAPGEN/mcl_biomes/init.lua b/mods/MAPGEN/mcl_biomes/init.lua index 2d2378833..0e1cace1f 100644 --- a/mods/MAPGEN/mcl_biomes/init.lua +++ b/mods/MAPGEN/mcl_biomes/init.lua @@ -2851,6 +2851,25 @@ local function register_decorations() flags = "place_center_x,place_center_z, force_placement", }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_core:dirt_with_grass","mcl_core:podzol"}, + sidelen = 16, + noise_params = { + offset = 0, + scale = 0.012, + spread = {x = 100, y = 100, z = 100}, + seed = 354, + octaves = 1, + persist = 0.5, + lacunarity = 1.0, + flags = "absvalue" + }, + biomes = {"Taiga","Forest"}, + y_max = mcl_vars.mg_overworld_max, + y_min = 2, + decoration = "mcl_sweet_berry:sweet_berry_bush_3" + }) -- Large ice spike minetest.register_decoration({ From b00f2784fff1f0c3eb29ff503d10adf37a183b1f Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 24 Oct 2022 15:10:09 +0200 Subject: [PATCH 06/14] Sweet berry bushes are flammable --- mods/ITEMS/mcl_farming/sweet_berry.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_farming/sweet_berry.lua b/mods/ITEMS/mcl_farming/sweet_berry.lua index 773cdf1d8..365c6a31b 100644 --- a/mods/ITEMS/mcl_farming/sweet_berry.lua +++ b/mods/ITEMS/mcl_farming/sweet_berry.lua @@ -19,7 +19,7 @@ for i=0, 3 do }, 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}, + 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, flammable=3, fire_encouragement=60, fire_flammability=20}, sounds = mcl_sounds.node_sound_leaves_defaults(), _mcl_blast_resistance = 0, }) From 8d456d8ff9f5e7ec238baf2c3bc10a32dbf9df4b Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 24 Oct 2022 16:03:24 +0200 Subject: [PATCH 07/14] implement sweet berry damage 0.5 per second while moving inside it --- mods/CORE/mcl_damage/init.lua | 1 + mods/ITEMS/mcl_farming/sweet_berry.lua | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/mods/CORE/mcl_damage/init.lua b/mods/CORE/mcl_damage/init.lua index aa9445954..773e7a43e 100644 --- a/mods/CORE/mcl_damage/init.lua +++ b/mods/CORE/mcl_damage/init.lua @@ -12,6 +12,7 @@ mcl_damage = { drown = {bypasses_armor = true}, starve = {bypasses_armor = true, bypasses_magic = true}, cactus = {}, + sweet_berry = {}, fall = {bypasses_armor = true}, fly_into_wall = {bypasses_armor = true}, -- unused out_of_world = {bypasses_armor = true, bypasses_magic = true, bypasses_invulnerability = true, bypasses_totem = true}, diff --git a/mods/ITEMS/mcl_farming/sweet_berry.lua b/mods/ITEMS/mcl_farming/sweet_berry.lua index 365c6a31b..e283149bc 100644 --- a/mods/ITEMS/mcl_farming/sweet_berry.lua +++ b/mods/ITEMS/mcl_farming/sweet_berry.lua @@ -46,3 +46,28 @@ minetest.register_alias("mcl_sweet_berry:sweet_berry", "mcl_farming:sweet_berry" -- TODO: Find proper interval and chance values for sweet berry bushes. Current interval and chance values are copied from mcl_farming:beetroot which has similar growth stages. mcl_farming:add_plant("plant_sweet_berry_bush", "mcl_farming:sweet_berry_bush_3", {"mcl_farming:sweet_berry_bush_0", "mcl_farming:sweet_berry_bush_1", "mcl_farming:sweet_berry_bush_2"}, 68, 3) + +local function berry_damage_check(obj) + local p = obj:get_pos() + if not p then return end + if not minetest.find_node_near(p,0.4,{"group:sweet_berry"},true) then return end + local v = obj:get_velocity() + if v.x < 0.1 and v.y < 0.1 and v.z < 0.1 then return end + + mcl_util.deal_damage(obj, 0.5, {type = "sweet_berry"}) +end + +local etime = 0 +minetest.register_globalstep(function(dtime) + etime = dtime + etime + if etime < 0.5 then return end + etime = 0 + for _,pl in pairs(minetest.get_connected_players()) do + berry_damage_check(pl) + end + for _,ent in pairs(minetest.luaentities) do + if ent.is_mob then + berry_damage_check(ent.object) + end + end +end) From 2b08f9ac532d9fe679d1c8c0284877838632aa0e Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 24 Oct 2022 16:03:48 +0200 Subject: [PATCH 08/14] Slow down player movement while inside sweet berry --- mods/ITEMS/mcl_farming/sweet_berry.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_farming/sweet_berry.lua b/mods/ITEMS/mcl_farming/sweet_berry.lua index e283149bc..3307dd271 100644 --- a/mods/ITEMS/mcl_farming/sweet_berry.lua +++ b/mods/ITEMS/mcl_farming/sweet_berry.lua @@ -11,15 +11,21 @@ for i=0, 3 do sunlight_propagates = true, paramtype2 = "meshoptions", place_param2 = 3, + liquid_viscosity = 15, + liquidtype = "source", + liquid_alternative_flowing = node_name, + liquid_alternative_source = node_name, + liquid_renewable = false, + liquid_range = 0, walkable = false, drop = (i>=2) and ("mcl_farming:sweet_berry" .. (i==3 and " 3" or "")) or "", selection_box = { type = "fixed", - fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16}, + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, (-0.30 + (i*0.25)), 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, flammable=3, fire_encouragement=60, fire_flammability=20}, + groups = {sweet_berry=1, 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, flammable=3, fire_encouragement=60, fire_flammability=20}, sounds = mcl_sounds.node_sound_leaves_defaults(), _mcl_blast_resistance = 0, }) From 2664fb871b7d9295b4d4b4f7ce63eb220daf2f09 Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 24 Oct 2022 16:23:14 +0200 Subject: [PATCH 09/14] sweet berries plantable not only on farming soil --- mods/ITEMS/mcl_campfires/init.lua | 16 ++++++++-------- mods/ITEMS/mcl_farming/sweet_berry.lua | 14 +++++++++----- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/mods/ITEMS/mcl_campfires/init.lua b/mods/ITEMS/mcl_campfires/init.lua index 195612533..083fbce57 100644 --- a/mods/ITEMS/mcl_campfires/init.lua +++ b/mods/ITEMS/mcl_campfires/init.lua @@ -59,18 +59,18 @@ for _, campfire in pairs(campfires) do drawtype = "mesh", mesh = "mcl_campfires_campfire_lit.obj", tiles = {{ - name="mcl_campfires_" .. campfire.techname .. "_fire.png", + name="mcl_campfires_" .. campfire.techname .. "_fire.png", animation={ - type="vertical_frames", - aspect_w=16, - aspect_h=16, + type="vertical_frames", + aspect_w=16, + aspect_h=16, length=2.0 }}, - {name="mcl_campfires_" .. campfire.techname .. "_log_lit.png", + {name="mcl_campfires_" .. campfire.techname .. "_log_lit.png", animation={ - type="vertical_frames", - aspect_w=16, - aspect_h=16, + type="vertical_frames", + aspect_w=16, + aspect_h=16, length=2.0 }} }, diff --git a/mods/ITEMS/mcl_farming/sweet_berry.lua b/mods/ITEMS/mcl_farming/sweet_berry.lua index 3307dd271..de5db82bc 100644 --- a/mods/ITEMS/mcl_farming/sweet_berry.lua +++ b/mods/ITEMS/mcl_farming/sweet_berry.lua @@ -1,5 +1,7 @@ local S = minetest.get_translator(minetest.get_current_modname()) +local planton = {"mcl_core:dirt_with_grass","mcl_core:dirt","mcl_core:podzol","mcl_core:coarse_dirt","mcl_farming:soil","mcl_moss:moss"} + for i=0, 3 do local texture = "mcl_farming_sweet_berry_bush_" .. i .. ".png" local node_name = "mcl_farming:sweet_berry_bush_" .. i @@ -40,12 +42,14 @@ minetest.register_craftitem("mcl_farming:sweet_berry", { groups = { food = 2, eatable = 1, compostability=30 }, 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) + if pointed_thing.type == "node" and table.indexof(planton,minetest.get_node(pointed_thing.under).name) ~= -1 and minetest.get_node(pointed_thing.above).name == "air" then + minetest.set_node(pointed_thing.above,{name="mcl_farming:sweet_berry_bush_0"}) + if not minetest.is_creative_enabled(placer:get_player_name()) then + itemstack:take_item() + end + return itemstack end + return minetest.do_item_eat(1, nil, itemstack, placer, pointed_thing) end, }) minetest.register_alias("mcl_sweet_berry:sweet_berry", "mcl_farming:sweet_berry") From d6c0561d5ababadbca04852c219929ce8b923400 Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 24 Oct 2022 16:32:40 +0200 Subject: [PATCH 10/14] Only do damage from stage 1 and up --- mods/ITEMS/mcl_farming/sweet_berry.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_farming/sweet_berry.lua b/mods/ITEMS/mcl_farming/sweet_berry.lua index de5db82bc..524e380f3 100644 --- a/mods/ITEMS/mcl_farming/sweet_berry.lua +++ b/mods/ITEMS/mcl_farming/sweet_berry.lua @@ -5,6 +5,10 @@ local planton = {"mcl_core:dirt_with_grass","mcl_core:dirt","mcl_core:podzol","m for i=0, 3 do local texture = "mcl_farming_sweet_berry_bush_" .. i .. ".png" local node_name = "mcl_farming:sweet_berry_bush_" .. i + local groups = {sweet_berry=1, 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, flammable=3, fire_encouragement=60, fire_flammability=20, compostability=30} + if i > 0 then + groups.sweet_berry_thorny = 1 + end minetest.register_node(node_name, { drawtype = "plantlike", tiles = {texture}, @@ -27,9 +31,10 @@ for i=0, 3 do }, inventory_image = texture, wield_image = texture, - groups = {sweet_berry=1, 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, flammable=3, fire_encouragement=60, fire_flammability=20}, + groups = groups, sounds = mcl_sounds.node_sound_leaves_defaults(), _mcl_blast_resistance = 0, + _mcl_hardness = 0, }) minetest.register_alias("mcl_sweet_berry:sweet_berry_bush_" .. i, node_name) end @@ -60,7 +65,7 @@ mcl_farming:add_plant("plant_sweet_berry_bush", "mcl_farming:sweet_berry_bush_3" local function berry_damage_check(obj) local p = obj:get_pos() if not p then return end - if not minetest.find_node_near(p,0.4,{"group:sweet_berry"},true) then return end + if not minetest.find_node_near(p,0.4,{"group:sweet_berry_thorny"},true) then return end local v = obj:get_velocity() if v.x < 0.1 and v.y < 0.1 and v.z < 0.1 then return end From ae91640234c4d5271bb8ad4658da52bc6b5e9246 Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 24 Oct 2022 16:35:47 +0200 Subject: [PATCH 11/14] Add missing biomes, correct saturation --- mods/ITEMS/mcl_farming/sweet_berry.lua | 3 +-- mods/MAPGEN/mcl_biomes/init.lua | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_farming/sweet_berry.lua b/mods/ITEMS/mcl_farming/sweet_berry.lua index 524e380f3..573e50a5c 100644 --- a/mods/ITEMS/mcl_farming/sweet_berry.lua +++ b/mods/ITEMS/mcl_farming/sweet_berry.lua @@ -42,8 +42,7 @@ 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, + _mcl_saturation = 0.4, groups = { food = 2, eatable = 1, compostability=30 }, on_secondary_use = minetest.item_eat(1), on_place = function(itemstack, placer, pointed_thing) diff --git a/mods/MAPGEN/mcl_biomes/init.lua b/mods/MAPGEN/mcl_biomes/init.lua index 0e1cace1f..e5f9333be 100644 --- a/mods/MAPGEN/mcl_biomes/init.lua +++ b/mods/MAPGEN/mcl_biomes/init.lua @@ -2865,7 +2865,7 @@ local function register_decorations() lacunarity = 1.0, flags = "absvalue" }, - biomes = {"Taiga","Forest"}, + biomes = {"Taiga","ColdTaiga","MegaTaiga","MegaSpruceTaiga", "Forest"}, y_max = mcl_vars.mg_overworld_max, y_min = 2, decoration = "mcl_sweet_berry:sweet_berry_bush_3" From e8b983bcc5cb04f0614abc438c9f474f6ca3908c Mon Sep 17 00:00:00 2001 From: PrairieWind Date: Tue, 25 Oct 2022 20:46:41 -0600 Subject: [PATCH 12/14] Place sweet berries on wet farmland and bonemeal the sweet berries to progress growth --- mods/ITEMS/mcl_dye/init.lua | 4 ++++ mods/ITEMS/mcl_farming/sweet_berry.lua | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_dye/init.lua b/mods/ITEMS/mcl_dye/init.lua index 727a78460..55ba36acc 100644 --- a/mods/ITEMS/mcl_dye/init.lua +++ b/mods/ITEMS/mcl_dye/init.lua @@ -281,6 +281,10 @@ local function apply_bone_meal(pointed_thing) if math.random(1, 100) <= 75 then return mcl_farming:grow_plant("plant_beetroot", pos, n, 1, true) end + elseif string.find(n.name, "mcl_farming:sweet_berry_bush_") then + mcl_dye.add_bone_meal_particle(pos) + local stages = math.random(2, 3) + return mcl_farming:grow_plant("plant_sweet_berry_bush", pos, n, stages, true) elseif n.name == "mcl_cocoas:cocoa_1" or n.name == "mcl_cocoas:cocoa_2" then mcl_dye.add_bone_meal_particle(pos) -- Cocoa: Advance by 1 stage diff --git a/mods/ITEMS/mcl_farming/sweet_berry.lua b/mods/ITEMS/mcl_farming/sweet_berry.lua index 573e50a5c..f87220d90 100644 --- a/mods/ITEMS/mcl_farming/sweet_berry.lua +++ b/mods/ITEMS/mcl_farming/sweet_berry.lua @@ -1,6 +1,6 @@ local S = minetest.get_translator(minetest.get_current_modname()) -local planton = {"mcl_core:dirt_with_grass","mcl_core:dirt","mcl_core:podzol","mcl_core:coarse_dirt","mcl_farming:soil","mcl_moss:moss"} +local planton = {"mcl_core:dirt_with_grass", "mcl_core:dirt", "mcl_core:podzol", "mcl_core:coarse_dirt", "mcl_farming:soil", "mcl_farming:soil_wet", "mcl_moss:moss"} for i=0, 3 do local texture = "mcl_farming_sweet_berry_bush_" .. i .. ".png" From ba9d10055e3a686341503644cc510ee5c7ddaab9 Mon Sep 17 00:00:00 2001 From: cora Date: Wed, 26 Oct 2022 23:40:06 +0200 Subject: [PATCH 13/14] always advance growth stage by 1 on bonemeal --- mods/ITEMS/mcl_dye/init.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_dye/init.lua b/mods/ITEMS/mcl_dye/init.lua index 55ba36acc..3eebcecec 100644 --- a/mods/ITEMS/mcl_dye/init.lua +++ b/mods/ITEMS/mcl_dye/init.lua @@ -283,8 +283,7 @@ local function apply_bone_meal(pointed_thing) end elseif string.find(n.name, "mcl_farming:sweet_berry_bush_") then mcl_dye.add_bone_meal_particle(pos) - local stages = math.random(2, 3) - return mcl_farming:grow_plant("plant_sweet_berry_bush", pos, n, stages, true) + return mcl_farming:grow_plant("plant_sweet_berry_bush", pos, n, 1, true) elseif n.name == "mcl_cocoas:cocoa_1" or n.name == "mcl_cocoas:cocoa_2" then mcl_dye.add_bone_meal_particle(pos) -- Cocoa: Advance by 1 stage From 9e3163ec42f8f6624aff467072411d341dbca565 Mon Sep 17 00:00:00 2001 From: cora Date: Thu, 27 Oct 2022 00:19:38 +0200 Subject: [PATCH 14/14] Drop sweet berry item when bone mealing mature bush --- mods/ITEMS/mcl_dye/init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_dye/init.lua b/mods/ITEMS/mcl_dye/init.lua index 3eebcecec..1d39a0598 100644 --- a/mods/ITEMS/mcl_dye/init.lua +++ b/mods/ITEMS/mcl_dye/init.lua @@ -283,7 +283,11 @@ local function apply_bone_meal(pointed_thing) end elseif string.find(n.name, "mcl_farming:sweet_berry_bush_") then mcl_dye.add_bone_meal_particle(pos) - return mcl_farming:grow_plant("plant_sweet_berry_bush", pos, n, 1, true) + if n.name == "mcl_farming:sweet_berry_bush_3" then + return minetest.add_item(vector.offset(pos,math.random()-0.5,math.random()-0.5,math.random()-0.5),"mcl_farming:sweet_berry") + else + return mcl_farming:grow_plant("plant_sweet_berry_bush", pos, n, 1, true) + end elseif n.name == "mcl_cocoas:cocoa_1" or n.name == "mcl_cocoas:cocoa_2" then mcl_dye.add_bone_meal_particle(pos) -- Cocoa: Advance by 1 stage