From 45b5a073e0e24dba064e99e85635be11795a9934 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Thu, 10 Dec 2020 15:37:44 +0000 Subject: [PATCH] Add lettuce and blackberries with recipes (thanks OgelGames) --- README.md | 3 +- crops/blackberry.lua | 62 ++++++++++++++++++++++++++ crops/lettuce.lua | 63 +++++++++++++++++++++++++++ farming.conf_example | 2 + food.lua | 65 ++++++++++++++++++++++++++++ init.lua | 6 ++- mapgen.lua | 2 + textures/farming_berry_smoothie.png | Bin 0 -> 215 bytes textures/farming_blackberry.png | Bin 0 -> 223 bytes textures/farming_blackberry_1.png | Bin 0 -> 121 bytes textures/farming_blackberry_2.png | Bin 0 -> 337 bytes textures/farming_blackberry_3.png | Bin 0 -> 324 bytes textures/farming_blackberry_4.png | Bin 0 -> 344 bytes textures/farming_burger.png | Bin 0 -> 480 bytes textures/farming_lettuce.png | Bin 0 -> 539 bytes textures/farming_lettuce_1.png | Bin 0 -> 110 bytes textures/farming_lettuce_2.png | Bin 0 -> 152 bytes textures/farming_lettuce_3.png | Bin 0 -> 186 bytes textures/farming_lettuce_4.png | Bin 0 -> 220 bytes textures/farming_lettuce_5.png | Bin 0 -> 248 bytes textures/farming_salad.png | Bin 0 -> 204 bytes 21 files changed, 201 insertions(+), 2 deletions(-) create mode 100644 crops/blackberry.lua create mode 100644 crops/lettuce.lua create mode 100644 textures/farming_berry_smoothie.png create mode 100644 textures/farming_blackberry.png create mode 100644 textures/farming_blackberry_1.png create mode 100644 textures/farming_blackberry_2.png create mode 100644 textures/farming_blackberry_3.png create mode 100644 textures/farming_blackberry_4.png create mode 100644 textures/farming_burger.png create mode 100644 textures/farming_lettuce.png create mode 100644 textures/farming_lettuce_1.png create mode 100644 textures/farming_lettuce_2.png create mode 100644 textures/farming_lettuce_3.png create mode 100644 textures/farming_lettuce_4.png create mode 100644 textures/farming_lettuce_5.png create mode 100644 textures/farming_salad.png diff --git a/README.md b/README.md index 7afd0e7..622e2fc 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,8 @@ This mod works by adding your new plant to the {growing=1} group and numbering t ### Changelog: -- 1.45 - Dirt and Hoes are more in line with default by using dry/wet/base, added cactus juice, added pasta, spaghetti, cabbage, korean bibimbap, code tidy, minmax light setting +- 1.46 - Added min/max default light settings, added lettuce and blackberries with food items (thanks OgelGames) +- 1.45 - Dirt and Hoes are more in line with default by using dry/wet/base, added cactus juice, added pasta, spaghetti, cabbage, korean bibimbap, code tidy options, onion soup added (thanks edcrypt), Added apple pie, added wild cotton to savanna - 1.44 - Added 'farming_stage_length' in mod settings for speed of crop growth, also thanks to TheDarkTiger for translation updates - 1.43 - Scythe works on use instead of right-click, added seed=1 groups to actual seeds and seed=2 group for plantable food items. diff --git a/crops/blackberry.lua b/crops/blackberry.lua new file mode 100644 index 0000000..f3de7ed --- /dev/null +++ b/crops/blackberry.lua @@ -0,0 +1,62 @@ + +local S = farming.intllib + +-- blackberries +minetest.register_craftitem("farming:blackberry", { + description = S("Blackberries"), + inventory_image = "farming_blackberry.png", + groups = {seed = 2, food_blackberries = 1, food_blackberry = 1, + food_berry = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:blackberry_1") + end, + on_use = minetest.item_eat(1), +}) + +local def = { + drawtype = "plantlike", + tiles = {"farming_blackberry_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:blackberry_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_blackberry_2.png"} +minetest.register_node("farming:blackberry_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_blackberry_3.png"} +minetest.register_node("farming:blackberry_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_blackberry_4.png"} +def.groups.growing = 0 +def.drop = { + items = { + {items = {'farming:blackberry 2'}, rarity = 1}, + {items = {'farming:blackberry'}, rarity = 2}, + {items = {'farming:blackberry'}, rarity = 3}, + } +} +minetest.register_node("farming:blackberry_4", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:blackberry"] = { + crop = "farming:blackberry", + seed = "farming:blackberry", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 4 +} diff --git a/crops/lettuce.lua b/crops/lettuce.lua new file mode 100644 index 0000000..080ad9c --- /dev/null +++ b/crops/lettuce.lua @@ -0,0 +1,63 @@ +local S = farming.intllib + +-- lettuce +minetest.register_craftitem("farming:lettuce", { + description = S("Lettuce"), + inventory_image = "farming_lettuce.png", + groups = {seed = 2, food_lettuce = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:lettuce_1") + end, + on_use = minetest.item_eat(2), +}) + +local def = { + drawtype = "plantlike", + tiles = {"farming_lettuce_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:lettuce_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_lettuce_2.png"} +minetest.register_node("farming:lettuce_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_lettuce_3.png"} +minetest.register_node("farming:lettuce_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_lettuce_4.png"} +minetest.register_node("farming:lettuce_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_lettuce_5.png"} +def.groups.growing = 0 +def.drop = { + items = { + {items = {'farming:lettuce 2'}, rarity = 1}, + {items = {'farming:lettuce 2'}, rarity = 2}, + } +} +minetest.register_node("farming:lettuce_5", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:lettuce"] = { + crop = "farming:lettuce", + seed = "farming:lettuce", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 5 +} diff --git a/farming.conf_example b/farming.conf_example index e5837b2..88331af 100644 --- a/farming.conf_example +++ b/farming.conf_example @@ -31,6 +31,8 @@ farming.peas = 0.001 farming.beetroot = 0.001 farming.mint = 0.005 farming.cabbage = 0.001 +farming.blackberry = 0.002 +farming.lettuce = 0.001 farming.grains = true -- true or false only -- default rarety of crops on map (higher number = more crops) diff --git a/food.lua b/food.lua index edf8045..b395448 100644 --- a/food.lua +++ b/food.lua @@ -373,3 +373,68 @@ minetest.register_craft({ replacements = {{"group:food_skillet", "farming:skillet"}} }) end + +-- Burger + +minetest.register_craftitem("farming:burger", { + description = S("Burger"), + inventory_image = "farming_burger.png", + on_use = minetest.item_eat(16), +}) + +if minetest.get_modpath("mobs_animal") or minetest.get_modpath("xanadu")then +minetest.register_craft({ + type = "shapeless", + output = "farming:burger", + recipe = { + "farming:bread", "group:food_meat", "group:food_cheese", + "group:food_tomato", "group:food_cucumber", "group:food_onion", + "group:food_lettuce" + } +}) +else +minetest.register_craft({ + type = "shapeless", + output = "farming:burger", + recipe = { + "farming:bread", "group:food_mushroom", "group:food_tomato", + "group:food_cucumber", "group:food_onion", "group:food_lettuce" + } +}) +end + +-- Salad + +minetest.register_craftitem("farming:salad", { + description = S("Salad"), + inventory_image = "farming_salad.png", + on_use = minetest.item_eat(8, "farming:bowl") +}) + +minetest.register_craft({ + output = "farming:salad", + type = "shapeless", + recipe = { + "group:food_bowl", "group:food_tomato", "group:food_cucumber", + "group:food_lettuce", "group:food_oil" + }, +}) + +-- Triple Berry Smoothie + +minetest.register_craftitem("farming:smoothie_berry", { + description = S("Triple Berry Smoothie"), + inventory_image = "farming_berry_smoothie.png", + on_use = minetest.item_eat(6, "vessels:drinking_glass"), + groups = {vessel = 1, drink = 1} +}) + +minetest.register_craft({ + output = "farming:smoothie_berry", + type = "shapeless", + recipe = { + "group:food_raspberries", "group:food_blackberries", + "group:food_strawberry", "group:food_banana", + "vessels:drinking_glass" + } +}) diff --git a/init.lua b/init.lua index 04ee74f..98002ad 100644 --- a/init.lua +++ b/init.lua @@ -7,7 +7,7 @@ farming = { mod = "redo", - version = "20201209", + version = "20201210", path = minetest.get_modpath("farming"), select = { type = "fixed", @@ -629,6 +629,8 @@ farming.peas = 0.001 farming.beetroot = 0.001 farming.mint = 0.005 farming.cabbage = 0.001 +farming.blackberry = 0.002 +farming.lettuce = 0.001 farming.grains = true farming.rarety = 0.002 @@ -695,6 +697,8 @@ ddoo("chili.lua", farming.chili) ddoo("ryeoatrice.lua", farming.grains) ddoo("mint.lua", farming.mint) ddoo("cabbage.lua", farming.cabbage) +ddoo("blackberry.lua", farming.blackberry) +ddoo("lettuce.lua", farming.lettuce) dofile(farming.path .. "/food.lua") dofile(farming.path .. "/mapgen.lua") diff --git a/mapgen.lua b/mapgen.lua index ca7048d..e7c8118 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -50,6 +50,8 @@ register_plant("beetroot_5", 1, 15, nil, "", -1, farming.beetroot) register_plant("mint_4", 1, 75, {"default:dirt_with_grass", "default:dirt_with_coniferous_litter"}, "group:water", 1, farming.mint) register_plant("cabbage_6", 2, 10, nil, "", -1, farming.cabbage) +register_plant("lettuce_5", 5, 30, nil, "", -1, farming.lettuce) +register_plant("blackberry_4", 3, 10, nil, "", -1, farming.blackberry) if minetest.get_mapgen_setting("mg_name") == "v6" then diff --git a/textures/farming_berry_smoothie.png b/textures/farming_berry_smoothie.png new file mode 100644 index 0000000000000000000000000000000000000000..8da2fc558cfcd91c870daaeafc366bf99c9cdd6b GIT binary patch literal 215 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~xd5LK*ZiW~ zDM1Ab!YeLbzHsZ#%_q+u|M>O2)jnrSL z;us<^b#A{U-vI*-7Q^FG|NcK@nVevrX~cVrQAOcb`^iIAi?!Z})NwK0vCZfX_?rFIbfO?)i=tUSIW3En>WIpW~MT&~OG%S3j3^P6?X zjMfTMw9X^k<0i^2slmy|22{jd666=m@E;Cp%WAIzg_As89780gPVM&=I-tPe z-0R@@uKvL>|I%BrHxHb4Fq-md{jGUdmK59MBz2uWe7?!cRmSmzNX=ahp_B>7yJiMD z#yz|^&CylucAC^OgUl*Ew$#-#1gEwsvwLgQN*Jy;|L`!@oN*uHYaOp=l|b7VJYD@< J);T3K0RVzaO*;Sp literal 0 HcmV?d00001 diff --git a/textures/farming_blackberry_1.png b/textures/farming_blackberry_1.png new file mode 100644 index 0000000000000000000000000000000000000000..8dd8832c413ec885bcfa5095adf039a453f7e7f6 GIT binary patch literal 121 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJTYyi9>$ZR|6JHC@W!tw1D8f_{ z^tAUWSJ}-P}~R_6YDWFzYf1c1>t% Q1FB{4boFyt=akR{09E%McK`qY literal 0 HcmV?d00001 diff --git a/textures/farming_blackberry_2.png b/textures/farming_blackberry_2.png new file mode 100644 index 0000000000000000000000000000000000000000..7d3827c8d97185ec0db8cf221af027004b8bc3f0 GIT binary patch literal 337 zcmV-X0j~auP)$Mi>*=!79y!6Y_VXG%EC@kT5jj>Sj0vJBUa89k1+|z zw%hDflezQmoSDFX{C$|;#B>wN{eH(<%jcwe+v~k6COMMi$nkh%J9`>{>Dm+37rUXv z8S<7O$&t$izQ4L!k|VvI*D)jt?a{iD82tb!m%QB1=O;nX)BxfP z2?7`lLW+-@d95&>BZ}P4^+8oR1K)S6>2bHSr|A$>6&wmok|UZ=*PiI!qZILdh@yt9 zgZFqe#~Y|U#Ej=|`k}x? jkwer_{Pu4>of`cIIlYqYot4ea00000NkvXXu0mjfW)7Z) literal 0 HcmV?d00001 diff --git a/textures/farming_blackberry_3.png b/textures/farming_blackberry_3.png new file mode 100644 index 0000000000000000000000000000000000000000..7d89aa0cdc18c5d9029d298594c034c83d144f0c GIT binary patch literal 324 zcmV-K0lWT*P)Nha2V|HB!V+`K+evzw}nr+`OEy2s>hS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textures/farming_lettuce_1.png new file mode 100644 index 0000000000000000000000000000000000000000..39ce983061b61535b9c3a27cb2f4829d543e6118 GIT binary patch literal 110 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`rk*a2Ar`&K2@b$4? z56ff(V?CaCmfPjHRhU<;uh5U&?0~kDA{an^L HB{Ts5TXG_f literal 0 HcmV?d00001 diff --git a/textures/farming_lettuce_2.png b/textures/farming_lettuce_2.png new file mode 100644 index 0000000000000000000000000000000000000000..0e4ab3039b52c3f7bb758be2e1f9c509436e611d GIT binary patch literal 152 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`@t!V@Ar`&K2@>c3sD+ z@r{IrbR>`Dh6Ld`)9WW2rY-vQ|GxeIgGcKgZs-x5y&!$}sd~FKw>JO!|HdB-jg2;J zGB(sXxxX`1SD3F^GVbrc^B*3|Gap{Q|G(tCx}T>X+*s9gl{>;WH6bCPASd+a|L^8U lxX-Nd;rYG#eL^TVL((*j-SbaBasxVs!PC{xWt~$(697iBP8fnmyY0TYIs3UPH|ZS(E_KMFbAZWw`(JtU z#Gf}9gm*DWTMLJo?Rsdz>kxkC*twQaubU;^E1^xA(|0k=^1J6%i6CPnJCVvwr_QgOE!3qZ?$GGa4KPDvQWs6pv7(8A5T-G@yGywoP8Cuf- literal 0 HcmV?d00001 diff --git a/textures/farming_salad.png b/textures/farming_salad.png new file mode 100644 index 0000000000000000000000000000000000000000..febf40f3ed1ae4e6ed6944b938b74f1a16fb0e43 GIT binary patch literal 204 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~i2$DvS0D`p z({oj8qU6r7vdR@Q9Jo8NYPrrUOBW5G1V>4bUogXe2)KGG#0V(n=jq}YA~AJquOnZB z0|)c=fK&hLb+~tZd~%jkF;O9P?S2Lik#wJlT^BTVC@qam%$S(6cJZ%{xdH4KEu&{V qJXY(p<^$XL*@n;apFc3ID`uR$h0#z;dD>i%J3L+eT-G@yGywokYepUb literal 0 HcmV?d00001