From e2226576089cc6605c6f8e8011cf254476f45eee Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Thu, 31 Aug 2017 12:14:54 +0100 Subject: [PATCH] added chili peppers and bowl of chili --- README.txt | 3 +- chili.lua | 88 ++++++++++++++++++++++++++++++ farming.conf_example | 1 + init.lua | 2 + lucky_block.lua | 2 + mapgen.lua | 21 +++++++ textures/farming_chili_1.png | Bin 0 -> 113 bytes textures/farming_chili_2.png | Bin 0 -> 107 bytes textures/farming_chili_3.png | Bin 0 -> 137 bytes textures/farming_chili_4.png | Bin 0 -> 144 bytes textures/farming_chili_5.png | Bin 0 -> 154 bytes textures/farming_chili_6.png | Bin 0 -> 157 bytes textures/farming_chili_7.png | Bin 0 -> 169 bytes textures/farming_chili_8.png | Bin 0 -> 169 bytes textures/farming_chili_bowl.png | Bin 0 -> 183 bytes textures/farming_chili_pepper.png | Bin 0 -> 194 bytes 16 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 chili.lua create mode 100644 textures/farming_chili_1.png create mode 100644 textures/farming_chili_2.png create mode 100644 textures/farming_chili_3.png create mode 100644 textures/farming_chili_4.png create mode 100644 textures/farming_chili_5.png create mode 100644 textures/farming_chili_6.png create mode 100644 textures/farming_chili_7.png create mode 100644 textures/farming_chili_8.png create mode 100644 textures/farming_chili_bowl.png create mode 100644 textures/farming_chili_pepper.png diff --git a/README.txt b/README.txt index 1c26be0..c094d21 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.28 - Added chili peppers and bowl of chili, optimized code and fixed a few bugs 1.27 - Added meshoptions to api and wheat plants, added farming.rarity setting to spawn more/less crops on map, have separate cotton/string items (4x cotton = 1x wool, 2x cotton = 2x string) 1.26 - Added support for [toolranks] mod when using hoe's 1.25 - Added check for farming.conf setting file to disable specific crops globally (inside mod folder) or world specific (inside world folder) @@ -49,7 +50,7 @@ Changelog: 0.1 - Fixed growing bug 0.0 - Initial release -Lucky Blocks: 11 (plus 3 for default farming items) +Lucky Blocks: 16 License of media (textures): diff --git a/chili.lua b/chili.lua new file mode 100644 index 0000000..004684f --- /dev/null +++ b/chili.lua @@ -0,0 +1,88 @@ + +local S = farming.intllib + +-- chili pepper +minetest.register_craftitem("farming:chili_pepper", { + description = S("Chili Pepper"), + inventory_image = "farming_chili_pepper.png", + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:chili_1") + end, + on_use = minetest.item_eat(2), +}) + +-- bowl of chili +minetest.register_craftitem("farming:chili_bowl", { + description = S("Bowl of Chili"), + inventory_image = "farming_chili_bowl.png", + on_use = minetest.item_eat(8), +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:chili_bowl", + recipe = {"farming:chili_pepper", "farming:barley", "farming:tomato", "farming:beans"} +}) + +-- chili can be used for red dye +minetest.register_craft({ + output = "dye:red", + recipe = { + {'farming:chili_pepper'}, + } +}) + +-- chili definition +local crop_def = { + drawtype = "plantlike", + tiles = {"farming_chili_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 4, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:chili_1", table.copy(crop_def)) + +-- stage 2 +crop_def.tiles = {"farming_chili_2.png"} +minetest.register_node("farming:chili_2", table.copy(crop_def)) + +-- stage 3 +crop_def.tiles = {"farming_chili_3.png"} +minetest.register_node("farming:chili_3", table.copy(crop_def)) + +-- stage 4 +crop_def.tiles = {"farming_chili_4.png"} +minetest.register_node("farming:chili_4", table.copy(crop_def)) + +-- stage 5 +crop_def.tiles = {"farming_chili_5.png"} +minetest.register_node("farming:chili_5", table.copy(crop_def)) + +-- stage 6 +crop_def.tiles = {"farming_chili_6.png"} +minetest.register_node("farming:chili_6", table.copy(crop_def)) + +-- stage 7 +crop_def.tiles = {"farming_chili_7.png"} +minetest.register_node("farming:chili_7", table.copy(crop_def)) + +-- stage 8 (final) +crop_def.tiles = {"farming_chili_8.png"} +crop_def.groups.growing = 0 +crop_def.drop = { + items = { + {items = {'farming:chili 3'}, rarity = 1}, + {items = {'farming:chili 2'}, rarity = 2}, + } +} +minetest.register_node("farming:chili_8", table.copy(crop_def)) diff --git a/farming.conf_example b/farming.conf_example index 636322b..be6e398 100644 --- a/farming.conf_example +++ b/farming.conf_example @@ -23,6 +23,7 @@ farming.rhubarb = true farming.beans = true farming.grapes = true farming.barley = true +farming.chili = true farming.hemp = true farming.donuts = true diff --git a/init.lua b/init.lua index 6815c8c..d3245e4 100644 --- a/init.lua +++ b/init.lua @@ -592,6 +592,7 @@ farming.rhubarb = true farming.beans = true farming.grapes = true farming.barley = true +farming.chili = true farming.hemp = true farming.donuts = true farming.rarety = 0.006 @@ -641,6 +642,7 @@ if farming.rhubarb then dofile(farming.path.."/rhubarb.lua") end if farming.beans then dofile(farming.path.."/beanpole.lua") end if farming.grapes then dofile(farming.path.."/grapes.lua") end if farming.barley then dofile(farming.path.."/barley.lua") end +if farming.chili then dofile(farming.path.."/chili.lua") end if farming.hemp then dofile(farming.path.."/hemp.lua") end if farming.donuts then dofile(farming.path.."/donut.lua") end diff --git a/lucky_block.lua b/lucky_block.lua index 94d7d36..01b4c27 100644 --- a/lucky_block.lua +++ b/lucky_block.lua @@ -15,5 +15,7 @@ if minetest.get_modpath("lucky_block") then {"nod", "farming:melon", 0}, {"dro", {"farming:donut", "farming:donut_chocolate", "farming:donut_apple"}, 5}, {"dro", {"farming:hemp_leaf", "farming:hemp_fibre", "farming:seed_hemp"}, 5}, + {"nod", "fire:permanent_flame", 1}, + {"dro", {"farming:chili_pepper", "farming:chili_bowl"}, 5}, }) end diff --git a/mapgen.lua b/mapgen.lua index cb46d9a..929f181 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -73,3 +73,24 @@ minetest.register_decoration({ num_spawn_by = 1, }) end + +if farming.chili then +minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_grass", "default:dirt_with_rainforest_litter"}, + sidelen = 16, + noise_params = { + offset = 0, + scale = farming.rarety, -- 0.06, + spread = {x = 100, y = 100, z = 100}, + seed = 760, + octaves = 3, + persist = 0.6 + }, + y_min = 5, + y_max = 35, + decoration = {"farming:chili_8"}, + spawn_by = "group:tree", + num_spawn_by = 1, +}) +end diff --git a/textures/farming_chili_1.png b/textures/farming_chili_1.png new file mode 100644 index 0000000000000000000000000000000000000000..aa11988de84a9c2b2bf72eda95d0038f03549c75 GIT binary patch literal 113 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt^?o-U3d z7N?UFBv=~#Gf#KgWHr;y?2A6fq~(%p5F0{kV0Xg(F~rhelF{r5}E+OEH^|eZqspM@)vIQVlN6 vjLgBp6Amt9Q{mlVCDM?@&DWqJu|beQOPf@i0aP&0$4tDnm{r-UW|4xc8U literal 0 HcmV?d00001 diff --git a/textures/farming_chili_7.png b/textures/farming_chili_7.png new file mode 100644 index 0000000000000000000000000000000000000000..5912c2e1caf223cb15059d1996123e48293638b6 GIT binary patch literal 169 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPHV5AX?b1=3clHGs(Fgx>%E|C@rR zTmlL)l?3?(Gcc4*K5GHwF(!GtyRh_U+zbS%_H=O!;gDrL$jHlJz`?vB&0zopr0BgcArT_o{ literal 0 HcmV?d00001 diff --git a/textures/farming_chili_8.png b/textures/farming_chili_8.png new file mode 100644 index 0000000000000000000000000000000000000000..976eb521c84d74c3d6f93996a543723f7c92c102 GIT binary patch literal 169 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPHV5AX?b1=3clHGt?b56}Pq|0g_| zqXiUVDhcunW?(3reAWWUV@&dPcVX$zxETmi?djqe!Xe9gkdc?cfP;BMn#GPLR@NWk z-^CahbQHMeL|AkhEn&;dy0B+i`VBLl$o9!r6Zj@D1vzx_fBDROcDdMtqd-#_JYD@< J);T3K0RT{6F=hY& literal 0 HcmV?d00001 diff --git a/textures/farming_chili_bowl.png b/textures/farming_chili_bowl.png new file mode 100644 index 0000000000000000000000000000000000000000..6454ba3e3cb12fd3fdc633cfcf6699673fadce42 GIT binary patch literal 183 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa2=EDU1=2GnO7fIE-nv%qaFXQp zt2-a_@cjS(pCj&=AW)8}B*-tAfuU^jSqmVKG0EHAgD-DaIskcNezAv>mlTj*q8{V+e;V>%on@OpZJ(2O_=a z|86;