From 719e3b1d74e6b7bc7933b4645ff7d2cb426c9f0c Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Wed, 21 Mar 2018 10:51:12 +0000 Subject: [PATCH] Added Peas, Bowl, Pea Soup --- README.txt | 1 + chili.lua | 4 +- farming.conf_example | 1 + init.lua | 5 +- mapgen.lua | 1 + pea.lua | 89 ++++++++++++++++++++++++++++++++++ textures/farming_bowl.png | Bin 0 -> 145 bytes textures/farming_pea_1.png | Bin 0 -> 203 bytes textures/farming_pea_2.png | Bin 0 -> 215 bytes textures/farming_pea_3.png | Bin 0 -> 431 bytes textures/farming_pea_4.png | Bin 0 -> 528 bytes textures/farming_pea_5.png | Bin 0 -> 705 bytes textures/farming_pea_peas.png | Bin 0 -> 659 bytes textures/farming_pea_pod.png | Bin 0 -> 597 bytes textures/farming_pea_soup.png | Bin 0 -> 161 bytes utensils.lua | 17 +++++++ 16 files changed, 115 insertions(+), 3 deletions(-) create mode 100644 pea.lua create mode 100644 textures/farming_bowl.png create mode 100644 textures/farming_pea_1.png create mode 100644 textures/farming_pea_2.png create mode 100644 textures/farming_pea_3.png create mode 100644 textures/farming_pea_4.png create mode 100644 textures/farming_pea_5.png create mode 100644 textures/farming_pea_peas.png create mode 100644 textures/farming_pea_pod.png create mode 100644 textures/farming_pea_soup.png create mode 100644 utensils.lua diff --git a/README.txt b/README.txt index 96ae88e..73e1ba2 100644 --- a/README.txt +++ b/README.txt @@ -13,6 +13,7 @@ This mod works by adding your new plant to the {growing=1} group and numbering t Changelog: +1.32 - Added Pea plant (textures by Andrey01) - also added Wooden Bowl and Pea Soup crafts 1.31 - Added Pineapple which can be found growing in savannah areas (place pineapple in crafting to obtain 5x rings to eat and a top for re-planting), also Salt which is made from cooking a bucket of water, added food groups so it's more compatible with Ruben's food mods. 1.30 - Added Garlic, Pepper and Onions thanks to Grizzly Adam for sharing textures 1.29 - Updating functions so requires Minetest 0.4.16 and above to run diff --git a/chili.lua b/chili.lua index edf7a59..a961993 100644 --- a/chili.lua +++ b/chili.lua @@ -16,7 +16,7 @@ minetest.register_craftitem("farming:chili_pepper", { minetest.register_craftitem("farming:chili_bowl", { description = S("Bowl of Chili"), inventory_image = "farming_chili_bowl.png", - on_use = minetest.item_eat(8), + on_use = minetest.item_eat(8, "farming:bowl"), }) minetest.register_craft({ @@ -24,7 +24,7 @@ minetest.register_craft({ output = "farming:chili_bowl", recipe = { "group:food_chili_pepper", "group:food_barley", - "group:food_tomato", "group:food_beans" + "group:food_tomato", "group:food_beans", "group:food_bowl" } }) diff --git a/farming.conf_example b/farming.conf_example index 59045ad..4a83ba6 100644 --- a/farming.conf_example +++ b/farming.conf_example @@ -28,6 +28,7 @@ farming.onion = true farming.garlic = true farming.pepper = true farming.pineapple = true +farming.peas = true farming.donuts = true -- rarety of crops on map, default is 0.001 (higher number = more crops) diff --git a/init.lua b/init.lua index 17c94ae..ea213b1 100644 --- a/init.lua +++ b/init.lua @@ -7,7 +7,7 @@ farming = {} farming.mod = "redo" -farming.version = "1.31" +farming.version = "1.32" farming.path = minetest.get_modpath("farming") farming.select = { type = "fixed", @@ -598,6 +598,7 @@ farming.garlic = true farming.onion = true farming.pepper = true farming.pineapple = true +farming.peas = true farming.donuts = true farming.rarety = 0.001 -- 0.006 @@ -624,6 +625,7 @@ end dofile(farming.path.."/soil.lua") dofile(farming.path.."/hoes.lua") dofile(farming.path.."/grass.lua") +dofile(farming.path.."/utensils.lua") -- default crops dofile(farming.path.."/wheat.lua") @@ -653,6 +655,7 @@ if farming.garlic then dofile(farming.path.."/garlic.lua") end if farming.onion then dofile(farming.path.."/onion.lua") end if farming.pepper then dofile(farming.path.."/pepper.lua") end if farming.pineapple then dofile(farming.path.."/pineapple.lua") end +if farming.peas then dofile(farming.path.."/pea.lua") end dofile(farming.path.."/mapgen.lua") dofile(farming.path.."/compatibility.lua") -- Farming Plus compatibility diff --git a/mapgen.lua b/mapgen.lua index cf40a98..bf34816 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -39,6 +39,7 @@ register_plant("beanbush", 18, 35, "", -1, farming.beans) register_plant("grapebush", 25, 45, "", -1, farming.grapes) register_plant("onion_5", 5, 22, "", -1, farming.onion) register_plant("garlic_5", 3, 30, "group:tree", 1, farming.garlic) +register_plant("pea_5", 25, 50, "", -1, farming.peas) if minetest.get_mapgen_setting("mg_name") == "v6" then diff --git a/pea.lua b/pea.lua new file mode 100644 index 0000000..ecf296c --- /dev/null +++ b/pea.lua @@ -0,0 +1,89 @@ + +local S = farming.intllib + +-- Textures for Pea crop and Peas were done by Andrey01 + +-- pea pod +minetest.register_craftitem("farming:pea_pod", { + description = S("Pea Pod"), + inventory_image = "farming_pea_pod.png", + groups = {food_pea_pod = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:pea_1") + end +}) + +minetest.register_craftitem("farming:peas", { + description = S("Peas"), + inventory_image = "farming_pea_peas.png", + groups = {food_peas = 1, flammable = 2}, + on_use = minetest.item_eat(1) +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:peas", + recipe = {"farming:pea_pod"} +}) + +-- pea soup +minetest.register_craftitem("farming:pea_soup", { + description = S("Pea Soup"), + inventory_image = "farming_pea_soup.png", + groups = {food_peas = 1, flammable = 2}, + on_use = minetest.item_eat(4, "farming:bowl"), +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:pea_soup", + recipe = {"group:food_peas", "group:food_peas", "group:food_bowl"} +}) + +local crop_def = { + drawtype = "plantlike", + tiles = {"farming_pea_1.png"}, + paramtype = "light", + paramtype2 = "meshoptions", + place_param2 = 3, + sunlight_propagates = true, + waving = 1, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, flora = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:pea_1", table.copy(crop_def)) + +-- stage 2 +crop_def.tiles = {"farming_pea_2.png"} +minetest.register_node("farming:pea_2", table.copy(crop_def)) + +-- stage 3 +crop_def.tiles = {"farming_pea_3.png"} +minetest.register_node("farming:pea_3", table.copy(crop_def)) + +-- stage 4 +crop_def.tiles = {"farming_pea_4.png"} +minetest.register_node("farming:pea_4", table.copy(crop_def)) + +-- stage 5 +crop_def.tiles = {"farming_pea_5.png"} +crop_def.groups.growing = 0 +crop_def.drop = { + max_items = 5, items = { + {items = {'farming:pea_pod'}, rarity = 1}, + {items = {'farming:pea_pod'}, rarity = 2}, + {items = {'farming:pea_pod'}, rarity = 3}, + {items = {'farming:pea_pod'}, rarity = 4}, + {items = {'farming:pea_pod'}, rarity = 5}, + } +} +minetest.register_node("farming:pea_5", table.copy(crop_def)) diff --git a/textures/farming_bowl.png b/textures/farming_bowl.png new file mode 100644 index 0000000000000000000000000000000000000000..627c22ea7e4990070160d424e5fe46b160b59991 GIT binary patch literal 145 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!93?!50ihlx9JOMr-uBp1|KxR#p-1J;kwWUiw z138Q(L4Lsu4$p3+0XfE=E{-7_*OLR n|JN2JBy_}cg&dM%2;^cA>E}8qRH~5+)Xw1P>gTe~DWM4f_0A|S literal 0 HcmV?d00001 diff --git a/textures/farming_pea_1.png b/textures/farming_pea_1.png new file mode 100644 index 0000000000000000000000000000000000000000..eb48e36398e3ea6b8e30f6835c6b5f7c0c127703 GIT binary patch literal 203 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`lRRA1{1VG<8X6e%!f@h*yOYr|3#68;@M zpi$LdA#PAqm-gfQr{;(Ml^4hJ{Fl5TQ4#MP!1MD{NC-on^3Xa0194S#<8`#|fBwVf2X#I%y?$14<-^M_N%z zQncit*2c)pkJ)Tr2SdpsC-2+m^Lc-Mzu{jZYB3wNnEwq|tKlC2=Asr|?+zIc1->H+ z84m$m0RieS(iD6LqUCrJxCM?(gMJwgE#pg#lWQ4^MG|{oC&&YS?2lzU=_XuR!!&pR zEFdVC26|{bokD-sYOU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7ut%K9i90LNkzU`iVz)sS zn2(r^b&pT9Utt+qzXo8cx%MQ=4VDsz3-&_+01_-?%t2Mt0FnS|03=i(SI2c8Jrp4D z2xv64nwDZL04o3yKul3&W-GKbRSZBC7Mptz=g08-N(=x1002ovPDHLkV1g?%A=&@{ literal 0 HcmV?d00001 diff --git a/textures/farming_pea_pod.png b/textures/farming_pea_pod.png new file mode 100644 index 0000000000000000000000000000000000000000..1c19c9f6e0e51605545f7f81e013cf5c7e9e0cf8 GIT binary patch literal 597 zcmV-b0;>IqP)dH%4x604~qO#$PYiRh&OK6n(jP#no~?5p)0xtvx~B>K8Xobi#O3Z!*@ zr{qn5mbnC?aI|NxYB`yR3`CwLnRK59VZ)MYF|Q4Hv;N9&=~TG>EeIcw2BytG_$Yg| jn_VZ3;QK@Nz2y7^9Q?`98-s(A00000NkvXXu0mjf9?u(N literal 0 HcmV?d00001 diff --git a/textures/farming_pea_soup.png b/textures/farming_pea_soup.png new file mode 100644 index 0000000000000000000000000000000000000000..03753cf6019f891a9ed85f45e3dfec76d508818b GIT binary patch literal 161 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPE^3h)VWP0r5&GHasbrst~WS7|o( z>gQScP6P@umIV0)GdMiEkp|@0db&7kKT