From eb313f94820a912ce7581a54403fa24b2be98a8b 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 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 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_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