diff options
Diffstat (limited to 'farming')
54 files changed, 503 insertions, 413 deletions
diff --git a/farming/README.txt b/farming/README.txt index 8d81ca6..591fca0 100644 --- a/farming/README.txt +++ b/farming/README.txt @@ -13,6 +13,8 @@ This mod works by adding your new plant to the {growing=1} group and numbering t Changelog: +1.31 - Added Pineapple which can be found growing in savannah areas (place pineapple in crafting to obtain 5x rings to eat and a top for re-planting), also Salt which is made from cooking a bucket of water +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/beanpole.lua b/farming/beanpole.lua index e8b7455..5bd0448 100644 --- a/farming/beanpole.lua +++ b/farming/beanpole.lua @@ -7,7 +7,7 @@ local S = farming.intllib -- place beans -function place_beans(itemstack, placer, pointed_thing, plantname) +local function place_beans(itemstack, placer, pointed_thing, plantname) local pt = pointed_thing diff --git a/farming/cocoa.lua b/farming/cocoa.lua index 3ee3532..b394ab2 100644 --- a/farming/cocoa.lua +++ b/farming/cocoa.lua @@ -2,7 +2,7 @@ local S = farming.intllib -- place cocoa -function place_cocoa(itemstack, placer, pointed_thing, plantname) +local function place_cocoa(itemstack, placer, pointed_thing, plantname) local pt = pointed_thing diff --git a/farming/farming.conf_example b/farming/farming.conf_example index be6e398..7a08b24 100644 --- a/farming/farming.conf_example +++ b/farming/farming.conf_example @@ -25,6 +25,10 @@ farming.grapes = true farming.barley = true farming.chili = true farming.hemp = true +farming.onion = true +farming.garlic = true +farming.pepper = true +farming.pineapple = true farming.donuts = true -- rarety of crops on map, default is 0.006 (higher number = more crops) diff --git a/farming/garlic.lua b/farming/garlic.lua new file mode 100644 index 0000000..ffbf3ec --- /dev/null +++ b/farming/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/farming/grapes.lua b/farming/grapes.lua index d8d6409..baedb4e 100644 --- a/farming/grapes.lua +++ b/farming/grapes.lua @@ -2,7 +2,7 @@ local S = farming.intllib -- place trellis -function place_grapes(itemstack, placer, pointed_thing, plantname) +local function place_grapes(itemstack, placer, pointed_thing, plantname) local pt = pointed_thing diff --git a/farming/hoes.lua b/farming/hoes.lua index aee967c..3dd14f1 100644 --- a/farming/hoes.lua +++ b/farming/hoes.lua @@ -13,7 +13,7 @@ farming.register_hoe = function(name, def) -- Check def table if def.description == nil then - def.description = "Hoe" + def.description = S("Hoe") end if def.inventory_image == nil then diff --git a/farming/init.lua b/farming/init.lua index 8c615f7..407537d 100644 --- a/farming/init.lua +++ b/farming/init.lua @@ -7,7 +7,7 @@ farming = {} farming.mod = "redo" -farming.version = "1.29" +farming.version = "1.31" farming.path = minetest.get_modpath("farming") farming.select = { type = "fixed", @@ -15,7 +15,7 @@ farming.select = { } -local creative_mode_cache = minetest.setting_getbool("creative_mode") +local creative_mode_cache = minetest.settings:get_bool("creative_mode") function farming.is_creative(name) return creative_mode_cache or minetest.check_player_privs(name, {creative = true}) @@ -447,7 +447,7 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname) minetest.sound_play("default_place_node", {pos = pt.above, gain = 1.0}) - if not farming.is_creative(placer:get_player_name()) then + if not placer or not farming.is_creative(placer:get_player_name()) then local name = itemstack:get_name() @@ -595,6 +595,10 @@ farming.grapes = true farming.barley = true farming.chili = true farming.hemp = true +farming.garlic = true +farming.onion = true +farming.pepper = true +farming.pineapple = true farming.donuts = true farming.rarety = 0.006 @@ -646,6 +650,10 @@ 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 +if farming.pineapple then dofile(farming.path.."/pineapple.lua") end dofile(farming.path.."/mapgen.lua") dofile(farming.path.."/compatibility.lua") -- Farming Plus compatibility diff --git a/farming/init.lua_orig b/farming/init.lua_orig deleted file mode 100644 index aee9976..0000000 --- a/farming/init.lua_orig +++ /dev/null @@ -1,192 +0,0 @@ ---[[ - Minetest Farming Redo Mod 1.14 (11th May 2015) - by TenPlus1 -]] - -farming = {} -farming.mod = "redo" -farming.path = minetest.get_modpath("farming") -farming.hoe_on_use = default.hoe_on_use - -dofile(farming.path.."/soil.lua") -dofile(farming.path.."/hoes.lua") -dofile(farming.path.."/grass.lua") -dofile(farming.path.."/wheat.lua") -dofile(farming.path.."/cotton.lua") -dofile(farming.path.."/carrot.lua") -dofile(farming.path.."/potato.lua") -dofile(farming.path.."/tomato.lua") -dofile(farming.path.."/cucumber.lua") -dofile(farming.path.."/corn.lua") -dofile(farming.path.."/coffee.lua") -dofile(farming.path.."/melon.lua") -dofile(farming.path.."/sugar.lua") -dofile(farming.path.."/pumpkin.lua") -dofile(farming.path.."/cocoa.lua") -dofile(farming.path.."/raspberry.lua") -dofile(farming.path.."/blueberry.lua") -dofile(farming.path.."/rhubarb.lua") -dofile(farming.path.."/beanpole.lua") -dofile(farming.path.."/donut.lua") -dofile(farming.path.."/mapgen.lua") -dofile(farming.path.."/compatibility.lua") -- Farming Plus compatibility - --- Place Seeds on Soil - -function farming.place_seed(itemstack, placer, pointed_thing, plantname) - local pt = pointed_thing - - -- check if pointing at a node - if not pt and pt.type ~= "node" then - return - end - - local under = minetest.get_node(pt.under) - local above = minetest.get_node(pt.above) - - -- check if pointing at the top of the node - if pt.above.y ~= pt.under.y+1 then - return - end - - -- return if any of the nodes is not registered - if not minetest.registered_nodes[under.name] - or not minetest.registered_nodes[above.name] then - return - end - - -- can I replace above node, and am I pointing at soil - if not minetest.registered_nodes[above.name].buildable_to - or minetest.get_item_group(under.name, "soil") < 2 - or minetest.get_item_group(above.name, "plant") ~= 0 then -- ADDED this line for multiple seed placement bug - return - end - - -- add the node and remove 1 item from the itemstack - if not minetest.is_protected(pt.above, placer:get_player_name()) then - minetest.add_node(pt.above, {name=plantname}) - if not minetest.setting_getbool("creative_mode") then - itemstack:take_item() - end - return itemstack - end -end - --- Single ABM Handles Growing of All Plants - -minetest.register_abm({ - nodenames = {"group:growing"}, - neighbors = {"farming:soil_wet", "default:jungletree"}, - interval = 80, - chance = 2, - - action = function(pos, node) - - -- split plant name (e.g. farming:wheat_1) - local plant = node.name:split("_")[1].."_" - local numb = node.name:split("_")[2] - - -- fully grown ? - if not minetest.registered_nodes[plant..(numb + 1)] then return end - - -- cocoa pod on jungle tree ? - if plant ~= "farming:cocoa_" then - - -- growing on wet soil ? - if minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}).name ~= "farming:soil_wet" then return end - end - - -- enough light ? - if minetest.get_node_light(pos) < 13 then return end - - -- grow - minetest.set_node(pos, {name=plant..(numb + 1)}) - - end -}) - --- Function to register plants (for compatibility) - -farming.register_plant = function(name, def) - local mname = name:split(":")[1] - local pname = name:split(":")[2] - - -- Check def table - if not def.description then - def.description = "Seed" - end - if not def.inventory_image then - def.inventory_image = "unknown_item.png" - end - if not def.steps then - return nil - end - - -- Register seed - minetest.register_node(":" .. mname .. ":seed_" .. pname, { - description = def.description, - tiles = {def.inventory_image}, - inventory_image = def.inventory_image, - wield_image = def.inventory_image, - drawtype = "signlike", - groups = {seed = 1, snappy = 3, attached_node = 1}, - paramtype = "light", - paramtype2 = "wallmounted", - walkable = false, - sunlight_propagates = true, - selection_box = {type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},}, - on_place = function(itemstack, placer, pointed_thing) - return farming.place_seed(itemstack, placer, pointed_thing, mname .. ":"..pname.."_1") - end - }) - - -- Register harvest - minetest.register_craftitem(":" .. mname .. ":" .. pname, { - description = pname:gsub("^%l", string.upper), - inventory_image = mname .. "_" .. pname .. ".png", - }) - - -- Register growing steps - for i=1,def.steps do - local drop = { - items = { - {items = {mname .. ":" .. pname}, rarity = 9 - i}, - {items = {mname .. ":" .. pname}, rarity= 18 - i * 2}, - {items = {mname .. ":seed_" .. pname}, rarity = 9 - i}, - {items = {mname .. ":seed_" .. pname}, rarity = 18 - i * 2}, - } - } - - local g = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, growing = 1} - -- Last step doesn't need growing=1 so Abm never has to check these - if i == def.steps then - g = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1} - end - - minetest.register_node(mname .. ":" .. pname .. "_" .. i, { - drawtype = "plantlike", - waving = 1, - tiles = {mname .. "_" .. pname .. "_" .. i .. ".png"}, - paramtype = "light", - walkable = false, - buildable_to = true, - is_ground_content = true, - drop = drop, - selection_box = {type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},}, - groups = g, - sounds = default.node_sound_leaves_defaults(), - }) - end - - -- Return info - local r = {seed = mname .. ":seed_" .. pname, harvest = mname .. ":" .. pname} - return r -end - ---[[ Cotton (example, is already registered in cotton.lua) -farming.register_plant("farming:cotton", { - description = "Cotton seed", - inventory_image = "farming_cotton_seed.png", - steps = 8, -}) ---]] diff --git a/farming/locale/de.po b/farming/locale/de.po index 1db5d72..731b31d 100644 --- a/farming/locale/de.po +++ b/farming/locale/de.po @@ -123,25 +123,25 @@ msgstr "Spalier (vor dem Pflanzen der Weintrauben auf den\nAckerboden stellen)" #: hemp.lua msgid "Hemp Seed" -msgstr "" +msgstr "Hanfsamen" #: hemp.lua msgid "Hemp Leaf" -msgstr "" +msgstr "Hanfblatt" #: hemp.lua msgid "Bottle of Hemp Oil" -msgstr "" +msgstr "Flasche mit Hanföl" #: hemp.lua msgid "Hemp Fibre" -msgstr "" +msgstr "Hanffaser" #: hemp.lua msgid "Hemp Rope" -msgstr "" +msgstr "Hanfseil" -#: ???? +#: hoes.lua msgid "Hoe" msgstr "Hacke" diff --git a/farming/locale/de.txt b/farming/locale/de.txt deleted file mode 100644 index 9b85a04..0000000 --- a/farming/locale/de.txt +++ /dev/null @@ -1,104 +0,0 @@ -# German Translation for farming mod -# Deutsche Übersetzung der farming Mod -# last update: 2016/March/31 -# Author: Xanthin - -#init.lua -Seed = Saatgut - -#barley.lua -Barley Seed = Gerstenkörner -Barley = Gerste - -#beanpole.lua -Green Beans = Grüne Bohnen -Bean Pole (place on soil before planting beans) = Bohnenstange (vor dem Pflanzen der Bohnen auf den\nAckerboden stellen) - -#blueberry.lua -Blueberries = Blaubeeren -Blueberry Muffin = Blaubeermuffin - -#carrot.lua -Carrot = Möhre -Golden Carrot = Goldene Möhre - -#cocoa.lua -Cocoa Beans = Kakaobohne -Cookie = Keks -Bar of Dark Chocolate = Tafel Zartbitterschokolade - -#coffee.lua -Coffee Beans = Kaffeebohnen -Drinking Cup (empty) = Tasse (leer) -Cold Cup of Coffee = Kalte Tasse Kaffee -Hot Cup of Coffee = Heiße Tasse Kaffee - -#corn.lua -Corn = Mais -Corn on the Cob = Maiskolben -Bottle of Ethanol = Flasche Ethanol - -#cotton.lua -Cotton Seed = Baumwollsamen -Cotton = Baumwolle - -#cucumber.lua -Cucumber = Gurke - -#donut.lua -Donut = Donut -Chocolate Donut = Schokodonut -Apple Donut = Apfeldonut - -#grapes.lua -Grapes = Weintrauben -Trellis (place on soil before planting grapes) = Spalier (vor dem Pflanzen der Weintrauben auf den\nAckerboden stellen) - -#hoes.lua -Hoe = Hacke -Wooden Hoe = Holzhacke -Stone Hoe = Steinhacke -Steel Hoe = Stahlhacke -Bronze Hoe = Bronzehacke -Mese Hoe = Mesehacke -Diamond Hoe = Diamanthacke - -#melon.lua -Melon Slice = Melonenscheibe -Melon = Melone - -#potato.lua -Potato = Kartoffel -Baked Potato = Ofenkartoffel - -#pumpkin.lua -Pumpkin = Kürbis -Pumpkin Slice = Kürbisscheibe -Jack 'O Lantern (punch to turn on and off) = Kürbislaterne (Punch zum Ein- und Ausschalten) -Pumpkin Bread = Kürbisbrot -Pumpkin Dough = Kürbisteig - -#rasperry.lua -Raspberries = Himbeeren -Raspberry Smoothie = Himbeersmoothie - -#rhubarb.lua -Rhubarb = Rhabarber -Rhubarb Pie = Rhabarberkuchen - -#soil.lua -Soil = Ackerboden -Wet Soil = Bewässerter Ackerboden - -#sugar.lua -Sugar = Zucker - -#tomato.lua -Tomato = Tomate - -#wheat.lua -Wheat Seed = Weizenkörner -Wheat = Weizen -Straw = Stroh -Flour = Mehl -Bread = Brot
\ No newline at end of file diff --git a/farming/locale/template.txt b/farming/locale/template.txt deleted file mode 100644 index 3f52730..0000000 --- a/farming/locale/template.txt +++ /dev/null @@ -1,102 +0,0 @@ -# Template for translations of farming mod -# last update: 2016/March/31 - -#init.lua -Seed = - -#barley.lua -Barley Seed = -Barley = - -#beanpole.lua -Green Beans = -Bean Pole (place on soil before planting beans) = - -#blueberry.lua -Blueberries = -Blueberry Muffin = - -#carrot.lua -Carrot = -Golden Carrot = - -#cocoa.lua -Cocoa Beans = -Cookie = -Bar of Dark Chocolate = - -#coffee.lua -Coffee Beans = -Drinking Cup (empty) = -Cold Cup of Coffee = -Hot Cup of Coffee = - -#corn.lua -Corn = -Corn on the Cob = -Bottle of Ethanol = - -#cotton.lua -Cotton Seed = -Cotton = - -#cucumber.lua -Cucumber = - -#donut.lua -Donut = -Chocolate Donut = -Apple Donut = - -#grapes.lua -Grapes = -Trellis (place on soil before planting grapes) = - -#hoes.lua -Hoe = -Wooden Hoe = -Stone Hoe = -Steel Hoe = -Bronze Hoe = -Mese Hoe = -Diamond Hoe = - -#melon.lua -Melon Slice = -Melon = - -#potato.lua -Potato = -Baked Potato = - -#pumpkin.lua -Pumpkin = -Pumpkin Slice = -Jack 'O Lantern (punch to turn on and off) = -Pumpkin Bread = -Pumpkin Dough = - -#rasperry.lua -Raspberries = -Raspberry Smoothie = - -#rhubarb.lua -Rhubarb = -Rhubarb Pie = - -#soil.lua -Soil = -Wet Soil = - -#sugar.lua -Sugar = - -#tomato.lua -Tomato = - -#wheat.lua -Wheat Seed = -Wheat = -Straw = -Flour = -Bread =
\ No newline at end of file diff --git a/farming/mapgen.lua b/farming/mapgen.lua index 0ca4059..ffbfb67 100644 --- a/farming/mapgen.lua +++ b/farming/mapgen.lua @@ -37,6 +37,8 @@ register_plant("rhubarb_3", 3, 15, "", -1, farming.rhubarb) register_plant("blueberry_4", 3, 10, "", -1, farming.blueberry) register_plant("beanbush", 18, 35, "", -1, farming.beans) register_plant("grapebush", 25, 45, "", -1, farming.grapes) +register_plant("onion_5", 5, 22, "", -1, farming.onion) +register_plant("garlic_5", 3, 30, "group:tree", 1, farming.garlic) if minetest.get_mapgen_setting("mg_name") == "v6" then @@ -94,3 +96,43 @@ minetest.register_decoration({ num_spawn_by = 1, }) end + +if farming.pepper then +minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_rainforest_litter"}, + sidelen = 16, + noise_params = { + offset = 0, + scale = farming.rarety, -- 0.06, + spread = {x = 100, y = 100, z = 100}, + seed = 933, + octaves = 3, + persist = 0.6 + }, + y_min = 5, + y_max = 35, + decoration = {"farming:pepper_5"}, + spawn_by = "group:tree", + num_spawn_by = 1, +}) +end + +if farming.pineapple then +minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_dry_grass"}, + sidelen = 16, + noise_params = { + offset = 0, + scale = farming.rarety, -- 0.06, + spread = {x = 100, y = 100, z = 100}, + seed = 917, + octaves = 3, + persist = 0.6 + }, + y_min = 18, + y_max = 30, + decoration = {"farming:pineapple_8"}, +}) +end diff --git a/farming/onion.lua b/farming/onion.lua new file mode 100644 index 0000000..bf8737a --- /dev/null +++ b/farming/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/farming/pepper.lua b/farming/pepper.lua new file mode 100644 index 0000000..3ce60cd --- /dev/null +++ b/farming/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/farming/pineapple.lua b/farming/pineapple.lua new file mode 100644 index 0000000..2e7f5b7 --- /dev/null +++ b/farming/pineapple.lua @@ -0,0 +1,112 @@ + +local S = farming.intllib + +-- pineapple top +minetest.register_craftitem("farming:pineapple_top", { + description = S("Pineapple Top"), + inventory_image = "farming_pineapple_top.png", + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:pineapple_1") + end, +}) + +-- pineapple +minetest.register_node("farming:pineapple", { + description = S("Pineapple"), + drawtype = "plantlike", + tiles = {"farming_pineapple.png"}, + inventory_image = "farming_pineapple.png", + wield_image = "farming_pineapple.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.27, -0.37, -0.27, 0.27, 0.44, 0.27} + }, + groups = {fleshy = 3, dig_immediate = 3, flammable = 2}, +}) + +-- pineapple +minetest.register_craftitem("farming:pineapple_ring", { + description = S("Pineapple Ring"), + inventory_image = "farming_pineapple_ring.png", + on_use = minetest.item_eat(1), +}) + +minetest.register_craft( { + output = "farming:pineapple_ring 5", + type = "shapeless", + recipe = {"farming:pineapple"}, + replacements = {{"farming:pineapple", "farming:pineapple_top"}} +}) + +-- pineapple juice +minetest.register_craftitem("farming:pineapple_juice", { + description = S("Pineapple Juice"), + inventory_image = "farming_pineapple_juice.png", + on_use = minetest.item_eat(4, "vessels:drinking_glass"), +}) + +minetest.register_craft({ + output = "farming:pineapple_juice", + type = "shapeless", + recipe = {"vessels:drinking_glass", "farming:pineapple_ring", + "farming:pineapple_ring", "farming:pineapple_ring"}, +}) + +-- crop definition +local crop_def = { + drawtype = "plantlike", + visual_scale = 1.5, + tiles = {"farming_pineapple_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:pineapple_1", table.copy(crop_def)) + +-- stage 2 +crop_def.tiles = {"farming_pineapple_2.png"} +minetest.register_node("farming:pineapple_2", table.copy(crop_def)) + +-- stage 3 +crop_def.tiles = {"farming_pineapple_3.png"} +minetest.register_node("farming:pineapple_3", table.copy(crop_def)) + +-- stage 4 +crop_def.tiles = {"farming_pineapple_4.png"} +minetest.register_node("farming:pineapple_4", table.copy(crop_def)) + +-- stage 5 +crop_def.tiles = {"farming_pineapple_5.png"} +minetest.register_node("farming:pineapple_5", table.copy(crop_def)) + +-- stage 6 +crop_def.tiles = {"farming_pineapple_6.png"} +minetest.register_node("farming:pineapple_6", table.copy(crop_def)) + +-- stage 7 +crop_def.tiles = {"farming_pineapple_7.png"} +minetest.register_node("farming:pineapple_7", table.copy(crop_def)) + +-- stage 8 (final) +crop_def.tiles = {"farming_pineapple_8.png"} +crop_def.groups.growing = 0 +crop_def.drop = { + items = { + {items = {'farming:pineapple'}, rarity = 1}, + {items = {'farming:pineapple'}, rarity = 15}, + } +} +minetest.register_node("farming:pineapple_8", table.copy(crop_def)) diff --git a/farming/soil.lua b/farming/soil.lua index 2b8c6b2..0b4844a 100644 --- a/farming/soil.lua +++ b/farming/soil.lua @@ -60,7 +60,7 @@ minetest.register_abm({ elseif node.name == "farming:soil_wet" then minetest.set_node(pos, {name = "farming:soil"}) - elseif node.name == "farming:soil" then + elseif node.name == "farming:soil" and minetest.get_item_group(nn, "plant") == 0 then minetest.set_node(pos, {name = "default:dirt"}) end end, diff --git a/farming/sugar.lua b/farming/sugar.lua index 97efc67..012a987 100644 --- a/farming/sugar.lua +++ b/farming/sugar.lua @@ -13,4 +13,30 @@ minetest.register_craft({ cooktime = 3, output = "farming:sugar 2", recipe = "default:papyrus", -})
\ No newline at end of file +}) + + +--= Salt + +minetest.register_node("farming:salt", { + description = ("Salt"), + inventory_image = "farming_salt.png", + wield_image = "farming_salt.png", + drawtype = "plantlike", + paramtype = "light", + tiles = {"farming_salt.png"}, + groups = {vessel = 1, salt = 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({ + type = "cooking", + cooktime = 15, + output = "farming:salt", + recipe = "bucket:bucket_water", + replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}} +}) diff --git a/farming/textures/crops_garlic.png b/farming/textures/crops_garlic.png Binary files differnew file mode 100644 index 0000000..a73638c --- /dev/null +++ b/farming/textures/crops_garlic.png diff --git a/farming/textures/crops_garlic_braid.png b/farming/textures/crops_garlic_braid.png Binary files differnew file mode 100644 index 0000000..f5fa269 --- /dev/null +++ b/farming/textures/crops_garlic_braid.png diff --git a/farming/textures/crops_garlic_braid_side.png b/farming/textures/crops_garlic_braid_side.png Binary files differnew file mode 100644 index 0000000..ce467b7 --- /dev/null +++ b/farming/textures/crops_garlic_braid_side.png diff --git a/farming/textures/crops_garlic_clove.png b/farming/textures/crops_garlic_clove.png Binary files differnew file mode 100644 index 0000000..bfc1cee --- /dev/null +++ b/farming/textures/crops_garlic_clove.png diff --git a/farming/textures/crops_garlic_plant_1.png b/farming/textures/crops_garlic_plant_1.png Binary files differnew file mode 100644 index 0000000..61eb9a8 --- /dev/null +++ b/farming/textures/crops_garlic_plant_1.png diff --git a/farming/textures/crops_garlic_plant_2.png b/farming/textures/crops_garlic_plant_2.png Binary files differnew file mode 100644 index 0000000..217fd25 --- /dev/null +++ b/farming/textures/crops_garlic_plant_2.png diff --git a/farming/textures/crops_garlic_plant_3.png b/farming/textures/crops_garlic_plant_3.png Binary files differnew file mode 100644 index 0000000..557b017 --- /dev/null +++ b/farming/textures/crops_garlic_plant_3.png diff --git a/farming/textures/crops_garlic_plant_4.png b/farming/textures/crops_garlic_plant_4.png Binary files differnew file mode 100644 index 0000000..80ef076 --- /dev/null +++ b/farming/textures/crops_garlic_plant_4.png diff --git a/farming/textures/crops_garlic_plant_5.png b/farming/textures/crops_garlic_plant_5.png Binary files differnew file mode 100644 index 0000000..8b8c31a --- /dev/null +++ b/farming/textures/crops_garlic_plant_5.png diff --git a/farming/textures/crops_onion.png b/farming/textures/crops_onion.png Binary files differnew file mode 100644 index 0000000..2099c63 --- /dev/null +++ b/farming/textures/crops_onion.png diff --git a/farming/textures/crops_onion_plant_1.png b/farming/textures/crops_onion_plant_1.png Binary files differnew file mode 100644 index 0000000..dea2d4b --- /dev/null +++ b/farming/textures/crops_onion_plant_1.png diff --git a/farming/textures/crops_onion_plant_2.png b/farming/textures/crops_onion_plant_2.png Binary files differnew file mode 100644 index 0000000..1f850f1 --- /dev/null +++ b/farming/textures/crops_onion_plant_2.png diff --git a/farming/textures/crops_onion_plant_3.png b/farming/textures/crops_onion_plant_3.png Binary files differnew file mode 100644 index 0000000..d9af239 --- /dev/null +++ b/farming/textures/crops_onion_plant_3.png diff --git a/farming/textures/crops_onion_plant_4.png b/farming/textures/crops_onion_plant_4.png Binary files differnew file mode 100644 index 0000000..962b21b --- /dev/null +++ b/farming/textures/crops_onion_plant_4.png diff --git a/farming/textures/crops_onion_plant_5.png b/farming/textures/crops_onion_plant_5.png Binary files differnew file mode 100644 index 0000000..dfb1f7f --- /dev/null +++ b/farming/textures/crops_onion_plant_5.png diff --git a/farming/textures/crops_pepper.png b/farming/textures/crops_pepper.png Binary files differnew file mode 100644 index 0000000..bb8f40c --- /dev/null +++ b/farming/textures/crops_pepper.png diff --git a/farming/textures/crops_pepper_ground.png b/farming/textures/crops_pepper_ground.png Binary files differnew file mode 100644 index 0000000..d72405a --- /dev/null +++ b/farming/textures/crops_pepper_ground.png diff --git a/farming/textures/crops_pepper_plant_1.png b/farming/textures/crops_pepper_plant_1.png Binary files differnew file mode 100644 index 0000000..43ce6ba --- /dev/null +++ b/farming/textures/crops_pepper_plant_1.png diff --git a/farming/textures/crops_pepper_plant_2.png b/farming/textures/crops_pepper_plant_2.png Binary files differnew file mode 100644 index 0000000..556f952 --- /dev/null +++ b/farming/textures/crops_pepper_plant_2.png diff --git a/farming/textures/crops_pepper_plant_3.png b/farming/textures/crops_pepper_plant_3.png Binary files differnew file mode 100644 index 0000000..24e92e1 --- /dev/null +++ b/farming/textures/crops_pepper_plant_3.png diff --git a/farming/textures/crops_pepper_plant_4.png b/farming/textures/crops_pepper_plant_4.png Binary files differnew file mode 100644 index 0000000..e33554d --- /dev/null +++ b/farming/textures/crops_pepper_plant_4.png diff --git a/farming/textures/crops_pepper_plant_5.png b/farming/textures/crops_pepper_plant_5.png Binary files differnew file mode 100644 index 0000000..c2c92eb --- /dev/null +++ b/farming/textures/crops_pepper_plant_5.png diff --git a/farming/textures/crops_peppercorn.png b/farming/textures/crops_peppercorn.png Binary files differnew file mode 100644 index 0000000..0ee3c49 --- /dev/null +++ b/farming/textures/crops_peppercorn.png diff --git a/farming/textures/farming_pineapple.png b/farming/textures/farming_pineapple.png Binary files differnew file mode 100644 index 0000000..febf22a --- /dev/null +++ b/farming/textures/farming_pineapple.png diff --git a/farming/textures/farming_pineapple_1.png b/farming/textures/farming_pineapple_1.png Binary files differnew file mode 100644 index 0000000..262eff7 --- /dev/null +++ b/farming/textures/farming_pineapple_1.png diff --git a/farming/textures/farming_pineapple_2.png b/farming/textures/farming_pineapple_2.png Binary files differnew file mode 100644 index 0000000..4b96d17 --- /dev/null +++ b/farming/textures/farming_pineapple_2.png diff --git a/farming/textures/farming_pineapple_3.png b/farming/textures/farming_pineapple_3.png Binary files differnew file mode 100644 index 0000000..90464a1 --- /dev/null +++ b/farming/textures/farming_pineapple_3.png diff --git a/farming/textures/farming_pineapple_4.png b/farming/textures/farming_pineapple_4.png Binary files differnew file mode 100644 index 0000000..be58e53 --- /dev/null +++ b/farming/textures/farming_pineapple_4.png diff --git a/farming/textures/farming_pineapple_5.png b/farming/textures/farming_pineapple_5.png Binary files differnew file mode 100644 index 0000000..2526f83 --- /dev/null +++ b/farming/textures/farming_pineapple_5.png diff --git a/farming/textures/farming_pineapple_6.png b/farming/textures/farming_pineapple_6.png Binary files differnew file mode 100644 index 0000000..741e0e3 --- /dev/null +++ b/farming/textures/farming_pineapple_6.png diff --git a/farming/textures/farming_pineapple_7.png b/farming/textures/farming_pineapple_7.png Binary files differnew file mode 100644 index 0000000..22bad23 --- /dev/null +++ b/farming/textures/farming_pineapple_7.png diff --git a/farming/textures/farming_pineapple_8.png b/farming/textures/farming_pineapple_8.png Binary files differnew file mode 100644 index 0000000..5182c4f --- /dev/null +++ b/farming/textures/farming_pineapple_8.png diff --git a/farming/textures/farming_pineapple_juice.png b/farming/textures/farming_pineapple_juice.png Binary files differnew file mode 100644 index 0000000..43a54c7 --- /dev/null +++ b/farming/textures/farming_pineapple_juice.png diff --git a/farming/textures/farming_pineapple_ring.png b/farming/textures/farming_pineapple_ring.png Binary files differnew file mode 100644 index 0000000..deb2e6d --- /dev/null +++ b/farming/textures/farming_pineapple_ring.png diff --git a/farming/textures/farming_pineapple_top.png b/farming/textures/farming_pineapple_top.png Binary files differnew file mode 100644 index 0000000..f653d83 --- /dev/null +++ b/farming/textures/farming_pineapple_top.png diff --git a/farming/textures/farming_salt.png b/farming/textures/farming_salt.png Binary files differnew file mode 100644 index 0000000..0aa733a --- /dev/null +++ b/farming/textures/farming_salt.png |