From da8e1fbbdfb84f7e0f5975c1da02f3a7db588973 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Wed, 1 Jul 2020 19:32:38 +0100 Subject: [PATCH] added cabbage, crop and bibimbap food item --- crops/cabbage.lua | 71 +++++++++++++++++++++++++++++++++ farming.conf_example | 1 + food.lua | 31 ++++++++++++++ init.lua | 2 + mapgen.lua | 1 + textures/farming_bibimbap.png | Bin 0 -> 372 bytes textures/farming_cabbage.png | Bin 0 -> 294 bytes textures/farming_cabbage_1.png | Bin 0 -> 103 bytes textures/farming_cabbage_2.png | Bin 0 -> 221 bytes textures/farming_cabbage_3.png | Bin 0 -> 238 bytes textures/farming_cabbage_4.png | Bin 0 -> 270 bytes textures/farming_cabbage_5.png | Bin 0 -> 257 bytes textures/farming_cabbage_6.png | Bin 0 -> 283 bytes 13 files changed, 106 insertions(+) create mode 100644 crops/cabbage.lua create mode 100644 textures/farming_bibimbap.png create mode 100644 textures/farming_cabbage.png create mode 100644 textures/farming_cabbage_1.png create mode 100644 textures/farming_cabbage_2.png create mode 100644 textures/farming_cabbage_3.png create mode 100644 textures/farming_cabbage_4.png create mode 100644 textures/farming_cabbage_5.png create mode 100644 textures/farming_cabbage_6.png diff --git a/crops/cabbage.lua b/crops/cabbage.lua new file mode 100644 index 0000000..f8b74c4 --- /dev/null +++ b/crops/cabbage.lua @@ -0,0 +1,71 @@ + +local S = farming.intllib + +-- cabbage +minetest.register_craftitem("farming:cabbage", { + description = S("Cabbage"), + inventory_image = "farming_cabbage.png", + groups = {seed = 2, food_cabbage = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:cabbage_1") + end, + on_use = minetest.item_eat(1), +}) + +local crop_def = { + drawtype = "plantlike", + tiles = {"farming_cabbage_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, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:cabbage_1", table.copy(crop_def)) + +-- stage 2 +crop_def.tiles = {"farming_cabbage_2.png"} +minetest.register_node("farming:cabbage_2", table.copy(crop_def)) + +-- stage 3 +crop_def.tiles = {"farming_cabbage_3.png"} +minetest.register_node("farming:cabbage_3", table.copy(crop_def)) + +-- stage 4 +crop_def.tiles = {"farming_cabbage_4.png"} +minetest.register_node("farming:cabbage_4", table.copy(crop_def)) + +-- stage 5 +crop_def.tiles = {"farming_cabbage_5.png"} +minetest.register_node("farming:cabbage_5", table.copy(crop_def)) + +-- stage 6 +crop_def.tiles = {"farming_cabbage_6.png"} +crop_def.groups.growing = 0 +crop_def.drop = { + max_items = 2, items = { + {items = {"farming:cabbage"}, rarity = 1}, + {items = {"farming:cabbage"}, rarity = 4}, + } +} +minetest.register_node("farming:cabbage_6", table.copy(crop_def)) + +-- add to registered_plants +farming.registered_plants["farming:cabbage"] = { + crop = "farming:cababge", + seed = "farming:cabbage", + minlight = 13, + maxlight = 15, + steps = 6 +} diff --git a/farming.conf_example b/farming.conf_example index a1998f6..68a7bcb 100644 --- a/farming.conf_example +++ b/farming.conf_example @@ -30,6 +30,7 @@ farming.pineapple = 0.001 farming.peas = 0.001 farming.beetroot = 0.001 farming.mint = 0.005 +farming.cabbage = 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 fca34d3..615cf68 100644 --- a/food.lua +++ b/food.lua @@ -318,3 +318,34 @@ minetest.register_craft({ }, replacements = {{"group:food_saucepan", "farming:saucepan"}} }) + +-- Korean Bibimbap + +minetest.register_craftitem("farming:bibimbap", { + description = S("Bibimbap"), + inventory_image = "farming_bibimbap.png", + on_use = minetest.item_eat(8, "farming:bowl"), +}) + +if minetest.get_modpath("mobs_animal1") or minetest.get_modpath("xanadu1")then +minetest.register_craft({ + output = "farming:bibimbap", + type = "shapeless", + recipe = { + "group:food_skillet", "group:food_bowl", "group:food_egg", + "group:food_chicken_raw", "group:food_cabbage", "group:food_carrot" + }, + replacements = {{"group:food_skillet", "farming:skillet"}} +}) +else +minetest.register_craft({ + output = "farming:bibimbap", + type = "shapeless", + recipe = { + "group:food_skillet", "group:food_bowl", "group:food_mushroom", + "group:food_rice", "group:food_cabbage", "group:food_carrot", + "group:food_mushroom" + }, + replacements = {{"group:food_skillet", "farming:skillet"}} +}) +end diff --git a/init.lua b/init.lua index 1ab7abd..050eaeb 100644 --- a/init.lua +++ b/init.lua @@ -625,6 +625,7 @@ farming.pineapple = 0.001 farming.peas = 0.001 farming.beetroot = 0.001 farming.mint = 0.005 +farming.cabbage = 0.001 farming.grains = true farming.rarety = 0.002 @@ -690,6 +691,7 @@ ddoo("beetroot.lua", farming.beetroot) ddoo("chili.lua", farming.chili) ddoo("ryeoatrice.lua", farming.grains) ddoo("mint.lua", farming.mint) +ddoo("cabbage.lua", farming.cabbage) dofile(farming.path.."/food.lua") dofile(farming.path.."/mapgen.lua") diff --git a/mapgen.lua b/mapgen.lua index 2df5fe5..b76002d 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -49,6 +49,7 @@ register_plant("pea_5", 25, 50, nil, "", -1, farming.peas) 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) if minetest.get_mapgen_setting("mg_name") == "v6" then diff --git a/textures/farming_bibimbap.png b/textures/farming_bibimbap.png new file mode 100644 index 0000000000000000000000000000000000000000..e1a7dfe370c308b41d185e065a21b13c39d43bfb GIT binary patch literal 372 zcmV-)0gL{LP)QPWNTx*TSGv>;nzPpXNa>%#4H0ymYD#``$+v6>+wGQEes!?hTDFJsag?zhqJ(SW2~pU!)(mPzE?zzXxLR~KU|Y(h zVE?d9Gy{M^tq6bs?6V`vibAvAPydBUM+M-ZH%gEHbqv7y@eTmji}wwIIK8pFNkVctMQ;F* S?0t9u00000oneEP)W<84~0S!6I404anpi$&lCu1C9hU(Fu|sVWK36{~kpwEwB|r zvLL8w)Bf-4d;QbE7=u1zfS%*GfTGGwS|lGc2JJT}s?3}Y63f-1Q(P*E^*j%}4$>kq zm+R4t7{^#}0Kkp3*OeE*8FPY2geaASCVBxyB7`Qwb1VnYL{4CfIb$6M?Y+ULLz{cV zI7%g*lUhBZ4eg><8a#f)&_swt2msh_c1@9JrhR@6yj`%_YNauao4lMc7tP-M761UV sWMTlgPCVOfi@kt0$S3*=@IRmF4iheTCEdPXuK)l507*qoM6N<$g0I7O!2kdN literal 0 HcmV?d00001 diff --git a/textures/farming_cabbage_1.png b/textures/farming_cabbage_1.png new file mode 100644 index 0000000000000000000000000000000000000000..850b0da4c390c905fb9d1a6a589ea2345a8c3020 GIT binary patch literal 103 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`dY&$hAr_~T6C_v{Cx{5JMx~|v zIj(-b#s8Axp=b84+tjE05HMj_&n;*3)8T>;!}QyndhBn%EClLg@O1TaS?83{1OP8- B9;^TW literal 0 HcmV?d00001 diff --git a/textures/farming_cabbage_2.png b/textures/farming_cabbage_2.png new file mode 100644 index 0000000000000000000000000000000000000000..5ae079fbb24ae6e53644851d719d43d1feac4bc5 GIT binary patch literal 221 zcmV<303!d1P)eK^UMxp_l+uQC!D3f%petgR6p&CIk{J&s^?_ zm-k(A!QI)S0~@sm>;VABf8+MJqMA4mp7+=2XJzVUF;qpf+(1+i6|dVIfV$0HRMsPO z)(z9MGWDsqhyY*~gQ#E@hffQl!W3z?foj6}a^my;(#4)G_L#-t4(kzAlX0(#W)|TG X;{82bTGXru00000NkvXXu0mjfvp-zq literal 0 HcmV?d00001 diff --git a/textures/farming_cabbage_3.png b/textures/farming_cabbage_3.png new file mode 100644 index 0000000000000000000000000000000000000000..3050229ca0ae7b15d18571bc53ce3169186e630a GIT binary patch literal 238 zcmVr6oH_QF~0bs19XFjp%sMW zlhktM6*uRIYgCmfnK3c{f&T!&{IfWmb}AA9n9K1x_Gyu*a~)OQm>_`_ixsPNn*mU_ znOd0Sb#)QON-+D@LrS>>UQflBNU@ zIKs$D=I#4GS!ZT^GXuVyKj0?-!~SBuTL2)EQu+#jOcDT&+w*4wkrcpG8=K~%xVE6J z?N6Kc2D8pF07*qoM6N<$f@BJ6+5i9m literal 0 HcmV?d00001 diff --git a/textures/farming_cabbage_5.png b/textures/farming_cabbage_5.png new file mode 100644 index 0000000000000000000000000000000000000000..45dd7777133bbb880f5c6a35671e8b92df590e81 GIT binary patch literal 257 zcmV+c0sj7pP)i-gGsy(bIp%1=O#J~r0a%WW-D%?hL=06~0}x3F!1Z_!z9tYc0I0U4S?qnQ z9p~HLO(w{T#0}Hd*{V0Q9ya)s2_gxx+96_ilusJ9sJ0%a+L9NE`v|bwk!CSfS^FD^ z7#g)6JXSFN#$iv@_6;0Kh=}2^y#$j-tjgLqTkU-FP#fz7UglAwbUFTq00000NkvXX Hu0mjf3z=rU literal 0 HcmV?d00001 diff --git a/textures/farming_cabbage_6.png b/textures/farming_cabbage_6.png new file mode 100644 index 0000000000000000000000000000000000000000..253f8a7190f94603ed4f7c98ac50eed00c40da97 GIT binary patch literal 283 zcmV+$0p$LPP)$;DCWaS&3o6Ni{7GY@|w+pU?*w1fXeaZQ5G@4Va3Lm%TP^t+_Rb4D5bCS3zmq zoLfWF)@rhX+!_GBw_jAQL}XYPZ047#z?Bt#?C8YN5ZU002ovPDHLkV1hSqb$0*& literal 0 HcmV?d00001