From 444e923acdb058cf341e3aef00f2b0b979917fea Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Fri, 28 Oct 2022 12:23:18 +0100 Subject: [PATCH] add ginger (thanks Atlante for textures) --- crops/ginger.lua | 86 ++++++++++++++++++++++++++++++++++ farming.conf_example | 1 + init.lua | 4 +- license.txt | 1 + textures/farming_ginger.png | Bin 0 -> 193 bytes textures/farming_ginger_1.png | Bin 0 -> 120 bytes textures/farming_ginger_2.png | Bin 0 -> 156 bytes textures/farming_ginger_3.png | Bin 0 -> 177 bytes textures/farming_ginger_4.png | Bin 0 -> 217 bytes 9 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 crops/ginger.lua create mode 100644 textures/farming_ginger.png create mode 100644 textures/farming_ginger_1.png create mode 100644 textures/farming_ginger_2.png create mode 100644 textures/farming_ginger_3.png create mode 100644 textures/farming_ginger_4.png diff --git a/crops/ginger.lua b/crops/ginger.lua new file mode 100644 index 0000000..4a68a96 --- /dev/null +++ b/crops/ginger.lua @@ -0,0 +1,86 @@ + +local S = farming.intllib + +-- ginger +minetest.register_craftitem("farming:ginger", { + description = S("Ginger"), + inventory_image = "farming_ginger.png", + groups = {seed = 2, food_ginger = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:ginger_1") + end, + on_use = minetest.item_eat(1) +}) + +-- ginger definition +local def = { + drawtype = "plantlike", + tiles = {"farming_ginger_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:ginger_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_ginger_2.png"} +minetest.register_node("farming:ginger_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_ginger_3.png"} +def.drop = { + items = { + {items = {"farming:ginger"}, rarity = 1}, + {items = {"farming:ginger"}, rarity = 3} + } +} +minetest.register_node("farming:ginger_3", table.copy(def)) + +-- stage 4 (final) +def.tiles = {"farming_ginger_4.png"} +def.drop = { + items = { + {items = {"farming:ginger 2"}, rarity = 1}, + {items = {"farming:ginger 2"}, rarity = 2} + } +} +minetest.register_node("farming:ginger_4", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:ginger"] = { + crop = "farming:ginger", + seed = "farming:ginger", + minlight = 5, + maxlight = default.LIGHT_MAX, + steps = 4 +} + +-- mapgen +minetest.register_decoration({ + name = "farming:ginger_4", + deco_type = "simple", + place_on = {"default:dirt_with_rainforest_litter"}, + sidelen = 16, + noise_params = { + offset = 0, + scale = farming.ginger, + spread = {x = 100, y = 100, z = 100}, + seed = 999, + octaves = 3, + persist = 0.6 + }, + y_max = 80, + y_min = 1, + decoration = "farming:ginger_3", + param2 = 3 +}) diff --git a/farming.conf_example b/farming.conf_example index 42677af..9840d7a 100644 --- a/farming.conf_example +++ b/farming.conf_example @@ -41,6 +41,7 @@ farming.vanilla = 0.001 farming.artichoke = 0.001 farming.parsley = 0.002 farming.sunflower = 0.001 +farming.ginger = 0.002 farming.strawberry = not minetest.get_modpath("ethereal") and 0.002 farming.grains = true -- true or false only farming.rice = true diff --git a/init.lua b/init.lua index d5e6f20..3e16f84 100644 --- a/init.lua +++ b/init.lua @@ -7,7 +7,7 @@ farming = { mod = "redo", - version = "20220915", + version = "20221028", path = minetest.get_modpath("farming"), select = { type = "fixed", @@ -670,6 +670,7 @@ farming.lettuce = 0.001 farming.artichoke = 0.001 farming.parsley = 0.002 farming.sunflower = 0.001 +farming.ginger = 0.002 farming.strawberry = not minetest.get_modpath("ethereal") and 0.002 farming.grains = true farming.rice = true @@ -749,6 +750,7 @@ ddoo("strawberry.lua", farming.strawberry) ddoo("asparagus.lua", farming.asparagus) ddoo("eggplant.lua", farming.eggplant) ddoo("spinach.lua", farming.eggplant) +ddoo("ginger.lua", farming.ginger) dofile(farming.path .. "/food.lua") dofile(farming.path .. "/compatibility.lua") -- Farming Plus compatibility diff --git a/license.txt b/license.txt index 5e4fa30..fc7ae48 100644 --- a/license.txt +++ b/license.txt @@ -204,3 +204,4 @@ Everyone is permitted to copy and distribute verbatim copies farming_onigiri.png farming_rice.png farming_chili_powder.png + farming_ginger* diff --git a/textures/farming_ginger.png b/textures/farming_ginger.png new file mode 100644 index 0000000000000000000000000000000000000000..22a48b5c85ea564ece59d268f3b315c9927ff520 GIT binary patch literal 193 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPE^4e$wZ%`eJLvSR26;8>K#y`e(o zaKFpB75SD4b9Mj~FqQ=Q1v5B2yO9RuM0vV6hHzX@PH~-R;OXk;vd$@?2>|wpIJf`+ literal 0 HcmV?d00001 diff --git a/textures/farming_ginger_1.png b/textures/farming_ginger_1.png new file mode 100644 index 0000000000000000000000000000000000000000..84d0d457ec190499fa1561aa85e2a9f450a16e17 GIT binary patch literal 120 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!93?!50ihlx9JOMr-u0UEo!AiN*L9xU5Nb!G8 zAfK@$$S;_|;n|HeAV{h|9aI1S literal 0 HcmV?d00001 diff --git a/textures/farming_ginger_2.png b/textures/farming_ginger_2.png new file mode 100644 index 0000000000000000000000000000000000000000..c472d20c99713ea3519c92d5c70ea6bf9d40bbc6 GIT binary patch literal 156 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPHV5AX?b1=7+X+VTlj%B2p99mac( z7$gFP7)yfuf*Bm1-ADs+tUX;ELpZJ{CoGUNNK0V5%yx#$jZ2}edEzFp+$B6#NTDD0XetH7fsob1ZR#<1`r%l!qGpN|8LVeoYIb6Mw<&;$Tgjw)vW literal 0 HcmV?d00001 diff --git a/textures/farming_ginger_3.png b/textures/farming_ginger_3.png new file mode 100644 index 0000000000000000000000000000000000000000..96f75d75f371bc21e93787156e7e79efb2f8b77e GIT binary patch literal 177 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPE^4e$wZ%`eK84$+oRu$mOCs9frx z*kQad+o-XGvk|C(u_VYZn8D%MjWi&~%hSa%gyVX0f`ZTn0}BTUAH4*jj=2YF#MRmr zSSK_wuuWyy;K9+X<mdKI;Vst0Djdl?*IS* literal 0 HcmV?d00001 diff --git a/textures/farming_ginger_4.png b/textures/farming_ginger_4.png new file mode 100644 index 0000000000000000000000000000000000000000..32f6de5b7eabb801056bc7c147bb9287bf019a60 GIT binary patch literal 217 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa3-AeX1=4kr922Cpr9-sk6Rai$ zD=L>dD0Ubx%r@H9<2hx*mNcLW#*!evUxU;yQDM(;oaN-i;dC|qH4YZWO)78&q Iol`;+0BsyX00000 literal 0 HcmV?d00001