summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.txt3
-rw-r--r--chili.lua88
-rw-r--r--farming.conf_example1
-rw-r--r--init.lua2
-rw-r--r--lucky_block.lua2
-rw-r--r--mapgen.lua21
-rw-r--r--textures/farming_chili_1.pngbin0 -> 113 bytes
-rw-r--r--textures/farming_chili_2.pngbin0 -> 107 bytes
-rw-r--r--textures/farming_chili_3.pngbin0 -> 137 bytes
-rw-r--r--textures/farming_chili_4.pngbin0 -> 144 bytes
-rw-r--r--textures/farming_chili_5.pngbin0 -> 154 bytes
-rw-r--r--textures/farming_chili_6.pngbin0 -> 157 bytes
-rw-r--r--textures/farming_chili_7.pngbin0 -> 169 bytes
-rw-r--r--textures/farming_chili_8.pngbin0 -> 169 bytes
-rw-r--r--textures/farming_chili_bowl.pngbin0 -> 183 bytes
-rw-r--r--textures/farming_chili_pepper.pngbin0 -> 194 bytes
16 files changed, 116 insertions, 1 deletions
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 0000000..aa11988
--- /dev/null
+++ b/textures/farming_chili_1.png
Binary files differ
diff --git a/textures/farming_chili_2.png b/textures/farming_chili_2.png
new file mode 100644
index 0000000..ae34506
--- /dev/null
+++ b/textures/farming_chili_2.png
Binary files differ
diff --git a/textures/farming_chili_3.png b/textures/farming_chili_3.png
new file mode 100644
index 0000000..5e1d901
--- /dev/null
+++ b/textures/farming_chili_3.png
Binary files differ
diff --git a/textures/farming_chili_4.png b/textures/farming_chili_4.png
new file mode 100644
index 0000000..d97769b
--- /dev/null
+++ b/textures/farming_chili_4.png
Binary files differ
diff --git a/textures/farming_chili_5.png b/textures/farming_chili_5.png
new file mode 100644
index 0000000..dd4755d
--- /dev/null
+++ b/textures/farming_chili_5.png
Binary files differ
diff --git a/textures/farming_chili_6.png b/textures/farming_chili_6.png
new file mode 100644
index 0000000..4ee057b
--- /dev/null
+++ b/textures/farming_chili_6.png
Binary files differ
diff --git a/textures/farming_chili_7.png b/textures/farming_chili_7.png
new file mode 100644
index 0000000..5912c2e
--- /dev/null
+++ b/textures/farming_chili_7.png
Binary files differ
diff --git a/textures/farming_chili_8.png b/textures/farming_chili_8.png
new file mode 100644
index 0000000..976eb52
--- /dev/null
+++ b/textures/farming_chili_8.png
Binary files differ
diff --git a/textures/farming_chili_bowl.png b/textures/farming_chili_bowl.png
new file mode 100644
index 0000000..6454ba3
--- /dev/null
+++ b/textures/farming_chili_bowl.png
Binary files differ
diff --git a/textures/farming_chili_pepper.png b/textures/farming_chili_pepper.png
new file mode 100644
index 0000000..922cec4
--- /dev/null
+++ b/textures/farming_chili_pepper.png
Binary files differ