summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2018-01-22 15:01:43 +0000
committerTenPlus1 <kinsellaja@yahoo.com>2018-01-22 15:01:43 +0000
commitdd697625abd5f04dfa4b276a3f2b1ae85f8396c2 (patch)
tree349825d4bc3b9a5a61a8b3724bea175f37467035
parent1b71f29fbe82d181049276640a76209fc9db07b3 (diff)
added garlic, onion and pepper thanks to Grizzly Adams
-rw-r--r--README.txt1
-rw-r--r--farming.conf_example3
-rw-r--r--garlic.lua128
-rw-r--r--init.lua8
-rw-r--r--onion.lua67
-rw-r--r--pepper.lua99
-rw-r--r--textures/crops_garlic.pngbin0 -> 725 bytes
-rw-r--r--textures/crops_garlic_braid.pngbin0 -> 1346 bytes
-rw-r--r--textures/crops_garlic_braid_side.pngbin0 -> 1309 bytes
-rw-r--r--textures/crops_garlic_clove.pngbin0 -> 605 bytes
-rw-r--r--textures/crops_garlic_plant_1.pngbin0 -> 165 bytes
-rw-r--r--textures/crops_garlic_plant_2.pngbin0 -> 184 bytes
-rw-r--r--textures/crops_garlic_plant_3.pngbin0 -> 278 bytes
-rw-r--r--textures/crops_garlic_plant_4.pngbin0 -> 403 bytes
-rw-r--r--textures/crops_garlic_plant_5.pngbin0 -> 462 bytes
-rw-r--r--textures/crops_onion.pngbin0 -> 841 bytes
-rw-r--r--textures/crops_onion_plant_1.pngbin0 -> 182 bytes
-rw-r--r--textures/crops_onion_plant_2.pngbin0 -> 192 bytes
-rw-r--r--textures/crops_onion_plant_3.pngbin0 -> 205 bytes
-rw-r--r--textures/crops_onion_plant_4.pngbin0 -> 314 bytes
-rw-r--r--textures/crops_onion_plant_5.pngbin0 -> 652 bytes
-rw-r--r--textures/crops_pepper.pngbin0 -> 441 bytes
-rw-r--r--textures/crops_pepper_ground.pngbin0 -> 373 bytes
-rw-r--r--textures/crops_pepper_plant_1.pngbin0 -> 182 bytes
-rw-r--r--textures/crops_pepper_plant_2.pngbin0 -> 236 bytes
-rw-r--r--textures/crops_pepper_plant_3.pngbin0 -> 299 bytes
-rw-r--r--textures/crops_pepper_plant_4.pngbin0 -> 457 bytes
-rw-r--r--textures/crops_pepper_plant_5.pngbin0 -> 492 bytes
-rw-r--r--textures/crops_peppercorn.pngbin0 -> 220 bytes
29 files changed, 305 insertions, 1 deletions
diff --git a/README.txt b/README.txt
index 8d81ca6..7ab9abe 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.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
1.28 - Added chili peppers and bowl of chili, optimized code and fixed a few bugs, added porridge
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)
diff --git a/farming.conf_example b/farming.conf_example
index be6e398..d8e40de 100644
--- a/farming.conf_example
+++ b/farming.conf_example
@@ -25,6 +25,9 @@ farming.grapes = true
farming.barley = true
farming.chili = true
farming.hemp = true
+farming.onion = true
+farming.garlic = true
+farming.pepper = true
farming.donuts = true
-- rarety of crops on map, default is 0.006 (higher number = more crops)
diff --git a/garlic.lua b/garlic.lua
new file mode 100644
index 0000000..ffbf3ec
--- /dev/null
+++ b/garlic.lua
@@ -0,0 +1,128 @@
+
+--[[
+ Original textures from Crops Plus mod
+ Copyright (C) 2018 Grizzly Adam
+ https://forum.minetest.net/viewtopic.php?f=9&t=19488
+]]
+
+local S = farming.intllib
+
+-- potato
+minetest.register_craftitem("farming:garlic_clove", {
+ description = S("Garlic clove"),
+ inventory_image = "crops_garlic_clove.png",
+ on_place = function(itemstack, placer, pointed_thing)
+ return farming.place_seed(itemstack, placer, pointed_thing, "farming:garlic_1")
+ end,
+})
+
+-- garlic bulb
+minetest.register_craftitem("farming:garlic", {
+ description = S("Garlic"),
+ inventory_image = "crops_garlic.png",
+ on_use = minetest.item_eat(1),
+ groups = {garlic = 1},
+})
+
+minetest.register_craft({
+ type = "shapeless",
+ output = "farming:garlic_clove 9",
+ recipe = { "farming:garlic" }
+})
+
+minetest.register_craft({
+ output = "farming:garlic",
+ recipe = {
+ {"farming:garlic_clove", "farming:garlic_clove", "farming:garlic_clove"},
+ {"farming:garlic_clove", "farming:garlic_clove", "farming:garlic_clove"},
+ {"farming:garlic_clove", "farming:garlic_clove", "farming:garlic_clove"}
+ }
+})
+
+-- garlic braid
+minetest.register_node("farming:garlic_braid", {
+ description = S("Garlic Braid"),
+ inventory_image = "crops_garlic_braid.png",
+ wield_image = "crops_garlic_braid.png",
+ drawtype = "nodebox",
+ paramtype = "light",
+ paramtype2 = "facedir",
+ tiles = {
+ "crops_garlic_braid_side.png","crops_garlic_braid.png",
+ "crops_garlic_braid_side.png^[transformFx","crops_garlic_braid_side.png",
+ "crops_garlic_braid.png","crops_garlic_braid.png"
+ },
+ groups = {vessel = 1, dig_immediate = 3},
+ sounds = default.node_sound_leaves_defaults(),
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.13, -0.45, 0.5, 0.13, 0.45, 0.24,
+ },
+ },
+ }
+})
+
+minetest.register_craft({
+ output = "farming:garlic_braid",
+ recipe = {
+ {"farming:garlic", "farming:garlic", "farming:garlic"},
+ {"farming:garlic", "farming:garlic", "farming:garlic"},
+ {"farming:garlic", "farming:garlic", "farming:garlic"}
+ }
+})
+
+minetest.register_craft({
+ type = "shapeless",
+ output = "farming:garlic 9",
+ recipe = { "farming:garlic_braid" }
+})
+
+-- crop definition
+local crop_def = {
+ drawtype = "plantlike",
+ tiles = {"crops_garlic_plant_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 = 3, flora = 1, attached_node = 1,
+ not_in_creative_inventory = 1, growing = 1
+ },
+ sounds = default.node_sound_leaves_defaults()
+}
+
+-- stage 1
+minetest.register_node("farming:garlic_1", table.copy(crop_def))
+
+-- stage 2
+crop_def.tiles = {"crops_garlic_plant_2.png"}
+minetest.register_node("farming:garlic_2", table.copy(crop_def))
+
+-- stage 3
+crop_def.tiles = {"crops_garlic_plant_3.png"}
+minetest.register_node("farming:garlic_3", table.copy(crop_def))
+
+-- stage 4
+crop_def.tiles = {"crops_garlic_plant_4.png"}
+minetest.register_node("farming:garlic_4", table.copy(crop_def))
+
+-- stage 5
+crop_def.tiles = {"crops_garlic_plant_5.png"}
+crop_def.groups.growing = 0
+crop_def.drop = {
+ max_items = 5, items = {
+ {items = {'farming:garlic'}, rarity = 1},
+ {items = {'farming:garlic'}, rarity = 1},
+ {items = {'farming:garlic'}, rarity = 1},
+ {items = {'farming:garlic'}, rarity = 2},
+ {items = {'farming:garlic'}, rarity = 5},
+ }
+}
+minetest.register_node("farming:garlic_5", table.copy(crop_def))
diff --git a/init.lua b/init.lua
index e4919ec..ab700de 100644
--- a/init.lua
+++ b/init.lua
@@ -7,7 +7,7 @@
farming = {}
farming.mod = "redo"
-farming.version = "1.29"
+farming.version = "1.30"
farming.path = minetest.get_modpath("farming")
farming.select = {
type = "fixed",
@@ -595,6 +595,9 @@ farming.grapes = true
farming.barley = true
farming.chili = true
farming.hemp = true
+farming.garlic = true
+farming.onion = true
+farming.pepper = true
farming.donuts = true
farming.rarety = 0.006
@@ -646,6 +649,9 @@ 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
+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
dofile(farming.path.."/mapgen.lua")
dofile(farming.path.."/compatibility.lua") -- Farming Plus compatibility
diff --git a/onion.lua b/onion.lua
new file mode 100644
index 0000000..bf8737a
--- /dev/null
+++ b/onion.lua
@@ -0,0 +1,67 @@
+
+--[[
+ Original textures from Crops Plus mod
+ Copyright (C) 2018 Grizzly Adam
+ https://forum.minetest.net/viewtopic.php?f=9&t=19488
+]]
+
+local S = farming.intllib
+
+-- potato
+minetest.register_craftitem("farming:onion", {
+ description = S("Onion"),
+ inventory_image = "crops_onion.png",
+ on_place = function(itemstack, placer, pointed_thing)
+ return farming.place_seed(itemstack, placer, pointed_thing, "farming:onion_1")
+ end,
+ on_use = minetest.item_eat(1),
+})
+
+-- crop definition
+local crop_def = {
+ drawtype = "plantlike",
+ tiles = {"crops_onion_plant_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 = 3, flora = 1, attached_node = 1,
+ not_in_creative_inventory = 1, growing = 1
+ },
+ sounds = default.node_sound_leaves_defaults()
+}
+
+-- stage 1
+minetest.register_node("farming:onion_1", table.copy(crop_def))
+
+-- stage 2
+crop_def.tiles = {"crops_onion_plant_2.png"}
+minetest.register_node("farming:onion_2", table.copy(crop_def))
+
+-- stage 3
+crop_def.tiles = {"crops_onion_plant_3.png"}
+minetest.register_node("farming:onion_3", table.copy(crop_def))
+
+-- stage 4
+crop_def.tiles = {"crops_onion_plant_4.png"}
+minetest.register_node("farming:onion_4", table.copy(crop_def))
+
+-- stage 5
+crop_def.tiles = {"crops_onion_plant_5.png"}
+crop_def.groups.growing = 0
+crop_def.drop = {
+ max_items = 5, items = {
+ {items = {'farming:onion'}, rarity = 1},
+ {items = {'farming:onion'}, rarity = 1},
+ {items = {'farming:onion'}, rarity = 1},
+ {items = {'farming:onion'}, rarity = 2},
+ {items = {'farming:onion'}, rarity = 5},
+ }
+}
+minetest.register_node("farming:onion_5", table.copy(crop_def))
diff --git a/pepper.lua b/pepper.lua
new file mode 100644
index 0000000..3ce60cd
--- /dev/null
+++ b/pepper.lua
@@ -0,0 +1,99 @@
+
+--[[
+ Original textures from Crops Plus mod
+ Copyright (C) 2018 Grizzly Adam
+ https://forum.minetest.net/viewtopic.php?f=9&t=19488
+]]
+
+local S = farming.intllib
+
+-- peppercorn (seed)
+minetest.register_craftitem("farming:peppercorn", {
+ description = S("Peppercorn"),
+ inventory_image = "crops_peppercorn.png",
+ on_place = function(itemstack, placer, pointed_thing)
+ return farming.place_seed(itemstack, placer, pointed_thing, "farming:pepper_1")
+ end,
+})
+
+-- green pepper
+minetest.register_craftitem("farming:pepper", {
+ description = S("Pepper"),
+ inventory_image = "crops_pepper.png",
+ on_use = minetest.item_eat(2),
+ groups = {pepper = 1},
+})
+
+minetest.register_craft({
+ type = "shapeless",
+ output = "farming:peppercorn",
+ recipe = { "farming:pepper" }
+})
+
+-- ground pepper
+minetest.register_node("farming:pepper_ground", {
+ description = ("Ground Pepper"),
+ inventory_image = "crops_pepper_ground.png",
+ wield_image = "crops_pepper_ground.png",
+ drawtype = "plantlike",
+ paramtype = "light",
+ tiles = {"crops_pepper_ground.png"},
+ groups = {vessel = 1, pepper_ground = 1, dig_immediate = 3, attached_node = 1},
+ sounds = default.node_sound_glass_defaults(),
+ selection_box = {
+ type = "fixed",
+ fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
+ },
+})
+
+minetest.register_craft( {
+ output = "farming:pepper_ground",
+ type = "shapeless",
+ recipe = {"farming:peppercorn", "vessels:glass_bottle"}
+})
+
+-- crop definition
+local crop_def = {
+ drawtype = "plantlike",
+ tiles = {"crops_pepper_plant_1.png"},
+ paramtype = "light",
+ paramtype2 = "meshoptions",
+ place_param2 = 1,
+ sunlight_propagates = true,
+ waving = 1,
+ walkable = false,
+ buildable_to = true,
+ drop = "",
+ selection_box = farming.select,
+ groups = {
+ snappy = 3, flammable = 3, flora = 1, attached_node = 1,
+ not_in_creative_inventory = 1, growing = 1
+ },
+ sounds = default.node_sound_leaves_defaults()
+}
+
+-- stage 1
+minetest.register_node("farming:pepper_1", table.copy(crop_def))
+
+-- stage 2
+crop_def.tiles = {"crops_pepper_plant_2.png"}
+minetest.register_node("farming:pepper_2", table.copy(crop_def))
+
+-- stage 3
+crop_def.tiles = {"crops_pepper_plant_3.png"}
+minetest.register_node("farming:pepper_3", table.copy(crop_def))
+
+-- stage 4
+crop_def.tiles = {"crops_pepper_plant_4.png"}
+minetest.register_node("farming:pepper_4", table.copy(crop_def))
+
+-- stage 5
+crop_def.tiles = {"crops_pepper_plant_5.png"}
+crop_def.groups.growing = 0
+crop_def.drop = {
+ max_items = 2, items = {
+ {items = {'farming:pepper'}, rarity = 1},
+ {items = {'farming:pepper'}, rarity = 2},
+ }
+}
+minetest.register_node("farming:pepper_5", table.copy(crop_def))
diff --git a/textures/crops_garlic.png b/textures/crops_garlic.png
new file mode 100644
index 0000000..a73638c
--- /dev/null
+++ b/textures/crops_garlic.png
Binary files differ
diff --git a/textures/crops_garlic_braid.png b/textures/crops_garlic_braid.png
new file mode 100644
index 0000000..f5fa269
--- /dev/null
+++ b/textures/crops_garlic_braid.png
Binary files differ
diff --git a/textures/crops_garlic_braid_side.png b/textures/crops_garlic_braid_side.png
new file mode 100644
index 0000000..ce467b7
--- /dev/null
+++ b/textures/crops_garlic_braid_side.png
Binary files differ
diff --git a/textures/crops_garlic_clove.png b/textures/crops_garlic_clove.png
new file mode 100644
index 0000000..bfc1cee
--- /dev/null
+++ b/textures/crops_garlic_clove.png
Binary files differ
diff --git a/textures/crops_garlic_plant_1.png b/textures/crops_garlic_plant_1.png
new file mode 100644
index 0000000..61eb9a8
--- /dev/null
+++ b/textures/crops_garlic_plant_1.png
Binary files differ
diff --git a/textures/crops_garlic_plant_2.png b/textures/crops_garlic_plant_2.png
new file mode 100644
index 0000000..217fd25
--- /dev/null
+++ b/textures/crops_garlic_plant_2.png
Binary files differ
diff --git a/textures/crops_garlic_plant_3.png b/textures/crops_garlic_plant_3.png
new file mode 100644
index 0000000..557b017
--- /dev/null
+++ b/textures/crops_garlic_plant_3.png
Binary files differ
diff --git a/textures/crops_garlic_plant_4.png b/textures/crops_garlic_plant_4.png
new file mode 100644
index 0000000..80ef076
--- /dev/null
+++ b/textures/crops_garlic_plant_4.png
Binary files differ
diff --git a/textures/crops_garlic_plant_5.png b/textures/crops_garlic_plant_5.png
new file mode 100644
index 0000000..8b8c31a
--- /dev/null
+++ b/textures/crops_garlic_plant_5.png
Binary files differ
diff --git a/textures/crops_onion.png b/textures/crops_onion.png
new file mode 100644
index 0000000..2099c63
--- /dev/null
+++ b/textures/crops_onion.png
Binary files differ
diff --git a/textures/crops_onion_plant_1.png b/textures/crops_onion_plant_1.png
new file mode 100644
index 0000000..dea2d4b
--- /dev/null
+++ b/textures/crops_onion_plant_1.png
Binary files differ
diff --git a/textures/crops_onion_plant_2.png b/textures/crops_onion_plant_2.png
new file mode 100644
index 0000000..1f850f1
--- /dev/null
+++ b/textures/crops_onion_plant_2.png
Binary files differ
diff --git a/textures/crops_onion_plant_3.png b/textures/crops_onion_plant_3.png
new file mode 100644
index 0000000..d9af239
--- /dev/null
+++ b/textures/crops_onion_plant_3.png
Binary files differ
diff --git a/textures/crops_onion_plant_4.png b/textures/crops_onion_plant_4.png
new file mode 100644
index 0000000..962b21b
--- /dev/null
+++ b/textures/crops_onion_plant_4.png
Binary files differ
diff --git a/textures/crops_onion_plant_5.png b/textures/crops_onion_plant_5.png
new file mode 100644
index 0000000..dfb1f7f
--- /dev/null
+++ b/textures/crops_onion_plant_5.png
Binary files differ
diff --git a/textures/crops_pepper.png b/textures/crops_pepper.png
new file mode 100644
index 0000000..bb8f40c
--- /dev/null
+++ b/textures/crops_pepper.png
Binary files differ
diff --git a/textures/crops_pepper_ground.png b/textures/crops_pepper_ground.png
new file mode 100644
index 0000000..d72405a
--- /dev/null
+++ b/textures/crops_pepper_ground.png
Binary files differ
diff --git a/textures/crops_pepper_plant_1.png b/textures/crops_pepper_plant_1.png
new file mode 100644
index 0000000..43ce6ba
--- /dev/null
+++ b/textures/crops_pepper_plant_1.png
Binary files differ
diff --git a/textures/crops_pepper_plant_2.png b/textures/crops_pepper_plant_2.png
new file mode 100644
index 0000000..556f952
--- /dev/null
+++ b/textures/crops_pepper_plant_2.png
Binary files differ
diff --git a/textures/crops_pepper_plant_3.png b/textures/crops_pepper_plant_3.png
new file mode 100644
index 0000000..24e92e1
--- /dev/null
+++ b/textures/crops_pepper_plant_3.png
Binary files differ
diff --git a/textures/crops_pepper_plant_4.png b/textures/crops_pepper_plant_4.png
new file mode 100644
index 0000000..e33554d
--- /dev/null
+++ b/textures/crops_pepper_plant_4.png
Binary files differ
diff --git a/textures/crops_pepper_plant_5.png b/textures/crops_pepper_plant_5.png
new file mode 100644
index 0000000..c2c92eb
--- /dev/null
+++ b/textures/crops_pepper_plant_5.png
Binary files differ
diff --git a/textures/crops_peppercorn.png b/textures/crops_peppercorn.png
new file mode 100644
index 0000000..0ee3c49
--- /dev/null
+++ b/textures/crops_peppercorn.png
Binary files differ