From 02374bb6708e786d524f8850e9af8ccd01143533 Mon Sep 17 00:00:00 2001 From: Brandon Date: Sat, 18 Jun 2016 17:18:33 -0500 Subject: [PATCH] Merge farming and farming_plus, slow farming way down, environment reclaim weeded plots --- mods/adventuretest/functions.lua | 14 +- mods/cottages/adaptions.lua | 4 +- mods/cottages/depends.txt | 2 +- mods/cottages/init.lua | 2 +- mods/cottages/nodes_historic.lua | 4 +- mods/cottages/nodes_straw.lua | 10 +- mods/default/functions.lua | 16 + mods/default/nodes.lua | 9 +- mods/farming/README.txt | 57 -- mods/farming/depends.txt | 2 - mods/farming/init.lua | 506 ------------------ mods/farming_plus/README.txt | 52 +- mods/farming_plus/aliases.lua | 19 + mods/farming_plus/carrots.lua | 10 +- mods/farming_plus/cotton.lua | 57 ++ mods/farming_plus/depends.txt | 3 +- mods/farming_plus/functions.lua | 199 +++++++ mods/farming_plus/grass.lua | 89 +++ mods/farming_plus/init.lua | 301 +---------- mods/farming_plus/potatoes.lua | 8 +- mods/farming_plus/pumpkin.lua | 117 ++-- mods/farming_plus/rhubarb.lua | 8 +- mods/farming_plus/soil.lua | 49 ++ mods/farming_plus/strawberries.lua | 10 +- .../textures/farming_bread.png | Bin .../textures/farming_cotton_1.png | Bin .../textures/farming_cotton_2.png | Bin .../textures/farming_cotton_3.png | Bin .../textures/farming_cotton_4.png | Bin .../textures/farming_cotton_5.png | Bin .../textures/farming_cotton_6.png | Bin .../textures/farming_cotton_7.png | Bin .../textures/farming_cotton_8.png | Bin .../textures/farming_cotton_seed.png | Bin .../textures/farming_flour.png | Bin .../textures/farming_soil.png | Bin .../textures/farming_soil_wet.png | Bin .../textures/farming_soil_wet_side.png | Bin .../textures/farming_string.png | Bin .../textures/farming_tool_bronzehoe.png | Bin .../textures/farming_tool_steelhoe.png | Bin .../textures/farming_tool_stonehoe.png | Bin .../textures/farming_tool_woodhoe.png | Bin .../textures/farming_wheat.png | Bin .../textures/farming_wheat_1.png | Bin .../textures/farming_wheat_2.png | Bin .../textures/farming_wheat_3.png | Bin .../textures/farming_wheat_4.png | Bin .../textures/farming_wheat_5.png | Bin .../textures/farming_wheat_6.png | Bin .../textures/farming_wheat_7.png | Bin .../textures/farming_wheat_8.png | Bin .../textures/farming_wheat_seed.png | Bin mods/farming_plus/tomatoes.lua | 10 +- mods/farming_plus/tools.lua | 113 ++++ mods/farming_plus/weed.lua | 38 +- mods/farming_plus/wheat.lua | 71 +++ mods/flowers/init.lua | 11 +- mods/food/init.lua | 12 +- .../replacements_farming.lua | 20 +- .../replacements_realtest.lua | 8 +- .../translate_nodenames_for_mc_schematic.lua | 10 +- mods/hunger/depends.txt | 1 - mods/hunger/food.lua | 76 +-- mods/hunger/init.lua | 14 - mods/mg/depends.txt | 2 +- mods/mg/dungeons.lua | 2 +- mods/mg/fill_chests.lua | 4 +- mods/mg_villages/depends.txt | 2 +- mods/mg_villages/fill_chest.lua | 4 +- mods/mg_villages/mapgen.lua | 16 +- mods/mg_villages/replacements.lua | 40 +- mods/mg_villages/village_types.lua | 6 +- mods/mobs/animals/sheep.lua | 4 +- mods/mobs/monsters/jungle_spider.lua | 2 +- mods/mobs/monsters/spider.lua | 2 +- mods/mobs/npcs/women.lua | 2 +- mods/potions/items.lua | 2 +- mods/quests/chest.lua | 4 +- mods/throwing/depends.txt | 2 +- mods/throwing/init.lua | 12 +- 81 files changed, 971 insertions(+), 1067 deletions(-) delete mode 100644 mods/farming/README.txt delete mode 100644 mods/farming/depends.txt delete mode 100644 mods/farming/init.lua create mode 100644 mods/farming_plus/aliases.lua create mode 100644 mods/farming_plus/cotton.lua create mode 100644 mods/farming_plus/functions.lua create mode 100644 mods/farming_plus/grass.lua create mode 100644 mods/farming_plus/soil.lua rename mods/{farming => farming_plus}/textures/farming_bread.png (100%) rename mods/{farming => farming_plus}/textures/farming_cotton_1.png (100%) rename mods/{farming => farming_plus}/textures/farming_cotton_2.png (100%) rename mods/{farming => farming_plus}/textures/farming_cotton_3.png (100%) rename mods/{farming => farming_plus}/textures/farming_cotton_4.png (100%) rename mods/{farming => farming_plus}/textures/farming_cotton_5.png (100%) rename mods/{farming => farming_plus}/textures/farming_cotton_6.png (100%) rename mods/{farming => farming_plus}/textures/farming_cotton_7.png (100%) rename mods/{farming => farming_plus}/textures/farming_cotton_8.png (100%) rename mods/{farming => farming_plus}/textures/farming_cotton_seed.png (100%) rename mods/{farming => farming_plus}/textures/farming_flour.png (100%) rename mods/{farming => farming_plus}/textures/farming_soil.png (100%) rename mods/{farming => farming_plus}/textures/farming_soil_wet.png (100%) rename mods/{farming => farming_plus}/textures/farming_soil_wet_side.png (100%) rename mods/{farming => farming_plus}/textures/farming_string.png (100%) rename mods/{farming => farming_plus}/textures/farming_tool_bronzehoe.png (100%) rename mods/{farming => farming_plus}/textures/farming_tool_steelhoe.png (100%) rename mods/{farming => farming_plus}/textures/farming_tool_stonehoe.png (100%) rename mods/{farming => farming_plus}/textures/farming_tool_woodhoe.png (100%) rename mods/{farming => farming_plus}/textures/farming_wheat.png (100%) rename mods/{farming => farming_plus}/textures/farming_wheat_1.png (100%) rename mods/{farming => farming_plus}/textures/farming_wheat_2.png (100%) rename mods/{farming => farming_plus}/textures/farming_wheat_3.png (100%) rename mods/{farming => farming_plus}/textures/farming_wheat_4.png (100%) rename mods/{farming => farming_plus}/textures/farming_wheat_5.png (100%) rename mods/{farming => farming_plus}/textures/farming_wheat_6.png (100%) rename mods/{farming => farming_plus}/textures/farming_wheat_7.png (100%) rename mods/{farming => farming_plus}/textures/farming_wheat_8.png (100%) rename mods/{farming => farming_plus}/textures/farming_wheat_seed.png (100%) create mode 100644 mods/farming_plus/tools.lua create mode 100644 mods/farming_plus/wheat.lua diff --git a/mods/adventuretest/functions.lua b/mods/adventuretest/functions.lua index 14bc91c..bd231cf 100644 --- a/mods/adventuretest/functions.lua +++ b/mods/adventuretest/functions.lua @@ -42,4 +42,16 @@ function adventuretest.teleport(player,pos) local name = player:get_player_name(); pd.set(name,"lastpos",pos) player:moveto(pos) -end \ No newline at end of file +end + +function hunger_join_player(player) + local name = player:get_player_name() + local lvl = pd.get_number(name,"hunger_lvl") + if lvl > 20 then + lvl = 20 + end + minetest.after(0.8, function() + hud.change_item(player, "hunger", {offset = "item", item_name = "hunger"}) + hud.change_item(player, "hunger", {number = lvl, max = 20}) + end) +end diff --git a/mods/cottages/adaptions.lua b/mods/cottages/adaptions.lua index 24782cd..ff9ddd8 100644 --- a/mods/cottages/adaptions.lua +++ b/mods/cottages/adaptions.lua @@ -55,7 +55,7 @@ cottages.texture_chest = {"default_chest_top.png", "default_chest_top.png", "def "default_chest_side.png", "default_chest_side.png", "default_chest_front.png"}; -- the treshing floor produces wheat seeds -cottages.craftitem_seed_wheat = "farming:seed_wheat"; +cottages.craftitem_seed_wheat = "farming_plus:seed_wheat"; cottages.texture_wheat_seed = "farming_wheat_seed.png"; cottages.texture_stick = "default_stick.png"; @@ -84,7 +84,7 @@ if( not( minetest.registered_nodes["default:tree"])) then "spruce_chest_side.png", "spruce_chest_side.png", "spruce_chest_front.png"}; -- wheat is called spelt in RealTest - cottages.craftitem_seed_wheat = 'farming:seed_spelt'; + cottages.craftitem_seed_wheat = 'farming_plus:seed_spelt'; cottages.texture_wheat_seed = 'farming_spelt_seed.png'; cottages.texture_stick = 'trees_maple_stick.png'; else diff --git a/mods/cottages/depends.txt b/mods/cottages/depends.txt index e10338b..65d2c99 100644 --- a/mods/cottages/depends.txt +++ b/mods/cottages/depends.txt @@ -1,5 +1,5 @@ default? -farming +farming_plus stairs? homedecor? intllib? diff --git a/mods/cottages/init.lua b/mods/cottages/init.lua index af0cb16..d1c27b5 100644 --- a/mods/cottages/init.lua +++ b/mods/cottages/init.lua @@ -39,7 +39,7 @@ dofile(minetest.get_modpath("cottages").."/adaptions.lua"); -- add to this table what you want the handmill to convert; -- add a stack size if you want a higher yield cottages.handmill_product = {}; -cottages.handmill_product[ cottages.craftitem_seed_wheat ] = 'farming:flour 1'; +cottages.handmill_product[ cottages.craftitem_seed_wheat ] = 'farming_plus:flour 1'; --[[ some examples: cottages.handmill_product[ 'default:cobble' ] = 'default:gravel'; cottages.handmill_product[ 'default:gravel' ] = 'default:sand'; diff --git a/mods/cottages/nodes_historic.lua b/mods/cottages/nodes_historic.lua index 0a81d23..c3c5efd 100644 --- a/mods/cottages/nodes_historic.lua +++ b/mods/cottages/nodes_historic.lua @@ -270,7 +270,7 @@ minetest.register_craft({ minetest.register_craft({ output = "cottages:wood_flat 16", recipe = { - {cottages.craftitem_stick, "farming:string",cottages.craftitem_stick }, + {cottages.craftitem_stick, "farming_plus:string",cottages.craftitem_stick }, {cottages.craftitem_stick, "", cottages.craftitem_stick }, } }) @@ -278,7 +278,7 @@ minetest.register_craft({ minetest.register_craft({ output = "cottages:wool_tent 2", recipe = { - {"farming:string", "farming:string"}, + {"farming_plus:string", "farming_plus:string"}, {"",cottages.craftitem_stick} } }) diff --git a/mods/cottages/nodes_straw.lua b/mods/cottages/nodes_straw.lua index acf08fa..3506a9a 100644 --- a/mods/cottages/nodes_straw.lua +++ b/mods/cottages/nodes_straw.lua @@ -175,7 +175,7 @@ minetest.register_node("cottages:threshing_floor", { -- only accept input the threshing floor can use/process if( listname=='straw' or listname=='seeds' - or (listname=='harvest' and stack and stack:get_name() ~= 'farming:wheat' )) then + or (listname=='harvest' and stack and stack:get_name() ~= 'farming_plus:wheat' )) then return 0; end @@ -218,8 +218,8 @@ minetest.register_node("cottages:threshing_floor", { local stack2 = inv:get_stack( 'harvest', 2); if( ( stack1:is_empty() and stack2:is_empty()) - or( not( stack1:is_empty()) and stack1:get_name() ~= 'farming:wheat') - or( not( stack2:is_empty()) and stack2:get_name() ~= 'farming:wheat')) then + or( not( stack1:is_empty()) and stack1:get_name() ~= 'farming_plus:wheat') + or( not( stack2:is_empty()) and stack2:get_name() ~= 'farming_plus:wheat')) then -- minetest.chat_send_player( name, 'One of the input slots contains something else than wheat, or there is no wheat at all.'); -- update the formspec @@ -254,7 +254,7 @@ minetest.register_node("cottages:threshing_floor", { inv:add_item("straw",'cottages:straw_mat '..tostring( anz_straw )); inv:add_item("seeds",cottages.craftitem_seed_wheat..' '..tostring( anz_seeds )); -- consume the wheat - inv:remove_item("harvest", 'farming:wheat '..tostring( anz_wheat )); + inv:remove_item("harvest", 'farming_plus:wheat '..tostring( anz_wheat )); local anz_left = found_wheat - anz_wheat; if( anz_left > 0 ) then @@ -520,7 +520,7 @@ minetest.register_craft({ output = "cottages:straw_mat 6", recipe = { {cottages.craftitem_stone,'',''}, - {"farming:wheat", "farming:wheat", "farming:wheat", }, + {"farming_plus:wheat", "farming_plus:wheat", "farming_plus:wheat", }, }, replacements = {{ cottages.craftitem_stone, cottages.craftitem_seed_wheat.." 3" }}, }) diff --git a/mods/default/functions.lua b/mods/default/functions.lua index 0fc48a6..5a86e08 100644 --- a/mods/default/functions.lua +++ b/mods/default/functions.lua @@ -185,6 +185,22 @@ minetest.register_abm({ end, }) +-- freeze things +minetest.register_abm({ + nodenames = {"group:freezes"}, + neighbors = {"group:frozen"}, + interval = 10, + chance = 2, + action = function(pos, node) + local new_node = minetest.registered_nodes[node.name].freezemelt + if new_node ~= nil then + minetest.set_node(pos,{name=new_node}) + else + minetest.log("error","Freezing node without freezemelt set: "..node.name) + end + end +}) + -- -- Papyrus and cactus growing -- diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index 351e385..9883837 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -842,7 +842,7 @@ minetest.register_abm({ action = function(pos, node, active_object_count, active_object_count_wider) if abm_limiter() then return end local item_count = math.random(0,5) - local items_available = { [0] = "default:apple", [1] = "mobs:meat_raw", [2]="farming:bread",[3]="bushes:berry_pie_cooked",[4]="bushes:basket_empty",[5]="farming:wheat",[6]="throwing:arrow",[7]="default:torch",[8]="farming:string"} + local items_available = { [0] = "default:apple", [1] = "mobs:meat_raw", [2]="farming_plus:bread",[3]="bushes:berry_pie_cooked",[4]="bushes:basket_empty",[5]="farming_plus:wheat",[6]="throwing:arrow",[7]="default:torch",[8]="farming_plus:string"} local meta = minetest.get_meta(pos) local inv = meta:get_inventory() for i = 0, item_count do @@ -1579,7 +1579,7 @@ minetest.register_node("default:ice", { is_ground_content = true, paramtype = "light", freezemelt = "default:water_source", - groups = {choppy=3,cracky=3, melts=1}, + groups = {choppy=3,cracky=3, melts=1, frozen=1}, sounds = default.node_sound_glass_defaults(), }) @@ -1591,6 +1591,7 @@ minetest.register_node("default:snow", { is_ground_content = true, paramtype = "light", buildable_to = true, + floodable = true, leveled = 7, drawtype = "nodebox", freezemelt = "default:water_flowing", @@ -1601,7 +1602,7 @@ minetest.register_node("default:snow", { {-0.5, -0.5, -0.5, 0.5, -0.5+2/16, 0.5}, }, }, - groups = {crumbly=3,falling_node=1, melts=1, float=1,puts_out_fire=1}, + groups = {crumbly=3,falling_node=1, melts=1, float=1,puts_out_fire=1, frozen=1}, sounds = default.node_sound_dirt_defaults({ footstep = {name="default_snow_footstep", gain=0.25}, dug = {name="default_snow_footstep", gain=0.75}, @@ -1614,7 +1615,7 @@ minetest.register_node("default:snowblock", { tiles = {"default_snow.png"}, is_ground_content = true, freezemelt = "default:water_source", - groups = {crumbly=3, melts=1, puts_out_fire=1}, + groups = {crumbly=3, melts=1, puts_out_fire=1,frozen=1}, sounds = default.node_sound_dirt_defaults({ footstep = {name="default_snow_footstep", gain=0.25}, dug = {name="default_snow_footstep", gain=0.75}, diff --git a/mods/farming/README.txt b/mods/farming/README.txt deleted file mode 100644 index b92e0be..0000000 --- a/mods/farming/README.txt +++ /dev/null @@ -1,57 +0,0 @@ -Minetest 0.4 mod: farming -========================= - -License of source code: ------------------------ -Copyright (C) 2012-2013 PilzAdam - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - Version 2, December 2004 - - Copyright (C) 2004 Sam Hocevar - - Everyone is permitted to copy and distribute verbatim or modified - copies of this license document, and changing it is allowed as long - as the name is changed. - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. You just DO WHAT THE FUCK YOU WANT TO. - -License of media (textures): ----------------------------- -Created by PilzAdam (License: WTFPL): - farming_bread.png - farming_soil.png - farming_soil_wet.png - farming_soil_wet_side.png - farming_string.png - -Created by Calinou (License: CC BY-SA): - farming_tool_bronzehoe.png - farming_tool_steelhoe.png - farming_tool_stonehoe.png - farming_tool_woodhoe.png - -Created by VanessaE (License: WTFPL): - farming_cotton_seed.png - farming_wheat_seed.png - farming_flour.png - farming_wheat.png - farming_wheat_1.png - farming_wheat_2.png - farming_wheat_3.png - farming_wheat_4.png - farming_wheat_5.png - farming_wheat_5.png - farming_wheat_7.png - farming_wheat_8.png - farming_cotton_1.png - farming_cotton_2.png - farming_cotton_3.png - farming_cotton_4.png - farming_cotton_5.png - farming_cotton_6.png - farming_cotton_7.png - farming_cotton_8.png diff --git a/mods/farming/depends.txt b/mods/farming/depends.txt deleted file mode 100644 index 470ec30..0000000 --- a/mods/farming/depends.txt +++ /dev/null @@ -1,2 +0,0 @@ -default -wool diff --git a/mods/farming/init.lua b/mods/farming/init.lua deleted file mode 100644 index 061aae8..0000000 --- a/mods/farming/init.lua +++ /dev/null @@ -1,506 +0,0 @@ --- Minetest 0.4 mod: farming --- See README.txt for licensing and other information. - -farming = {} - --- --- Soil --- -minetest.register_node("farming:soil", { - description = "Soil", - tiles = {"farming_soil.png", "default_dirt.png"}, - drop = "default:dirt", - is_ground_content = true, - groups = {crumbly=3, not_in_creative_inventory=1, soil=2}, - sounds = default.node_sound_dirt_defaults(), -}) - -minetest.register_node("farming:soil_wet", { - description = "Wet Soil", - tiles = {"farming_soil_wet.png", "farming_soil_wet_side.png"}, - drop = "default:dirt", - is_ground_content = true, - groups = {crumbly=3, not_in_creative_inventory=1, soil=3}, - sounds = default.node_sound_dirt_defaults(), -}) - -minetest.register_abm({ - nodenames = {"farming:soil", "farming:soil_wet"}, - interval = 15, - chance = 4, - action = function(pos, node) - if abm_limiter() then return end - pos.y = pos.y+1 - local nn = minetest.get_node(pos).name - pos.y = pos.y-1 - if minetest.registered_nodes[nn] and - minetest.registered_nodes[nn].walkable and - minetest.get_item_group(nn, "plant") == 0 - then - minetest.set_node(pos, {name="default:dirt"}) - end - -- check if there is water nearby - if minetest.find_node_near(pos, 3, {"group:water"}) then - -- if it is dry soil turn it into wet soil - if node.name == "farming:soil" then - minetest.set_node(pos, {name="farming:soil_wet"}) - end - else - -- turn it back into dirt if it is already dry - if node.name == "farming:soil" then - -- only turn it back if there is no plant on top of it - if minetest.get_item_group(nn, "plant") == 0 then - minetest.set_node(pos, {name="default:dirt"}) - end - - -- if its wet turn it back into dry soil - elseif node.name == "farming:soil_wet" then - minetest.set_node(pos, {name="farming:soil"}) - end - end - end, -}) - --- --- Hoes --- --- turns nodes with group soil=1 into soil -function farming.hoe_on_use(itemstack, user, pointed_thing, uses) - local pt = pointed_thing - -- check if pointing at a node - if not pt then - return - end - if pt.type ~= "node" then - return - end - - local under = minetest.get_node(pt.under) - local p = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z} - local above = minetest.get_node(p) - - -- return if any of the nodes is not registered - if not minetest.registered_nodes[under.name] then - return - end - if not minetest.registered_nodes[above.name] then - return - end - - -- check if the node above the pointed thing is air - if above.name ~= "air" then - return - end - - -- check if pointing at dirt - if minetest.get_item_group(under.name, "soil") ~= 1 then - return - end - - -- turn the node into soil, wear out item and play sound - minetest.set_node(pt.under, {name="farming:soil"}) - minetest.sound_play("default_dig_crumbly", { - pos = pt.under, - gain = 0.5, - }) - itemstack:add_wear(65535/(uses-1)) - return itemstack -end - -minetest.register_tool("farming:hoe_wood", { - description = "Wooden Hoe", - inventory_image = "farming_tool_woodhoe.png", - - on_use = function(itemstack, user, pointed_thing) - return farming.hoe_on_use(itemstack, user, pointed_thing, 30) - end, -}) - -minetest.register_tool("farming:hoe_stone", { - description = "Stone Hoe", - inventory_image = "farming_tool_stonehoe.png", - - on_use = function(itemstack, user, pointed_thing) - return farming.hoe_on_use(itemstack, user, pointed_thing, 90) - end, -}) - -minetest.register_tool("farming:hoe_steel", { - description = "Steel Hoe", - inventory_image = "farming_tool_steelhoe.png", - - on_use = function(itemstack, user, pointed_thing) - return farming.hoe_on_use(itemstack, user, pointed_thing, 200) - end, -}) - -minetest.register_tool("farming:hoe_bronze", { - description = "Bronze Hoe", - inventory_image = "farming_tool_bronzehoe.png", - - on_use = function(itemstack, user, pointed_thing) - return farming.hoe_on_use(itemstack, user, pointed_thing, 220) - end, -}) - -minetest.register_craft({ - output = "farming:hoe_wood", - recipe = { - {"group:wood", "group:wood"}, - {"", "group:stick"}, - {"", "group:stick"}, - } -}) - -minetest.register_craft({ - output = "farming:hoe_stone", - recipe = { - {"group:stone", "group:stone"}, - {"", "group:stick"}, - {"", "group:stick"}, - } -}) - -minetest.register_craft({ - output = "farming:hoe_steel", - recipe = { - {"default:steel_ingot", "default:steel_ingot"}, - {"", "group:stick"}, - {"", "group:stick"}, - } -}) - -minetest.register_craft({ - output = "farming:hoe_bronze", - recipe = { - {"default:bronze_ingot", "default:bronze_ingot"}, - {"", "group:stick"}, - {"", "group:stick"}, - } -}) - --- --- Override grass for drops --- -minetest.register_node(":default:grass_1", { - description = "Grass", - drawtype = "plantlike", - tiles = {"default_grass_1.png"}, - -- use a bigger inventory image - inventory_image = "default_grass_3.png", - wield_image = "default_grass_3.png", - paramtype = "light", - waving = 1, - walkable = false, - buildable_to = true, - drop = { - max_items = 1, - items = { - {items = {'farming:seed_wheat'},rarity = 5}, - {items = {'default:grass_1'}}, - } - }, - groups = {snappy=3,flammable=3,flora=1,attached_node=1}, - sounds = default.node_sound_leaves_defaults(), - selection_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, - }, - on_place = function(itemstack, placer, pointed_thing) - -- place a random grass node - local stack = ItemStack("default:grass_"..math.random(1,5)) - local ret = minetest.item_place(stack, placer, pointed_thing) - return ItemStack("default:grass_1 "..itemstack:get_count()-(1-ret:get_count())) - end, -}) - -for i=2,5 do - minetest.register_node(":default:grass_"..i, { - description = "Grass", - drawtype = "plantlike", - tiles = {"default_grass_"..i..".png"}, - inventory_image = "default_grass_"..i..".png", - wield_image = "default_grass_"..i..".png", - paramtype = "light", - waving = 1, - walkable = false, - buildable_to = true, - is_ground_content = true, - drop = { - max_items = 1, - items = { - {items = {'farming:seed_wheat'},rarity = 5}, - {items = {'default:grass_1'}}, - } - }, - groups = {snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1}, - sounds = default.node_sound_leaves_defaults(), - selection_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, - }, - }) -end - -minetest.register_node(":default:junglegrass", { - description = "Jungle Grass", - drawtype = "plantlike", - visual_scale = 1.3, - tiles = {"default_junglegrass.png"}, - inventory_image = "default_junglegrass.png", - wield_image = "default_junglegrass.png", - paramtype = "light", - waving = 1, - walkable = false, - buildable_to = true, - is_ground_content = true, - drop = { - max_items = 1, - items = { - {items = {'farming:seed_cotton'},rarity = 8}, - {items = {'default:junglegrass'}}, - } - }, - groups = {snappy=3,flammable=2,flora=1,attached_node=1}, - sounds = default.node_sound_leaves_defaults(), - selection_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, - }, -}) - --- --- Place seeds --- -local function place_seed(itemstack, placer, pointed_thing, plantname) - local pt = pointed_thing - -- check if pointing at a node - if not pt then - return - end - if pt.type ~= "node" then - return - end - - local under = minetest.get_node(pt.under) - local above = minetest.get_node(pt.above) - - -- return if any of the nodes is not registered - if not minetest.registered_nodes[under.name] then - return - end - if not minetest.registered_nodes[above.name] then - return - end - - -- check if pointing at the top of the node - if pt.above.y ~= pt.under.y+1 then - return - end - - -- check if you can replace the node above the pointed node - if not minetest.registered_nodes[above.name].buildable_to then - return - end - - -- check if pointing at soil - if minetest.get_item_group(under.name, "soil") <= 1 then - return - end - - -- add the node and remove 1 item from the itemstack - minetest.add_node(pt.above, {name=plantname}) - if not minetest.setting_getbool("creative_mode") then - itemstack:take_item() - end - return itemstack -end - --- --- Wheat --- -minetest.register_craftitem("farming:seed_wheat", { - description = "Wheat Seed", - inventory_image = "farming_wheat_seed.png", - on_place = function(itemstack, placer, pointed_thing) - return place_seed(itemstack, placer, pointed_thing, "farming:wheat_1") - end, - ground = "farming:flour", -}) - -minetest.register_craftitem("farming:wheat", { - description = "Wheat", - inventory_image = "farming_wheat.png", -}) - -minetest.register_craftitem("farming:flour", { - description = "Flour", - inventory_image = "farming_flour.png", -}) - -minetest.register_craftitem("farming:bread", { - description = "Bread", - inventory_image = "farming_bread.png", - on_use = minetest.item_eat(4), -}) - -minetest.register_craft({ - type = "shapeless", - output = "farming:flour", - recipe = {"farming:wheat", "farming:wheat", "farming:wheat", "farming:wheat"} -}) - -minetest.register_craft({ - type = "cooking", - cooktime = 15, - output = "farming:bread", - recipe = "farming:flour" -}) - -for i=1,8 do - local drop = { - items = { - {items = {'farming:wheat'},rarity=9-i}, - {items = {'farming:wheat'},rarity=18-i*2}, - {items = {'farming:seed_wheat'},rarity=9-i}, - {items = {'farming:seed_wheat'},rarity=18-i*2}, - } - } - minetest.register_node("farming:wheat_"..i, { - drawtype = "plantlike", - tiles = {"farming_wheat_"..i..".png"}, - paramtype = "light", - waving = 1, - 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 = {snappy=3,flammable=2,plant=1,wheat=i,not_in_creative_inventory=1,attached_node=1}, - sounds = default.node_sound_leaves_defaults(), - }) -end - -minetest.register_abm({ - nodenames = {"group:wheat"}, - neighbors = {"group:soil"}, - interval = 90, - chance = 2, - action = function(pos, node) - if abm_limiter() then return end - -- return if already full grown - if minetest.get_item_group(node.name, "wheat") == 8 then - return - end - - -- check if on wet soil - pos.y = pos.y-1 - local n = minetest.get_node(pos) - if minetest.get_item_group(n.name, "soil") < 3 then - return - end - pos.y = pos.y+1 - - -- check light - if not minetest.get_node_light(pos) then - return - end - if minetest.get_node_light(pos) < 13 then - return - end - - -- grow - local height = minetest.get_item_group(node.name, "wheat") + 1 - minetest.set_node(pos, {name="farming:wheat_"..height}) - end -}) - --- --- Cotton --- -minetest.register_craftitem("farming:seed_cotton", { - description = "Cotton Seed", - inventory_image = "farming_cotton_seed.png", - on_place = function(itemstack, placer, pointed_thing) - return place_seed(itemstack, placer, pointed_thing, "farming:cotton_1") - end, -}) - -minetest.register_craftitem("farming:string", { - description = "String", - inventory_image = "farming_string.png", -}) - -minetest.register_craft({ - output = "wool:white", - recipe = { - {"farming:string", "farming:string"}, - {"farming:string", "farming:string"}, - } -}) - -for i=1,8 do - local drop = { - items = { - {items = {'farming:string'},rarity=9-i}, - {items = {'farming:string'},rarity=18-i*2}, - {items = {'farming:string'},rarity=27-i*3}, - {items = {'farming:seed_cotton'},rarity=9-i}, - {items = {'farming:seed_cotton'},rarity=18-i*2}, - {items = {'farming:seed_cotton'},rarity=27-i*3}, - } - } - minetest.register_node("farming:cotton_"..i, { - drawtype = "plantlike", - tiles = {"farming_cotton_"..i..".png"}, - paramtype = "light", - waving = 1, - 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 = {snappy=3,flammable=2,plant=1,cotton=i,not_in_creative_inventory=1,attached_node=1}, - sounds = default.node_sound_leaves_defaults(), - }) -end - -minetest.register_abm({ - nodenames = {"group:cotton"}, - neighbors = {"group:soil"}, - interval = 80, - chance = 2, - action = function(pos, node) - if abm_limiter() then return end - -- return if already full grown - if minetest.get_item_group(node.name, "cotton") == 8 then - return - end - - -- check if on wet soil - pos.y = pos.y-1 - local n = minetest.get_node(pos) - if minetest.get_item_group(n.name, "soil") < 3 then - return - end - pos.y = pos.y+1 - - -- check light - if not minetest.get_node_light(pos) then - return - end - if minetest.get_node_light(pos) < 13 then - return - end - - -- grow - local height = minetest.get_item_group(node.name, "cotton") + 1 - minetest.set_node(pos, {name="farming:cotton_"..height}) - end -}) diff --git a/mods/farming_plus/README.txt b/mods/farming_plus/README.txt index c7c6751..b92e0be 100644 --- a/mods/farming_plus/README.txt +++ b/mods/farming_plus/README.txt @@ -1,14 +1,11 @@ -===FARMING_PLUS MOD for MINETEST=== -by PilzAdam +Minetest 0.4 mod: farming +========================= -License: -Sourcecode: WTFPL (see below) -Graphics: WTFPL (see below) +License of source code: +----------------------- +Copyright (C) 2012-2013 PilzAdam -See also: -http://minetest.net/ - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2004 Sam Hocevar @@ -21,3 +18,40 @@ http://minetest.net/ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. You just DO WHAT THE FUCK YOU WANT TO. + +License of media (textures): +---------------------------- +Created by PilzAdam (License: WTFPL): + farming_bread.png + farming_soil.png + farming_soil_wet.png + farming_soil_wet_side.png + farming_string.png + +Created by Calinou (License: CC BY-SA): + farming_tool_bronzehoe.png + farming_tool_steelhoe.png + farming_tool_stonehoe.png + farming_tool_woodhoe.png + +Created by VanessaE (License: WTFPL): + farming_cotton_seed.png + farming_wheat_seed.png + farming_flour.png + farming_wheat.png + farming_wheat_1.png + farming_wheat_2.png + farming_wheat_3.png + farming_wheat_4.png + farming_wheat_5.png + farming_wheat_5.png + farming_wheat_7.png + farming_wheat_8.png + farming_cotton_1.png + farming_cotton_2.png + farming_cotton_3.png + farming_cotton_4.png + farming_cotton_5.png + farming_cotton_6.png + farming_cotton_7.png + farming_cotton_8.png diff --git a/mods/farming_plus/aliases.lua b/mods/farming_plus/aliases.lua new file mode 100644 index 0000000..fd7bdb0 --- /dev/null +++ b/mods/farming_plus/aliases.lua @@ -0,0 +1,19 @@ +minetest.register_alias("farming:wheat","farming_plus:wheat") + +minetest.register_alias("farming:string","farming_plus:string") +minetest.register_alias("farming:bread","farming_plus:bread") +minetest.register_alias("farming:flour","farming_plus:flour") +minetest.register_alias("farming:seed_wheat","farming_plus:seed_wheat") +minetest.register_alias("farming:seed_cotton","farming_plus:seed_cotton") + +minetest.register_alias("farming:soil","farming_plus:soil") +minetest.register_alias("farming:soil_wet","farming_plus:soil_wet") + +minetest.register_alias("farming:hoe_steel","farming_plus:hoe_steel") +minetest.register_alias("farming:hoe_stone","farming_plus:hoe_stone") +minetest.register_alias("farming:hoe_bronze","farming_plus:hoe_bronze") + +for i=1,8 do + minetest.register_alias("farming:wheat_"..i,"farming_plus:wheat_"..i) + minetest.register_alias("farming:cotton_"..i,"farming_plus:cotton_"..i) +end \ No newline at end of file diff --git a/mods/farming_plus/carrots.lua b/mods/farming_plus/carrots.lua index 1133dde..6884fda 100644 --- a/mods/farming_plus/carrots.lua +++ b/mods/farming_plus/carrots.lua @@ -13,6 +13,8 @@ minetest.register_craftitem("farming_plus:carrot_seed", { minetest.register_node("farming_plus:carrot_1", { paramtype = "light", walkable = false, + buildable_to = true, + floodable = true, drawtype = "plantlike", drop = "", tiles = {"farming_carrot_1.png"}, @@ -31,6 +33,8 @@ minetest.register_node("farming_plus:carrot_2", { walkable = false, drawtype = "plantlike", drop = "", + buildable_to = true, + floodable = true, tiles = {"farming_carrot_2.png"}, selection_box = { type = "fixed", @@ -45,6 +49,8 @@ minetest.register_node("farming_plus:carrot_2", { minetest.register_node("farming_plus:carrot_3", { paramtype = "light", walkable = false, + buildable_to = true, + floodable = true, drawtype = "plantlike", drop = "", tiles = {"farming_carrot_3.png"}, @@ -61,6 +67,8 @@ minetest.register_node("farming_plus:carrot_3", { minetest.register_node("farming_plus:carrot", { paramtype = "light", walkable = false, + buildable_to = true, + floodable = true, drawtype = "plantlike", tiles = {"farming_carrot_4.png"}, drop = { @@ -84,4 +92,4 @@ minetest.register_craftitem("farming_plus:carrot_item", { on_use = minetest.item_eat(3), }) -farming:add_plant("farming_plus:carrot", {"farming_plus:carrot_1", "farming_plus:carrot_2", "farming_plus:carrot_3"}, 50, 20) +farming:add_plant("farming_plus:carrot", {"farming_plus:carrot_1", "farming_plus:carrot_2", "farming_plus:carrot_3"}, 900, 1) diff --git a/mods/farming_plus/cotton.lua b/mods/farming_plus/cotton.lua new file mode 100644 index 0000000..6f4ba7b --- /dev/null +++ b/mods/farming_plus/cotton.lua @@ -0,0 +1,57 @@ +-- +-- Cotton +-- +minetest.register_craftitem("farming_plus:seed_cotton", { + description = "Cotton Seed", + inventory_image = "farming_cotton_seed.png", + on_place = function(itemstack, placer, pointed_thing) + return farming:place_seed(itemstack, placer, pointed_thing, "farming_plus:cotton_1") + end, +}) + +minetest.register_craftitem("farming_plus:string", { + description = "String", + inventory_image = "farming_string.png", +}) + +minetest.register_craft({ + output = "wool:white", + recipe = { + {"farming_plus:string", "farming_plus:string"}, + {"farming_plus:string", "farming_plus:string"}, + } +}) + +local nodes = {} +for i=1,8 do + local drop = { + items = { + {items = {'farming_plus:string'},rarity=9-i}, + {items = {'farming_plus:string'},rarity=18-i*2}, + {items = {'farming_plus:string'},rarity=27-i*3}, + {items = {'farming_plus:seed_cotton'},rarity=9-i}, + {items = {'farming_plus:seed_cotton'},rarity=18-i*2}, + {items = {'farming_plus:seed_cotton'},rarity=27-i*3}, + } + } + minetest.register_node("farming_plus:cotton_"..i, { + drawtype = "plantlike", + tiles = {"farming_cotton_"..i..".png"}, + paramtype = "light", + waving = 1, + walkable = false, + buildable_to = true, + floodable = 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 = {snappy=3,flammable=2,plant=1,cotton=i,not_in_creative_inventory=1,attached_node=1}, + sounds = default.node_sound_leaves_defaults(), + }) + table.insert(nodes,"farming_plus:cotton_"..i) +end + +farming:add_plant("farming_plus:cotton_8",nodes,1100,1) diff --git a/mods/farming_plus/depends.txt b/mods/farming_plus/depends.txt index 657056a..470ec30 100644 --- a/mods/farming_plus/depends.txt +++ b/mods/farming_plus/depends.txt @@ -1,3 +1,2 @@ default -farming -intllib? +wool diff --git a/mods/farming_plus/functions.lua b/mods/farming_plus/functions.lua new file mode 100644 index 0000000..d2bff2b --- /dev/null +++ b/mods/farming_plus/functions.lua @@ -0,0 +1,199 @@ +function farming:place_seed(itemstack, placer, pointed_thing, plantname) + + -- Call on_rightclick if the pointed node defines it + if pointed_thing.type == "node" and placer and + not placer:get_player_control().sneak then + local n = minetest.get_node(pointed_thing.under) + local nn = n.name + if minetest.registered_nodes[nn] and minetest.registered_nodes[nn].on_rightclick then + return minetest.registered_nodes[nn].on_rightclick(pointed_thing.under, n, + placer, itemstack, pointed_thing) or itemstack, false + end + end + + local pt = pointed_thing + -- check if pointing at a node + if not pt then + return + end + if pt.type ~= "node" then + return + end + + local under = minetest.get_node(pt.under) + local above = minetest.get_node(pt.above) + + -- return if any of the nodes is not registered + if not minetest.registered_nodes[under.name] then + return + end + if not minetest.registered_nodes[above.name] then + return + end + + -- check if pointing at the top of the node + if pt.above.y ~= pt.under.y+1 then + return + end + + -- check if you can replace the node above the pointed node + if not minetest.registered_nodes[above.name].buildable_to then + return + end + + -- check if pointing at soil + if minetest.get_item_group(under.name, "soil") <= 1 then + return + end + + -- add the node and remove 1 item from the itemstack + minetest.add_node(pt.above, {name=plantname}) + if not minetest.setting_getbool("creative_mode") then + itemstack:take_item() + end + return itemstack +end + +function farming:add_plant(full_grown, names, interval, chance) + minetest.register_abm({ + nodenames = names, + neighbors = {"group:soil"}, + interval = interval, + chance = chance, + action = function(pos, node) + if not minetest.get_node_light(pos,0.5) then + return + end + if minetest.get_node_light(pos,0.5) < 8 then + return + end + local step = nil + for i,name in pairs(names) do + if name == node.name then + step = i + break + end + end + if step == nil then + return + end + + pos.y = pos.y-1 + local n = minetest.get_node(pos) + if minetest.get_item_group(n.name, "soil") < 3 then + if step > 1 and randomChance(30) then + step = step - 2 + else + return + end + end + pos.y = pos.y + 1 + local new_node = {name=names[step+1]} + if new_node.name == nil then + new_node.name = full_grown + end + minetest.set_node(pos, new_node) + end + }) + + table.insert(farming.registered_plants, { + full_grown = full_grown, + names = names, + interval = interval, + chance = chance, + }) +end + +function farming:generate_tree(pos, trunk, leaves, underground, replacements) + pos.y = pos.y-1 + local nodename = minetest.get_node(pos).name + local ret = true + for _,name in pairs(underground) do + if nodename == name then + ret = false + break + end + end + pos.y = pos.y+1 + if not minetest.get_node_light(pos,0.5) then + return + end + if ret or minetest.get_node_light(pos,0.5) < 8 then + return + end + + node = {name = ""} + for dy=1,4 do + pos.y = pos.y+dy + if minetest.get_node(pos).name ~= "air" then + return + end + pos.y = pos.y-dy + end + node.name = trunk + for dy=0,4 do + pos.y = pos.y+dy + minetest.set_node(pos, node) + pos.y = pos.y-dy + end + + if not replacements then + replacements = {} + end + + node.name = leaves + pos.y = pos.y+3 + for dx=-2,2 do + for dz=-2,2 do + for dy=0,3 do + pos.x = pos.x+dx + pos.y = pos.y+dy + pos.z = pos.z+dz + + if dx == 0 and dz == 0 and dy==3 then + if minetest.get_node(pos).name == "air" and math.random(1, 5) <= 4 then + minetest.set_node(pos, node) + for name,rarity in pairs(replacements) do + if math.random(1, rarity) == 1 then + minetest.set_node(pos, {name=name}) + end + end + end + elseif dx == 0 and dz == 0 and dy==4 then + if minetest.get_node(pos).name == "air" and math.random(1, 5) <= 4 then + minetest.set_node(pos, node) + for name,rarity in pairs(replacements) do + if math.random(1, rarity) == 1 then + minetest.set_node(pos, {name=name}) + end + end + end + elseif math.abs(dx) ~= 2 and math.abs(dz) ~= 2 then + if minetest.get_node(pos).name == "air" then + minetest.set_node(pos, node) + for name,rarity in pairs(replacements) do + if math.random(1, rarity) == 1 then + minetest.set_node(pos, {name=name}) + end + end + end + else + if math.abs(dx) ~= 2 or math.abs(dz) ~= 2 then + if minetest.get_node(pos).name == "air" and math.random(1, 5) <= 4 then + minetest.set_node(pos, node) + for name,rarity in pairs(replacements) do + if math.random(1, rarity) == 1 then + minetest.set_node(pos, {name=name}) + end + end + end + end + end + + pos.x = pos.x-dx + pos.y = pos.y-dy + pos.z = pos.z-dz + end + end + end +end \ No newline at end of file diff --git a/mods/farming_plus/grass.lua b/mods/farming_plus/grass.lua new file mode 100644 index 0000000..e10ca33 --- /dev/null +++ b/mods/farming_plus/grass.lua @@ -0,0 +1,89 @@ +minetest.register_node(":default:grass_1", { + description = "Grass", + drawtype = "plantlike", + tiles = {"default_grass_1.png"}, + -- use a bigger inventory image + inventory_image = "default_grass_3.png", + wield_image = "default_grass_3.png", + paramtype = "light", + waving = 1, + walkable = false, + buildable_to = true, + floodable = true, + drop = { + max_items = 1, + items = { + {items = {'farming_plus:seed_wheat'},rarity = 5}, + {items = {'default:grass_1'}}, + } + }, + groups = {snappy=3,flammable=3,flora=1,attached_node=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, + }, + on_place = function(itemstack, placer, pointed_thing) + -- place a random grass node + local stack = ItemStack("default:grass_"..math.random(1,5)) + local ret = minetest.item_place(stack, placer, pointed_thing) + return ItemStack("default:grass_1 "..itemstack:get_count()-(1-ret:get_count())) + end, +}) + +for i=2,5 do + minetest.register_node(":default:grass_"..i, { + description = "Grass", + drawtype = "plantlike", + tiles = {"default_grass_"..i..".png"}, + inventory_image = "default_grass_"..i..".png", + wield_image = "default_grass_"..i..".png", + paramtype = "light", + waving = 1, + walkable = false, + buildable_to = true, + floodable = true, + is_ground_content = true, + drop = { + max_items = 1, + items = { + {items = {'farming_plus:seed_wheat'},rarity = 5}, + {items = {'default:grass_1'}}, + } + }, + groups = {snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, + }, + }) +end + +minetest.register_node(":default:junglegrass", { + description = "Jungle Grass", + drawtype = "plantlike", + visual_scale = 1.3, + tiles = {"default_junglegrass.png"}, + inventory_image = "default_junglegrass.png", + wield_image = "default_junglegrass.png", + paramtype = "light", + waving = 1, + walkable = false, + buildable_to = true, + floodable = true, + is_ground_content = true, + drop = { + max_items = 1, + items = { + {items = {'farming_plus:seed_cotton'},rarity = 8}, + {items = {'default:junglegrass'}}, + } + }, + groups = {snappy=3,flammable=2,flora=1,attached_node=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, + }, +}) \ No newline at end of file diff --git a/mods/farming_plus/init.lua b/mods/farming_plus/init.lua index a55269a..e4dffcb 100644 --- a/mods/farming_plus/init.lua +++ b/mods/farming_plus/init.lua @@ -1,3 +1,8 @@ +-- Minetest 0.4 mod: farming +-- See README.txt for licensing and other information. + +farming = {} + farming.registered_plants = {} -- Boilerplate to support localized strings if intllib mod is installed. @@ -8,146 +13,8 @@ else farming.S = function ( s ) return s end end -function farming:add_plant(full_grown, names, interval, chance) - minetest.register_abm({ - nodenames = names, - interval = interval, - chance = chance, - action = function(pos, node) - if abm_limiter() then return end - pos.y = pos.y-1 - if minetest.get_node(pos).name ~= "farming:soil_wet" then - return - end - pos.y = pos.y+1 - if not minetest.get_node_light(pos) then - return - end - if minetest.get_node_light(pos) < 8 then - return - end - local step = nil - for i,name in pairs(names) do - if name == node.name then - step = i - break - end - end - if step == nil then - return - end - local new_node = {name=names[step+1]} - if new_node.name == nil then - new_node.name = full_grown - end - minetest.set_node(pos, new_node) - end - }) - - table.insert(farming.registered_plants, { - full_grown = full_grown, - names = names, - interval = interval, - chance = chance, - }) -end - -function farming:generate_tree(pos, trunk, leaves, underground, replacements) - pos.y = pos.y-1 - local nodename = minetest.get_node(pos).name - local ret = true - for _,name in pairs(underground) do - if nodename == name then - ret = false - break - end - end - pos.y = pos.y+1 - if not minetest.get_node_light(pos) then - return - end - if ret or minetest.get_node_light(pos) < 8 then - return - end - - node = {name = ""} - for dy=1,4 do - pos.y = pos.y+dy - if minetest.get_node(pos).name ~= "air" then - return - end - pos.y = pos.y-dy - end - node.name = trunk - for dy=0,4 do - pos.y = pos.y+dy - minetest.set_node(pos, node) - pos.y = pos.y-dy - end - - if not replacements then - replacements = {} - end - - node.name = leaves - pos.y = pos.y+3 - for dx=-2,2 do - for dz=-2,2 do - for dy=0,3 do - pos.x = pos.x+dx - pos.y = pos.y+dy - pos.z = pos.z+dz - - if dx == 0 and dz == 0 and dy==3 then - if minetest.get_node(pos).name == "air" and math.random(1, 5) <= 4 then - minetest.set_node(pos, node) - for name,rarity in pairs(replacements) do - if math.random(1, rarity) == 1 then - minetest.set_node(pos, {name=name}) - end - end - end - elseif dx == 0 and dz == 0 and dy==4 then - if minetest.get_node(pos).name == "air" and math.random(1, 5) <= 4 then - minetest.set_node(pos, node) - for name,rarity in pairs(replacements) do - if math.random(1, rarity) == 1 then - minetest.set_node(pos, {name=name}) - end - end - end - elseif math.abs(dx) ~= 2 and math.abs(dz) ~= 2 then - if minetest.get_node(pos).name == "air" then - minetest.set_node(pos, node) - for name,rarity in pairs(replacements) do - if math.random(1, rarity) == 1 then - minetest.set_node(pos, {name=name}) - end - end - end - else - if math.abs(dx) ~= 2 or math.abs(dz) ~= 2 then - if minetest.get_node(pos).name == "air" and math.random(1, 5) <= 4 then - minetest.set_node(pos, node) - for name,rarity in pairs(replacements) do - if math.random(1, rarity) == 1 then - minetest.set_node(pos, {name=name}) - end - end - end - end - end - - pos.x = pos.x-dx - pos.y = pos.y-dy - pos.z = pos.z-dz - end - end - end -end - farming.seeds = { - ["farming:pumpkin_seed"]=60, + ["farming_plus:pumpkin_seed"]=60, ["farming_plus:strawberry_seed"]=30, ["farming_plus:rhubarb_seed"]=30, ["farming_plus:potatoe_seed"]=30, @@ -156,144 +23,27 @@ farming.seeds = { ["farming_plus:carrot_seed"]=30, } +dofile(minetest.get_modpath("farming_plus").."/functions.lua") +-- +-- Soil +-- +dofile(minetest.get_modpath("farming_plus").."/soil.lua") --- ========= GENERATE PLANTS IN THE MAP ========= ---[[minetest.register_on_generated(function(minp, maxp, seed) - if maxp.y >= 2 and minp.y <= 0 then - -- Generate plants (code from flowers) - local perlin1 = minetest.get_perlin(974, 3, 0.6, 100) - -- Assume X and Z lengths are equal - local divlen = 16 - local divs = (maxp.x-minp.x)/divlen+1; - for divx=0,divs-1 do - for divz=0,divs-1 do - local x0 = minp.x + math.floor((divx+0)*divlen) - local z0 = minp.z + math.floor((divz+0)*divlen) - local x1 = minp.x + math.floor((divx+1)*divlen) - local z1 = minp.z + math.floor((divz+1)*divlen) - -- Determine flowers amount from perlin noise - local grass_amount = math.floor(perlin1:get2d({x=x0, y=z0}) ^ 3 * 9) - -- Find random positions for flowers based on this random - local pr = PseudoRandom(seed+456) - for i=0,grass_amount do - local x = pr:next(x0, x1) - local z = pr:next(z0, z1) - -- Find ground level (0...15) - local ground_y = nil - for y=30,0,-1 do - if minetest.get_node({x=x,y=y,z=z}).name ~= "air" then - ground_y = y - break - end - end - - if ground_y then - local p = {x=x,y=ground_y+1,z=z} - local nn = minetest.get_node(p).name - -- Check if the node can be replaced - if minetest.registered_nodes[nn] and - minetest.registered_nodes[nn].buildable_to then - nn = minetest.get_node({x=x,y=ground_y,z=z}).name - if nn == "default:dirt_with_grass" then - --local plant_choice = pr:next(1, #farming.registered_plants) - local plant_choice = math.floor(perlin1:get2d({x=x,y=z})*(#farming.registered_plants)) - local plant = farming.registered_plants[plant_choice] - if plant then - minetest.set_node(p, {name=plant.full_grown}) - end - end - end - end - - end - end - end - end -end)]] +-- +-- Hoes +-- +dofile(minetest.get_modpath("farming_plus").."/tools.lua") -function farming:place_seed(itemstack, placer, pointed_thing, plantname) +-- +-- Override grass for drops +-- +dofile(minetest.get_modpath("farming_plus").."/grass.lua") - -- Call on_rightclick if the pointed node defines it - if pointed_thing.type == "node" and placer and - not placer:get_player_control().sneak then - local n = minetest.get_node(pointed_thing.under) - local nn = n.name - if minetest.registered_nodes[nn] and minetest.registered_nodes[nn].on_rightclick then - return minetest.registered_nodes[nn].on_rightclick(pointed_thing.under, n, - placer, itemstack, pointed_thing) or itemstack, false - end - end +-- ========= WHEAT ========= +dofile(minetest.get_modpath("farming_plus").."/wheat.lua") - local pt = pointed_thing - -- check if pointing at a node - if not pt then - return - end - if pt.type ~= "node" then - return - end - - local under = minetest.get_node(pt.under) - local above = minetest.get_node(pt.above) - - -- return if any of the nodes is not registered - if not minetest.registered_nodes[under.name] then - return - end - if not minetest.registered_nodes[above.name] then - return - end - - -- check if pointing at the top of the node - if pt.above.y ~= pt.under.y+1 then - return - end - - -- check if you can replace the node above the pointed node - if not minetest.registered_nodes[above.name].buildable_to then - return - end - - -- check if pointing at soil - if minetest.get_item_group(under.name, "soil") <= 1 then - return - end - - -- add the node and remove 1 item from the itemstack - minetest.add_node(pt.above, {name=plantname}) - if not minetest.setting_getbool("creative_mode") then - itemstack:take_item() - end - return itemstack -end - --- ========= ALIASES FOR FARMING MOD BY SAPIER ========= --- potatoe -> potatoe -minetest.register_alias("farming:potatoe_node", "farming_plus:potatoe") ---minetest.register_alias("farming:potatoe", "farming:potatoe_item") cant do this -minetest.register_alias("farming:potatoe_straw", "farming_plus:potatoe") -minetest.register_alias("farming:seed_potatoe", "farming_plus:potatoe_seed") -for lvl = 1, 6, 1 do - minetest.register_entity(":farming:potatoe_lvl"..lvl, { - on_activate = function(self, staticdata) - minetest.set_node(self.object:getpos(), {name="farming_plus:potatoe_1"}) - end - }) -end - - -minetest.register_alias("farming:cotton", "farming:cotton_3") -minetest.register_alias("farming:wheat_harvested", "farming:wheat") -minetest.register_alias("farming:dough", "farming:flour") -minetest.register_abm({ - nodenames = {"farming:wheat"}, - interval = 1, - chance = 1, - action = function(pos) - if abm_limiter() then return end - minetest.set_node(pos, {name="farming:wheat_8"}) - end, -}) +-- ========= COTTON ========= +dofile(minetest.get_modpath("farming_plus").."/cotton.lua") -- ========= STRAWBERRIES ========= dofile(minetest.get_modpath("farming_plus").."/strawberries.lua") @@ -324,3 +74,8 @@ dofile(minetest.get_modpath("farming_plus").."/pumpkin.lua") -- ========= WEED ========= dofile(minetest.get_modpath("farming_plus").."/weed.lua") + + +dofile(minetest.get_modpath("farming_plus").."/aliases.lua") + + diff --git a/mods/farming_plus/potatoes.lua b/mods/farming_plus/potatoes.lua index 51600f3..e7c792d 100644 --- a/mods/farming_plus/potatoes.lua +++ b/mods/farming_plus/potatoes.lua @@ -13,6 +13,8 @@ minetest.register_craftitem("farming_plus:potato_seed", { minetest.register_node("farming_plus:potato_1", { paramtype = "light", walkable = false, + buildable_to = true, + floodable = true, drawtype = "plantlike", drop = "", tiles = {"farming_potato_1.png"}, @@ -29,6 +31,8 @@ minetest.register_node("farming_plus:potato_1", { minetest.register_node("farming_plus:potato_2", { paramtype = "light", walkable = false, + buildable_to = true, + floodable = true, drawtype = "plantlike", drop = "", tiles = {"farming_potato_2.png"}, @@ -45,6 +49,8 @@ minetest.register_node("farming_plus:potato_2", { minetest.register_node("farming_plus:potato", { paramtype = "light", walkable = false, + buildable_to = true, + floodable = true, drawtype = "plantlike", tiles = {"farming_potato_3.png"}, drop = { @@ -67,7 +73,7 @@ minetest.register_craftitem("farming_plus:potato_item", { inventory_image = "farming_potato.png", }) -farming:add_plant("farming_plus:potato", {"farming_plus:potato_1", "farming_plus:potato_2"}, 50, 20) +farming:add_plant("farming_plus:potato", {"farming_plus:potato_1", "farming_plus:potato_2"}, 475, 1) minetest.register_alias("farming_plus:potatoe_item", "farming_plus:potato_item") minetest.register_alias("farming_plus:potatoe_seed", "farming_plus:potato_seed") diff --git a/mods/farming_plus/pumpkin.lua b/mods/farming_plus/pumpkin.lua index 1c39c64..660da99 100644 --- a/mods/farming_plus/pumpkin.lua +++ b/mods/farming_plus/pumpkin.lua @@ -2,18 +2,19 @@ local S S = farming.S -minetest.register_craftitem(":farming:pumpkin_seed", { +minetest.register_craftitem(":farming_plus:pumpkin_seed", { description = S("Pumpkin Seed"), inventory_image = "farming_pumpkin_seed.png", on_place = function(itemstack, placer, pointed_thing) - return farming:place_seed(itemstack, placer, pointed_thing, "farming:pumpkin_1") + return farming:place_seed(itemstack, placer, pointed_thing, "farming_plus:pumpkin_1") end }) -minetest.register_node(":farming:pumpkin_1", { +minetest.register_node(":farming_plus:pumpkin_1", { paramtype = "light", sunlight_propagates = true, drawtype = "nodebox", + floodable = true, drop = "", tiles = {"farming_pumpkin_top.png", "farming_pumpkin_top.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png"}, node_box = { @@ -32,9 +33,10 @@ minetest.register_node(":farming:pumpkin_1", { sounds = default.node_sound_wood_defaults(), }) -minetest.register_node(":farming:pumpkin_2", { +minetest.register_node(":farming_plus:pumpkin_2", { paramtype = "light", sunlight_propagates = true, + floodable = true, drawtype = "nodebox", drop = "", tiles = {"farming_pumpkin_top.png", "farming_pumpkin_top.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png"}, @@ -54,9 +56,10 @@ minetest.register_node(":farming:pumpkin_2", { sounds = default.node_sound_wood_defaults(), }) -minetest.register_node(":farming:pumpkin", { +minetest.register_node(":farming_plus:pumpkin", { description = S("Pumpkin"), paramtype2 = "facedir", + floodable = true, tiles = {"farming_pumpkin_top.png", "farming_pumpkin_top.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png"}, groups = {choppy=2, oddly_breakable_by_hand=2, flammable=2, plant=1}, sounds = default.node_sound_wood_defaults(), @@ -64,19 +67,19 @@ minetest.register_node(":farming:pumpkin", { on_punch = function(pos, node, puncher) local tool = puncher:get_wielded_item():get_name() if tool and string.match(tool, "sword") then - node.name = "farming:pumpkin_face" + node.name = "farming_plus:pumpkin_face" minetest.set_node(pos, node) - puncher:get_inventory():add_item("main", ItemStack("farming:pumpkin_seed")) + puncher:get_inventory():add_item("main", ItemStack("farming_plus:pumpkin_seed")) if math.random(1, 5) == 1 then - puncher:get_inventory():add_item("main", ItemStack("farming:pumpkin_seed")) + puncher:get_inventory():add_item("main", ItemStack("farming_plus:pumpkin_seed")) end end end }) -farming:add_plant("farming:pumpkin", {"farming:pumpkin_1", "farming:pumpkin_2"}, 80, 20) +farming:add_plant("farming_plus:pumpkin", {"farming_plus:pumpkin_1", "farming_plus:pumpkin_2"}, 375, 1) -minetest.register_node(":farming:pumpkin_face", { +minetest.register_node(":farming_plus:pumpkin_face", { description = S("Pumpkin Face"), paramtype2 = "facedir", tiles = {"farming_pumpkin_top.png", "farming_pumpkin_top.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_face.png"}, @@ -84,7 +87,7 @@ minetest.register_node(":farming:pumpkin_face", { sounds = default.node_sound_wood_defaults(), }) -minetest.register_node(":farming:pumpkin_face_light", { +minetest.register_node(":farming_plus:pumpkin_face_light", { description = S("Pumpkin Face With Light"), paramtype2 = "facedir", light_source = LIGHT_MAX-2, @@ -95,12 +98,12 @@ minetest.register_node(":farming:pumpkin_face_light", { minetest.register_craft({ type = "shapeless", - output = "farming:pumpkin_face_light", - recipe = {"farming:pumpkin_face", "default:torch"} + output = "farming_plus:pumpkin_face_light", + recipe = {"farming_plus:pumpkin_face", "default:torch"} }) -- ========= BIG PUMPKIN ========= -minetest.register_node(":farming:big_pumpkin", { +minetest.register_node(":farming_plus:big_pumpkin", { description = S("Big Pumpkin"), paramtype2 = "facedir", tiles = {"farming_pumpkin_big_side.png"}, @@ -129,7 +132,7 @@ minetest.register_node(":farming:big_pumpkin", { minetest.after(0.1, function(placer) local inv = placer:get_inventory() local index = placer:get_wield_index() - inv:set_stack("main", index, ItemStack("farming:big_pumpkin")) + inv:set_stack("main", index, ItemStack("farming_plus:big_pumpkin")) end, placer) return end @@ -143,29 +146,29 @@ minetest.register_node(":farming:big_pumpkin", { for dy=0,1 do pos.y = pos.y+dy pos.z = pos.z+1 - minetest.set_node(pos, {name="farming:big_pumpkin_side", param2=2}) + minetest.set_node(pos, {name="farming_plus:big_pumpkin_side", param2=2}) pos.x = pos.x-1 - minetest.set_node(pos, {name="farming:big_pumpkin_corner", param2=2}) + minetest.set_node(pos, {name="farming_plus:big_pumpkin_corner", param2=2}) pos.x = pos.x+1 pos.z = pos.z-2 - minetest.set_node(pos, {name="farming:big_pumpkin_side", param2=4}) + minetest.set_node(pos, {name="farming_plus:big_pumpkin_side", param2=4}) pos.x = pos.x+1 - minetest.set_node(pos, {name="farming:big_pumpkin_corner", param2=4}) + minetest.set_node(pos, {name="farming_plus:big_pumpkin_corner", param2=4}) pos.z = pos.z+1 - minetest.set_node(pos, {name="farming:big_pumpkin_side", param2=3}) + minetest.set_node(pos, {name="farming_plus:big_pumpkin_side", param2=3}) pos.z = pos.z+1 - minetest.set_node(pos, {name="farming:big_pumpkin_corner", param2=3}) + minetest.set_node(pos, {name="farming_plus:big_pumpkin_corner", param2=3}) pos.z = pos.z-1 pos.x = pos.x-2 - minetest.set_node(pos, {name="farming:big_pumpkin_side", param2=1}) + minetest.set_node(pos, {name="farming_plus:big_pumpkin_side", param2=1}) pos.z = pos.z-1 - minetest.set_node(pos, {name="farming:big_pumpkin_corner", param2=1}) + minetest.set_node(pos, {name="farming_plus:big_pumpkin_corner", param2=1}) pos.z = pos.z+1 pos.x = pos.x+1 pos.y = pos.y-dy end pos.y = pos.y+1 - minetest.set_node(pos, {name="farming:big_pumpkin_top"}) + minetest.set_node(pos, {name="farming_plus:big_pumpkin_top"}) end, after_destruct = function(pos, oldnode) @@ -176,7 +179,7 @@ minetest.register_node(":farming:big_pumpkin", { pos.y = pos.y+dy pos.z = pos.z+dz local name = minetest.get_node(pos).name - if string.find(name, "farming:big_pumpkin") then + if string.find(name, "farming_plus:big_pumpkin") then minetest.remove_node(pos) end pos.x = pos.x-dx @@ -188,7 +191,7 @@ minetest.register_node(":farming:big_pumpkin", { end }) -minetest.register_node(":farming:big_pumpkin_side", { +minetest.register_node(":farming_plus:big_pumpkin_side", { paramtype = "light", sunlight_propagates = true, paramtype2 = "facedir", @@ -208,7 +211,7 @@ minetest.register_node(":farming:big_pumpkin_side", { }, groups = {not_in_creative_inventory=1}, }) -minetest.register_node(":farming:big_pumpkin_corner", { +minetest.register_node(":farming_plus:big_pumpkin_corner", { paramtype = "light", sunlight_propagates = true, paramtype2 = "facedir", @@ -229,7 +232,7 @@ minetest.register_node(":farming:big_pumpkin_corner", { groups = {not_in_creative_inventory=1}, }) -minetest.register_node(":farming:big_pumpkin_top", { +minetest.register_node(":farming_plus:big_pumpkin_top", { paramtype = "light", sunlight_propagates = true, tiles = {"farming_pumpkin_big_top.png"}, @@ -244,8 +247,8 @@ minetest.register_node(":farming:big_pumpkin_top", { minetest.register_craft({ type = "shapeless", - output = "farming:big_pumpkin", - recipe = {"bucket:bucket_water", "farming:pumpkin"}, + output = "farming_plus:big_pumpkin", + recipe = {"bucket:bucket_water", "farming_plus:pumpkin"}, replacements = { {"bucket:bucket_water", "bucket:bucket_empty"} } @@ -276,7 +279,7 @@ for j,list in pairs(box2) do box2[j] = list end -minetest.register_node(":farming:scarecrow", { +minetest.register_node(":farming_plus:scarecrow", { description = S("Scarecrow"), paramtype = "light", sunlight_propagates = true, @@ -305,25 +308,25 @@ minetest.register_node(":farming:scarecrow", { minetest.after(0.1, function(placer) local inv = placer:get_inventory() local index = placer:get_wield_index() - inv:set_stack("main", index, ItemStack("farming:scarecrow")) + inv:set_stack("main", index, ItemStack("farming_plus:scarecrow")) end, placer) return end minetest.set_node(pos, node) pos.y = pos.y-1 - node.name = "farming:scarecrow_bottom" + node.name = "farming_plus:scarecrow_bottom" minetest.set_node(pos, node) end, after_destruct = function(pos, oldnode) pos.y = pos.y-1 - if minetest.get_node(pos).name == "farming:scarecrow_bottom" then + if minetest.get_node(pos).name == "farming_plus:scarecrow_bottom" then minetest.remove_node(pos) end end }) -minetest.register_node(":farming:scarecrow_bottom", { +minetest.register_node(":farming_plus:scarecrow_bottom", { paramtype = "light", sunlight_propagates = true, paramtype2 = "facedir", @@ -343,15 +346,15 @@ minetest.register_node(":farming:scarecrow_bottom", { }) minetest.register_craft({ - output = "farming:scarecrow", + output = "farming_plus:scarecrow", recipe = { - {"", "farming:pumpkin_face", "",}, + {"", "farming_plus:pumpkin_face", "",}, {"default:stick", "default:stick", "default:stick",}, {"", "default:stick", "",} } }) -minetest.register_node(":farming:scarecrow_light", { +minetest.register_node(":farming_plus:scarecrow_light", { description = S("Scarecrow With light"), paramtype = "light", sunlight_propagates = true, @@ -381,57 +384,57 @@ minetest.register_node(":farming:scarecrow_light", { minetest.after(0.1, function(placer) local inv = placer:get_inventory() local index = placer:get_wield_index() - inv:set_stack("main", index, ItemStack("farming:scarecrow_light")) + inv:set_stack("main", index, ItemStack("farming_plus:scarecrow_light")) end, placer) return end minetest.set_node(pos, node) pos.y = pos.y-1 - node.name = "farming:scarecrow_bottom" + node.name = "farming_plus:scarecrow_bottom" minetest.set_node(pos, node) end, after_destruct = function(pos, oldnode) pos.y = pos.y-1 - if minetest.get_node(pos).name == "farming:scarecrow_bottom" then + if minetest.get_node(pos).name == "farming_plus:scarecrow_bottom" then minetest.remove_node(pos) end end }) minetest.register_craft({ - output = "farming:scarecrow_light", + output = "farming_plus:scarecrow_light", recipe = { - {"", "farming:pumpkin_face_light", "",}, + {"", "farming_plus:pumpkin_face_light", "",}, {"default:stick", "default:stick", "default:stick",}, {"", "default:stick", "",} } }) --=============== -minetest.register_craftitem(":farming:pumpkin_bread", { +minetest.register_craftitem(":farming_plus:pumpkin_bread", { description = S("Pumpkin Bread"), inventory_image = "farming_bread_pumpkin.png", stack_max = 99, on_use = minetest.item_eat(8) }) -minetest.register_craftitem(":farming:pumpkin_flour", { +minetest.register_craftitem(":farming_plus:pumpkin_flour", { description = "Pumpkin Flour", inventory_image = "farming_cake_mix_pumpkin.png", }) -minetest.register_alias("farming:pumpkin_cake_mix", "farming:pumpkin_flour") +minetest.register_alias("farming_plus:pumpkin_cake_mix", "farming_plus:pumpkin_flour") minetest.register_craft({ - output = "farming:pumpkin_flour", + output = "farming_plus:pumpkin_flour", type = "shapeless", - recipe = {"farming:flour", "farming:pumpkin"} + recipe = {"farming_plus:flour", "farming_plus:pumpkin"} }) minetest.register_craft({ type = "cooking", - output = "farming:pumpkin_bread", - recipe = "farming:pumpkin_flour", + output = "farming_plus:pumpkin_bread", + recipe = "farming_plus:pumpkin_flour", cooktime = 10 }) @@ -439,42 +442,42 @@ minetest.register_craft({ -- ========= FUEL ========= minetest.register_craft({ type = "fuel", - recipe = "farming:pumpkin_seed", + recipe = "farming_plus:pumpkin_seed", burntime = 1 }) minetest.register_craft({ type = "fuel", - recipe = "farming:pumpkin", + recipe = "farming_plus:pumpkin", burntime = 5 }) minetest.register_craft({ type = "fuel", - recipe = "farming:pumpkin_face", + recipe = "farming_plus:pumpkin_face", burntime = 5 }) minetest.register_craft({ type = "fuel", - recipe = "farming:pumpkin_face_light", + recipe = "farming_plus:pumpkin_face_light", burntime = 7 }) minetest.register_craft({ type = "fuel", - recipe = "farming:big_pumpkin", + recipe = "farming_plus:big_pumpkin", burntime = 10 }) minetest.register_craft({ type = "fuel", - recipe = "farming:scarecrow", + recipe = "farming_plus:scarecrow", burntime = 5 }) minetest.register_craft({ type = "fuel", - recipe = "farming:scarecrow_light", + recipe = "farming_plus:scarecrow_light", burntime = 5 }) diff --git a/mods/farming_plus/rhubarb.lua b/mods/farming_plus/rhubarb.lua index 2c37d1a..c9579fb 100644 --- a/mods/farming_plus/rhubarb.lua +++ b/mods/farming_plus/rhubarb.lua @@ -13,6 +13,8 @@ minetest.register_craftitem("farming_plus:rhubarb_seed", { minetest.register_node("farming_plus:rhubarb_1", { paramtype = "light", walkable = false, + buildable_to = true, + floodable = true, drawtype = "plantlike", drop = "", tiles = {"farming_rhubarb_1.png"}, @@ -29,6 +31,8 @@ minetest.register_node("farming_plus:rhubarb_1", { minetest.register_node("farming_plus:rhubarb_2", { paramtype = "light", walkable = false, + buildable_to = true, + floodable = true, drawtype = "plantlike", drop = "", tiles = {"farming_rhubarb_2.png"}, @@ -45,6 +49,8 @@ minetest.register_node("farming_plus:rhubarb_2", { minetest.register_node("farming_plus:rhubarb", { paramtype = "light", walkable = false, + buildable_to = true, + floodable = true, drawtype = "plantlike", tiles = {"farming_rhubarb_3.png"}, drop = { @@ -67,4 +73,4 @@ minetest.register_craftitem("farming_plus:rhubarb_item", { inventory_image = "farming_rhubarb.png", }) -farming:add_plant("farming_plus:rhubarb", {"farming_plus:rhubarb_1", "farming_plus:rhubarb_2"}, 50, 20) +farming:add_plant("farming_plus:rhubarb", {"farming_plus:rhubarb_1", "farming_plus:rhubarb_2"}, 300, 1) diff --git a/mods/farming_plus/soil.lua b/mods/farming_plus/soil.lua new file mode 100644 index 0000000..872ceb1 --- /dev/null +++ b/mods/farming_plus/soil.lua @@ -0,0 +1,49 @@ +minetest.register_node("farming_plus:soil", { + description = "Soil", + tiles = {"farming_soil.png", "default_dirt.png"}, + drop = "default:dirt", + is_ground_content = true, + groups = {crumbly=3, not_in_creative_inventory=1, soil=2}, + sounds = default.node_sound_dirt_defaults(), +}) + +minetest.register_node("farming_plus:soil_wet", { + description = "Wet Soil", + tiles = {"farming_soil_wet.png", "farming_soil_wet_side.png"}, + drop = "default:dirt", + is_ground_content = true, + groups = {crumbly=3, not_in_creative_inventory=1, soil=3}, + sounds = default.node_sound_dirt_defaults(), +}) + +minetest.register_abm({ + nodenames = {"farming_plus:soil", "farming_plus:soil_wet"}, + interval = 15, + chance = 4, + action = function(pos, node) + if abm_limiter() then return end + pos.y = pos.y+1 + local nn = minetest.get_node(pos).name + pos.y = pos.y-1 + + -- check if there is water nearby + if minetest.find_node_near(pos, 3, {"group:water"}) then + -- if it is dry soil turn it into wet soil + if node.name == "farming_plus:soil" then + minetest.set_node(pos, {name="farming_plus:soil_wet"}) + end + else + -- turn it back into dirt if it is already dry + if node.name == "farming_plus:soil" then + -- only turn it back if there is no plant on top of it + if minetest.get_item_group(nn, "plant") == 0 then + minetest.set_node(pos, {name="default:dirt"}) + end + + -- if its wet turn it back into dry soil + elseif node.name == "farming_plus:soil_wet" then + minetest.set_node(pos, {name="farming_plus:soil"}) + end + end + end, +}) diff --git a/mods/farming_plus/strawberries.lua b/mods/farming_plus/strawberries.lua index cc2b9f9..f60cb5b 100644 --- a/mods/farming_plus/strawberries.lua +++ b/mods/farming_plus/strawberries.lua @@ -13,6 +13,8 @@ minetest.register_craftitem("farming_plus:strawberry_seed", { minetest.register_node("farming_plus:strawberry_1", { paramtype = "light", walkable = false, + buildable_to = true, + floodable = true, drawtype = "plantlike", drop = "", tiles = {"farming_strawberry_1.png"}, @@ -29,6 +31,8 @@ minetest.register_node("farming_plus:strawberry_1", { minetest.register_node("farming_plus:strawberry_2", { paramtype = "light", walkable = false, + buildable_to = true, + floodable = true, drawtype = "plantlike", drop = "", tiles = {"farming_strawberry_2.png"}, @@ -45,6 +49,8 @@ minetest.register_node("farming_plus:strawberry_2", { minetest.register_node("farming_plus:strawberry_3", { paramtype = "light", walkable = false, + buildable_to = true, + floodable = true, drawtype = "plantlike", drop = "", tiles = {"farming_strawberry_3.png"}, @@ -61,6 +67,8 @@ minetest.register_node("farming_plus:strawberry_3", { minetest.register_node("farming_plus:strawberry", { paramtype = "light", walkable = false, + buildable_to = true, + floodable = true, drawtype = "plantlike", tiles = {"farming_strawberry_4.png"}, drop = { @@ -84,4 +92,4 @@ minetest.register_craftitem("farming_plus:strawberry_item", { on_use = minetest.item_eat(2), }) -farming:add_plant("farming_plus:strawberry", {"farming_plus:strawberry_1", "farming_plus:strawberry_2", "farming_plus:strawberry_3"}, 50, 20) +farming:add_plant("farming_plus:strawberry", {"farming_plus:strawberry_1", "farming_plus:strawberry_2", "farming_plus:strawberry_3"}, 200, 1) diff --git a/mods/farming/textures/farming_bread.png b/mods/farming_plus/textures/farming_bread.png similarity index 100% rename from mods/farming/textures/farming_bread.png rename to mods/farming_plus/textures/farming_bread.png diff --git a/mods/farming/textures/farming_cotton_1.png b/mods/farming_plus/textures/farming_cotton_1.png similarity index 100% rename from mods/farming/textures/farming_cotton_1.png rename to mods/farming_plus/textures/farming_cotton_1.png diff --git a/mods/farming/textures/farming_cotton_2.png b/mods/farming_plus/textures/farming_cotton_2.png similarity index 100% rename from mods/farming/textures/farming_cotton_2.png rename to mods/farming_plus/textures/farming_cotton_2.png diff --git a/mods/farming/textures/farming_cotton_3.png b/mods/farming_plus/textures/farming_cotton_3.png similarity index 100% rename from mods/farming/textures/farming_cotton_3.png rename to mods/farming_plus/textures/farming_cotton_3.png diff --git a/mods/farming/textures/farming_cotton_4.png b/mods/farming_plus/textures/farming_cotton_4.png similarity index 100% rename from mods/farming/textures/farming_cotton_4.png rename to mods/farming_plus/textures/farming_cotton_4.png diff --git a/mods/farming/textures/farming_cotton_5.png b/mods/farming_plus/textures/farming_cotton_5.png similarity index 100% rename from mods/farming/textures/farming_cotton_5.png rename to mods/farming_plus/textures/farming_cotton_5.png diff --git a/mods/farming/textures/farming_cotton_6.png b/mods/farming_plus/textures/farming_cotton_6.png similarity index 100% rename from mods/farming/textures/farming_cotton_6.png rename to mods/farming_plus/textures/farming_cotton_6.png diff --git a/mods/farming/textures/farming_cotton_7.png b/mods/farming_plus/textures/farming_cotton_7.png similarity index 100% rename from mods/farming/textures/farming_cotton_7.png rename to mods/farming_plus/textures/farming_cotton_7.png diff --git a/mods/farming/textures/farming_cotton_8.png b/mods/farming_plus/textures/farming_cotton_8.png similarity index 100% rename from mods/farming/textures/farming_cotton_8.png rename to mods/farming_plus/textures/farming_cotton_8.png diff --git a/mods/farming/textures/farming_cotton_seed.png b/mods/farming_plus/textures/farming_cotton_seed.png similarity index 100% rename from mods/farming/textures/farming_cotton_seed.png rename to mods/farming_plus/textures/farming_cotton_seed.png diff --git a/mods/farming/textures/farming_flour.png b/mods/farming_plus/textures/farming_flour.png similarity index 100% rename from mods/farming/textures/farming_flour.png rename to mods/farming_plus/textures/farming_flour.png diff --git a/mods/farming/textures/farming_soil.png b/mods/farming_plus/textures/farming_soil.png similarity index 100% rename from mods/farming/textures/farming_soil.png rename to mods/farming_plus/textures/farming_soil.png diff --git a/mods/farming/textures/farming_soil_wet.png b/mods/farming_plus/textures/farming_soil_wet.png similarity index 100% rename from mods/farming/textures/farming_soil_wet.png rename to mods/farming_plus/textures/farming_soil_wet.png diff --git a/mods/farming/textures/farming_soil_wet_side.png b/mods/farming_plus/textures/farming_soil_wet_side.png similarity index 100% rename from mods/farming/textures/farming_soil_wet_side.png rename to mods/farming_plus/textures/farming_soil_wet_side.png diff --git a/mods/farming/textures/farming_string.png b/mods/farming_plus/textures/farming_string.png similarity index 100% rename from mods/farming/textures/farming_string.png rename to mods/farming_plus/textures/farming_string.png diff --git a/mods/farming/textures/farming_tool_bronzehoe.png b/mods/farming_plus/textures/farming_tool_bronzehoe.png similarity index 100% rename from mods/farming/textures/farming_tool_bronzehoe.png rename to mods/farming_plus/textures/farming_tool_bronzehoe.png diff --git a/mods/farming/textures/farming_tool_steelhoe.png b/mods/farming_plus/textures/farming_tool_steelhoe.png similarity index 100% rename from mods/farming/textures/farming_tool_steelhoe.png rename to mods/farming_plus/textures/farming_tool_steelhoe.png diff --git a/mods/farming/textures/farming_tool_stonehoe.png b/mods/farming_plus/textures/farming_tool_stonehoe.png similarity index 100% rename from mods/farming/textures/farming_tool_stonehoe.png rename to mods/farming_plus/textures/farming_tool_stonehoe.png diff --git a/mods/farming/textures/farming_tool_woodhoe.png b/mods/farming_plus/textures/farming_tool_woodhoe.png similarity index 100% rename from mods/farming/textures/farming_tool_woodhoe.png rename to mods/farming_plus/textures/farming_tool_woodhoe.png diff --git a/mods/farming/textures/farming_wheat.png b/mods/farming_plus/textures/farming_wheat.png similarity index 100% rename from mods/farming/textures/farming_wheat.png rename to mods/farming_plus/textures/farming_wheat.png diff --git a/mods/farming/textures/farming_wheat_1.png b/mods/farming_plus/textures/farming_wheat_1.png similarity index 100% rename from mods/farming/textures/farming_wheat_1.png rename to mods/farming_plus/textures/farming_wheat_1.png diff --git a/mods/farming/textures/farming_wheat_2.png b/mods/farming_plus/textures/farming_wheat_2.png similarity index 100% rename from mods/farming/textures/farming_wheat_2.png rename to mods/farming_plus/textures/farming_wheat_2.png diff --git a/mods/farming/textures/farming_wheat_3.png b/mods/farming_plus/textures/farming_wheat_3.png similarity index 100% rename from mods/farming/textures/farming_wheat_3.png rename to mods/farming_plus/textures/farming_wheat_3.png diff --git a/mods/farming/textures/farming_wheat_4.png b/mods/farming_plus/textures/farming_wheat_4.png similarity index 100% rename from mods/farming/textures/farming_wheat_4.png rename to mods/farming_plus/textures/farming_wheat_4.png diff --git a/mods/farming/textures/farming_wheat_5.png b/mods/farming_plus/textures/farming_wheat_5.png similarity index 100% rename from mods/farming/textures/farming_wheat_5.png rename to mods/farming_plus/textures/farming_wheat_5.png diff --git a/mods/farming/textures/farming_wheat_6.png b/mods/farming_plus/textures/farming_wheat_6.png similarity index 100% rename from mods/farming/textures/farming_wheat_6.png rename to mods/farming_plus/textures/farming_wheat_6.png diff --git a/mods/farming/textures/farming_wheat_7.png b/mods/farming_plus/textures/farming_wheat_7.png similarity index 100% rename from mods/farming/textures/farming_wheat_7.png rename to mods/farming_plus/textures/farming_wheat_7.png diff --git a/mods/farming/textures/farming_wheat_8.png b/mods/farming_plus/textures/farming_wheat_8.png similarity index 100% rename from mods/farming/textures/farming_wheat_8.png rename to mods/farming_plus/textures/farming_wheat_8.png diff --git a/mods/farming/textures/farming_wheat_seed.png b/mods/farming_plus/textures/farming_wheat_seed.png similarity index 100% rename from mods/farming/textures/farming_wheat_seed.png rename to mods/farming_plus/textures/farming_wheat_seed.png diff --git a/mods/farming_plus/tomatoes.lua b/mods/farming_plus/tomatoes.lua index acb3300..c97acf8 100644 --- a/mods/farming_plus/tomatoes.lua +++ b/mods/farming_plus/tomatoes.lua @@ -13,6 +13,8 @@ minetest.register_craftitem("farming_plus:tomato_seed", { minetest.register_node("farming_plus:tomato_1", { paramtype = "light", walkable = false, + buildable_to = true, + floodable = true, drawtype = "plantlike", drop = "", tiles = {"farming_tomato_1.png"}, @@ -29,6 +31,8 @@ minetest.register_node("farming_plus:tomato_1", { minetest.register_node("farming_plus:tomato_2", { paramtype = "light", walkable = false, + buildable_to = true, + floodable = true, drawtype = "plantlike", drop = "", tiles = {"farming_tomato_2.png"}, @@ -45,6 +49,8 @@ minetest.register_node("farming_plus:tomato_2", { minetest.register_node("farming_plus:tomato_3", { paramtype = "light", walkable = false, + buildable_to = true, + floodable = true, drawtype = "plantlike", drop = "", tiles = {"farming_tomato_3.png"}, @@ -61,6 +67,8 @@ minetest.register_node("farming_plus:tomato_3", { minetest.register_node("farming_plus:tomato", { paramtype = "light", walkable = false, + buildable_to = true, + floodable = true, drawtype = "plantlike", tiles = {"farming_tomato_4.png"}, drop = { @@ -84,4 +92,4 @@ minetest.register_craftitem("farming_plus:tomato_item", { on_use = minetest.item_eat(4), }) -farming:add_plant("farming_plus:tomato", {"farming_plus:tomato_1", "farming_plus:tomato_2", "farming_plus:tomato_3"}, 50, 20) +farming:add_plant("farming_plus:tomato", {"farming_plus:tomato_1", "farming_plus:tomato_2", "farming_plus:tomato_3"}, 175, 1) diff --git a/mods/farming_plus/tools.lua b/mods/farming_plus/tools.lua new file mode 100644 index 0000000..a925cd2 --- /dev/null +++ b/mods/farming_plus/tools.lua @@ -0,0 +1,113 @@ +function farming.hoe_on_use(itemstack, user, pointed_thing, uses) + local pt = pointed_thing + -- check if pointing at a node + if not pt then + return + end + if pt.type ~= "node" then + return + end + + local under = minetest.get_node(pt.under) + local p = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z} + local above = minetest.get_node(p) + + -- return if any of the nodes is not registered + if not minetest.registered_nodes[under.name] then + return + end + if not minetest.registered_nodes[above.name] then + return + end + + -- check if the node above the pointed thing is air + if above.name ~= "air" then + return + end + + -- check if pointing at dirt + if minetest.get_item_group(under.name, "soil") ~= 1 then + return + end + + -- turn the node into soil, wear out item and play sound + minetest.set_node(pt.under, {name="farming_plus:soil"}) + minetest.sound_play("default_dig_crumbly", { + pos = pt.under, + gain = 0.5, + }) + itemstack:add_wear(65535/(uses-1)) + return itemstack +end + +minetest.register_tool("farming_plus:hoe_wood", { + description = "Wooden Hoe", + inventory_image = "farming_tool_woodhoe.png", + + on_use = function(itemstack, user, pointed_thing) + return farming.hoe_on_use(itemstack, user, pointed_thing, 30) + end, +}) + +minetest.register_tool("farming_plus:hoe_stone", { + description = "Stone Hoe", + inventory_image = "farming_tool_stonehoe.png", + + on_use = function(itemstack, user, pointed_thing) + return farming.hoe_on_use(itemstack, user, pointed_thing, 90) + end, +}) + +minetest.register_tool("farming_plus:hoe_steel", { + description = "Steel Hoe", + inventory_image = "farming_tool_steelhoe.png", + + on_use = function(itemstack, user, pointed_thing) + return farming.hoe_on_use(itemstack, user, pointed_thing, 200) + end, +}) + +minetest.register_tool("farming_plus:hoe_bronze", { + description = "Bronze Hoe", + inventory_image = "farming_tool_bronzehoe.png", + + on_use = function(itemstack, user, pointed_thing) + return farming.hoe_on_use(itemstack, user, pointed_thing, 220) + end, +}) + +minetest.register_craft({ + output = "farming_plus:hoe_wood", + recipe = { + {"group:wood", "group:wood"}, + {"", "group:stick"}, + {"", "group:stick"}, + } +}) + +minetest.register_craft({ + output = "farming_plus:hoe_stone", + recipe = { + {"group:stone", "group:stone"}, + {"", "group:stick"}, + {"", "group:stick"}, + } +}) + +minetest.register_craft({ + output = "farming_plus:hoe_steel", + recipe = { + {"default:steel_ingot", "default:steel_ingot"}, + {"", "group:stick"}, + {"", "group:stick"}, + } +}) + +minetest.register_craft({ + output = "farming_plus:hoe_bronze", + recipe = { + {"default:bronze_ingot", "default:bronze_ingot"}, + {"", "group:stick"}, + {"", "group:stick"}, + } +}) \ No newline at end of file diff --git a/mods/farming_plus/weed.lua b/mods/farming_plus/weed.lua index 9f53be2..fdd9e97 100644 --- a/mods/farming_plus/weed.lua +++ b/mods/farming_plus/weed.lua @@ -2,11 +2,13 @@ local S S = farming.S -minetest.register_node(":farming:weed", { +minetest.register_node(":farming_plus:weed", { description = S("Weed"), paramtype = "light", sunlight_propagates = true, walkable = false, + buildable_to = true, + floodable = true, drawtype = "plantlike", tiles = {"farming_weed.png"}, inventory_image = "farming_weed.png", @@ -21,25 +23,47 @@ minetest.register_node(":farming:weed", { }) minetest.register_abm({ - nodenames = {"farming:soil_wet", "farming:soil"}, - interval = 50, - chance = 10, + nodenames = {"farming_plus:soil_wet", "farming_plus:soil"}, + interval = 150, + chance = 4, action = function(pos, node) if abm_limiter() then return end - if minetest.find_node_near(pos, 4, {"farming:scarecrow", "farming:scarecrow_light"}) ~= nil then + if minetest.find_node_near(pos, 4, {"farming_plus:scarecrow", "farming_plus:scarecrow_light"}) ~= nil then return end pos.y = pos.y+1 + if not minetest.get_node_light(pos,0.5) then + return + end + if minetest.get_node_light(pos,0.5) < 8 then + return + end if minetest.get_node(pos).name == "air" then - node.name = "farming:weed" + node.name = "farming_plus:weed" minetest.set_node(pos, node) end end }) +-- if something is overrun with weeds too long turn it back to regular dirt +minetest.register_abm({ + nodenames = {"farming_plus:weed"}, + interval = 700, + chance = 3, + action = function (pos, node) + -- default:grass_# # = 1-5 + math.randomseed(os.time()) + local grass = math.random(1,5) + local node = "default:grass_" .. grass + minetest.set_node(pos,{name=node}) + pos.y = pos.y - 1 + minetest.set_node(pos,{name="default:dirt_with_grass"}) + end +}) + -- ========= FUEL ========= minetest.register_craft({ type = "fuel", - recipe = "farming:weed", + recipe = "farming_plus:weed", burntime = 1 }) diff --git a/mods/farming_plus/wheat.lua b/mods/farming_plus/wheat.lua new file mode 100644 index 0000000..fc3a449 --- /dev/null +++ b/mods/farming_plus/wheat.lua @@ -0,0 +1,71 @@ +-- +-- Wheat +-- +minetest.register_craftitem("farming_plus:seed_wheat", { + description = "Wheat Seed", + inventory_image = "farming_wheat_seed.png", + on_place = function(itemstack, placer, pointed_thing) + return farming:place_seed(itemstack, placer, pointed_thing, "farming_plus:wheat_1") + end, + ground = "farming_plus:flour", +}) + +minetest.register_craftitem("farming_plus:wheat", { + description = "Wheat", + inventory_image = "farming_wheat.png", +}) + +minetest.register_craftitem("farming_plus:flour", { + description = "Flour", + inventory_image = "farming_flour.png", +}) + +minetest.register_craftitem("farming_plus:bread", { + description = "Bread", + inventory_image = "farming_bread.png", + on_use = minetest.item_eat(4), +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming_plus:flour", + recipe = {"farming_plus:wheat", "farming_plus:wheat", "farming_plus:wheat", "farming_plus:wheat"} +}) + +minetest.register_craft({ + type = "cooking", + cooktime = 15, + output = "farming_plus:bread", + recipe = "farming_plus:flour" +}) + +local nodes = {} +for i=1,8 do + local drop = { + items = { + {items = {'farming_plus:wheat'},rarity=9-i}, + {items = {'farming_plus:wheat'},rarity=18-i*2}, + {items = {'farming_plus:seed_wheat'},rarity=9-i}, + {items = {'farming_plus:seed_wheat'},rarity=18-i*2}, + } + } + minetest.register_node("farming_plus:wheat_"..i, { + drawtype = "plantlike", + tiles = {"farming_wheat_"..i..".png"}, + paramtype = "light", + waving = 1, + 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 = {snappy=3,flammable=2,plant=1,wheat=i,not_in_creative_inventory=1,attached_node=1}, + sounds = default.node_sound_leaves_defaults(), + }) + table.insert(nodes,"farming_plus:wheat_"..i) +end + +farming:add_plant("farming_plus:wheat_8",nodes,1600,1) \ No newline at end of file diff --git a/mods/flowers/init.lua b/mods/flowers/init.lua index 15bade2..9dc4a6a 100644 --- a/mods/flowers/init.lua +++ b/mods/flowers/init.lua @@ -22,6 +22,7 @@ minetest.register_node("flowers:dandelion_white", { paramtype = "light", walkable = false, buildable_to = true, + floodable = true, groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_white=1}, sounds = default.node_sound_leaves_defaults(), selection_box = { @@ -41,6 +42,7 @@ minetest.register_node("flowers:magic", { light_source = 12, walkable = false, buildable_to = true, + floodable = true, groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_white=1}, sounds = default.node_sound_leaves_defaults(), selection_box = { @@ -59,6 +61,7 @@ minetest.register_node("flowers:dandelion_yellow", { paramtype = "light", walkable = false, buildable_to = true, + floodable = true, groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_yellow=1}, sounds = default.node_sound_leaves_defaults(), selection_box = { @@ -77,6 +80,7 @@ minetest.register_node("flowers:geranium", { paramtype = "light", walkable = false, buildable_to = true, + floodable = true, groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_blue=1}, sounds = default.node_sound_leaves_defaults(), selection_box = { @@ -95,6 +99,7 @@ minetest.register_node("flowers:rose", { paramtype = "light", walkable = false, buildable_to = true, + floodable = true, groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_red=1}, sounds = default.node_sound_leaves_defaults(), selection_box = { @@ -113,6 +118,7 @@ minetest.register_node("flowers:tulip", { paramtype = "light", walkable = false, buildable_to = true, + floodable = true, groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_orange=1}, sounds = default.node_sound_leaves_defaults(), selection_box = { @@ -131,6 +137,7 @@ minetest.register_node("flowers:viola", { paramtype = "light", walkable = false, buildable_to = true, + floodable = true, groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_violet=1}, sounds = default.node_sound_leaves_defaults(), selection_box = { @@ -163,7 +170,7 @@ minetest.register_abm({ minetest.register_abm({ nodenames = {"group:flora"}, - neighbors = {"default:dirt_with_grass", "default:desert_sand"}, + neighbors = {"default:dirt_with_grass", "default:desert_sand","mg:dirt_with_dry_grass"}, interval = 50, chance = 25, action = function(pos, node) @@ -171,7 +178,7 @@ minetest.register_abm({ pos.y = pos.y - 1 local under = minetest.get_node(pos) pos.y = pos.y + 1 - if under.name == "default:desert_sand" then + if under.name == "default:desert_sand" or under.name == "mg:dirt_with_dry_grass" then minetest.set_node(pos, {name="default:dry_shrub"}) elseif under.name ~= "default:dirt_with_grass" then return diff --git a/mods/food/init.lua b/mods/food/init.lua index a69f617..46a9409 100644 --- a/mods/food/init.lua +++ b/mods/food/init.lua @@ -144,17 +144,17 @@ local function _meat(type,mod,item) food.support(type,mod,item) food.support("meat",mod,item) end -food.support("wheat","farming","farming:wheat") -food.support("flour","farming","farming:flour") -food.support("potato","docfarming","docfarming:potato") +food.support("wheat","farming","farming_plus:wheat") +food.support("flour","farming","farming_plus:flour") +food.support("potato","docfarming","docfarming_plus:potato") food.support("potato","veggies","veggies:potato") food.support("potato","farming_plus","farming_plus:potato_item") food.support("tomato","farming_plus","farming_plus:tomato_item") food.support("tomato","plantlib","plantlib:tomato") food.support("carrot","farming_plus","farming_plus:carrot_item") -food.support("carrot","docfarming","docfarming:carrot") +food.support("carrot","docfarming","docfarming_plus:carrot") food.support("carrot","plantlib","plantlib:carrot") -food.support("carrot","jkfarming","jkfarming:carrot") +food.support("carrot","jkfarming","jkfarming_plus:carrot") food.support("cocoa","farming_plus","farming_plus:cocoa_bean") food.support("milk","animalmaterials","animalmaterials:milk") food.support("milk","my_mobs","my_mobs:milk_glass_cup") @@ -171,7 +171,7 @@ _meat("chicken","mobfcooking","mobfcooking:cooked_chicken") _meat("lamb","mobfcooking","mobfcooking:cooked_lamb") _meat("venison","mobfcooking","mobfcooking:cooked_venison") food.support("cup","vessels","vessels:drinking_glass") -food.support("sugar","jkfarming","jkfarming:sugar") +food.support("sugar","jkfarming","jkfarming_plus:sugar") food.support("sugar","bushes_classic","bushes:sugar") -- Default inbuilt ingredients diff --git a/mods/handle_schematics/replacements_farming.lua b/mods/handle_schematics/replacements_farming.lua index 7a8d5a6..5e7f9be 100644 --- a/mods/handle_schematics/replacements_farming.lua +++ b/mods/handle_schematics/replacements_farming.lua @@ -105,10 +105,10 @@ replacements_group['farming'].add_material = function( fruit, fruit_item, prefix { fruit_item.." 1", "default:coal_lump 3", "default:wood 8"}, { fruit_item.." 10", "default:steel_ingot 2", "default:chest_locked 1"}}; if( fruit_item ~= data[1] ) then - table.insert( goods, { data[1].." 1", "farming:scarecrow", "farming:scarecrow_light 1"}); + table.insert( goods, { data[1].." 1", "farming_plus:scarecrow", "farming_plus:scarecrow_light 1"}); table.insert( goods, { data[1].." 2", "default:dirt 20", "default:bucket_water", "default:steel_ingot 4", "default:leaves 99" }); end - table.insert( goods, {"farming:hoe_wood 1","default:wood 10", "default:cobble 10"}); + table.insert( goods, {"farming_plus:hoe_wood 1","default:wood 10", "default:cobble 10"}); mobf_trader.add_trader( mobf_trader.npc_trader_prototype, "farmer growing "..fruit.."s", -- not always the right grammatical form @@ -129,14 +129,14 @@ end replacements_group['farming'].construct_farming_type_list = function() -- farming from minetest_game - replacements_group['farming'].add_material( 'wheat', 'farming:wheat', 'farming:', '_', '' ); - replacements_group['farming'].add_material( 'cotton', 'farming:cotton', 'farming:', '_', '' ); - replacements_group['farming'].add_material( 'pumpkin','farming:pumpkin', 'farming:', '_', '' ); + replacements_group['farming'].add_material( 'wheat', 'farming_plus:wheat', 'farming_plus:', '_', '' ); + replacements_group['farming'].add_material( 'cotton', 'farming_plus:cotton', 'farming_plus:', '_', '' ); + replacements_group['farming'].add_material( 'pumpkin','farming_plus:pumpkin', 'farming_plus:', '_', '' ); -- RealTest - replacements_group['farming'].add_material( 'flax', 'farming:string', 'farming:', '_', '' ); - replacements_group['farming'].add_material( 'spelt', 'farming:wheat', 'farming:', '_', '' ); - replacements_group['farming'].add_material( 'soy', 'farming:soy', 'farming:', '_', '' ); + replacements_group['farming'].add_material( 'flax', 'farming_plus:string', 'farming_plus:', '_', '' ); + replacements_group['farming'].add_material( 'spelt', 'farming_plus:wheat', 'farming_plus:', '_', '' ); + replacements_group['farming'].add_material( 'soy', 'farming_plus:soy', 'farming_plus:', '_', '' ); -- diffrent versions of farming_plus: @@ -160,10 +160,10 @@ replacements_group['farming'].construct_farming_type_list = function() -- coffee beans from farming_plus/farming_plusplus replacements_group['farming'].add_material( 'coffee', 'farming_plus:coffee_beans', 'farming_plus:', '_', '' ); - -- Docfarming: https://forum.minetest.net/viewtopic.php?t=3948 + -- Docfarming_plus: https://forum.minetest.net/viewtopic.php?t=3948 fruits = {'carrot','corn','potato','raspberry'}; for i,fruit in pairs( fruits ) do - replacements_group['farming'].add_material( fruit, 'docfarming:'..fruit, 'docfarming:', '', '' ); + replacements_group['farming'].add_material( fruit, 'docfarming_plus:'..fruit, 'docfarming_plus:', '', '' ); end end diff --git a/mods/handle_schematics/replacements_realtest.lua b/mods/handle_schematics/replacements_realtest.lua index df4d2f0..276ceb0 100644 --- a/mods/handle_schematics/replacements_realtest.lua +++ b/mods/handle_schematics/replacements_realtest.lua @@ -48,9 +48,9 @@ replacements_group['realtest'].replace = function( replacements ) table.insert( repl, {'default:furnace', 'oven:oven'}); table.insert( repl, {'default:clay', 'grounds:clay'}); -- Realtest does not know about these nodes yet - table.insert( repl, {'farming:soil_wet', 'farming:soil'}); - table.insert( repl, {'farming:desert_sand_soil', 'farming:soil'}); - table.insert( repl, {'farming:desert_sand_soil_wet','farming:soil'}); + table.insert( repl, {'farming_plus:soil_wet', 'farming_plus:soil'}); + table.insert( repl, {'farming_plus:desert_sand_soil', 'farming_plus:soil'}); + table.insert( repl, {'farming_plus:desert_sand_soil_wet','farming_plus:soil'}); for i=1,5 do table.insert( repl, {'default:grass_'..i,'air' }); end @@ -59,7 +59,7 @@ replacements_group['realtest'].replace = function( replacements ) else table.insert( repl, {'oven:oven', 'default:furnace'}); table.insert( repl, {'grounds:clay', 'default:clay'}); - table.insert( repl, {'farming:soil', 'farming:soil_wet'}); + table.insert( repl, {'farming_plus:soil', 'farming_plus:soil_wet'}); end diff --git a/mods/handle_schematics/translate_nodenames_for_mc_schematic.lua b/mods/handle_schematics/translate_nodenames_for_mc_schematic.lua index 7d7d5c3..8182495 100644 --- a/mods/handle_schematics/translate_nodenames_for_mc_schematic.lua +++ b/mods/handle_schematics/translate_nodenames_for_mc_schematic.lua @@ -165,8 +165,8 @@ local conversionTable = { [56] = {P2_IGNORE, "default:stone_with_diamond"}, [57] = {P2_IGNORE, "default:diamondblock"}, [58] = {P2_CONVERT,"minecraft:crafting_table"}, - [59] = {P2_IGNORE, "farming:wheat_8"}, - [60] = {P2_IGNORE, "farming:soil_wet"}, + [59] = {P2_IGNORE, "farming_plus:wheat_8"}, + [60] = {P2_IGNORE, "farming_plus:soil_wet"}, [61] = {P2_IGNORE, "default:furnace"}, [62] = {P2_IGNORE, "default:furnace_active"}, [63] = {P2_IGNORE, "default:sign_wall"}, @@ -184,8 +184,8 @@ local conversionTable = { [83] = {P2_IGNORE, "default:papyrus"}, [84] = {P2_CONVERT,"minecraft:jukebox"}, [85] = {P2_IGNORE, "default:fence_wood"}, - [86] = {P2_CONVERT,"farming:pumpkin"}, - [91] = {P2_CONVERT,"farming:pumpkin_face_light"}, + [86] = {P2_CONVERT,"farming_plus:pumpkin"}, + [91] = {P2_CONVERT,"farming_plus:pumpkin_face_light"}, [92] = {P2_CONVERT,"minecraft:cake"}, [95] = {P2_IGNORE, "minecraft:stained_glass"}, -- TODO [96] = {P2_CONVERT,"doors:trapdoor"}, @@ -256,7 +256,7 @@ local conversionTable = { [15]="stained_glass:black__"}}, -- TODO [101]= {P2_CONVERT,"xpanes:bar"}, [102]= {P2_CONVERT,"xpanes:pane"}, - [103]= {P2_IGNORE, "farming:melon"}, + [103]= {P2_IGNORE, "farming_plus:melon"}, [104]= {P2_IGNORE, "minecraft:pumpkin_stem"}, [105]= {P2_IGNORE, "minecraft:melon_stem"}, [106]= {P2_CONVERT,"vines:vine"}, diff --git a/mods/hunger/depends.txt b/mods/hunger/depends.txt index a73cec4..27a7702 100644 --- a/mods/hunger/depends.txt +++ b/mods/hunger/depends.txt @@ -9,7 +9,6 @@ creatures? docfarming? dwarves? ethereal? -farming? farming_plus? ferns? fishing? diff --git a/mods/hunger/food.lua b/mods/hunger/food.lua index 6dc481d..5725eef 100644 --- a/mods/hunger/food.lua +++ b/mods/hunger/food.lua @@ -2,8 +2,8 @@ local register_food = hunger.register_food register_food("default:apple", 2) -if minetest.get_modpath("farming") ~= nil then - register_food("farming:bread", 4) +if minetest.get_modpath("farming_plus") ~= nil then + register_food("farming_plus:bread", 4) end if minetest.get_modpath("mobs") ~= nil then @@ -113,19 +113,19 @@ if minetest.get_modpath("mushroom") ~= nil then end if minetest.get_modpath("docfarming") ~= nil then - register_food("docfarming:carrot", 3) - register_food("docfarming:cucumber", 2) - register_food("docfarming:corn", 3) - register_food("docfarming:potato", 4) - register_food("docfarming:bakedpotato", 5) - register_food("docfarming:raspberry", 3) + register_food("docfarming_plus:carrot", 3) + register_food("docfarming_plus:cucumber", 2) + register_food("docfarming_plus:corn", 3) + register_food("docfarming_plus:potato", 4) + register_food("docfarming_plus:bakedpotato", 5) + register_food("docfarming_plus:raspberry", 3) end if minetest.get_modpath("farming_plus") ~= nil then register_food("farming_plus:carrot_item", 3) register_food("farming_plus:banana", 2) register_food("farming_plus:orange_item", 2) - register_food("farming:pumpkin_bread", 4) + register_food("farming_plus:pumpkin_bread", 4) register_food("farming_plus:strawberry_item", 2) register_food("farming_plus:tomato_item", 2) register_food("farming_plus:potato_item", 4) @@ -226,33 +226,33 @@ if minetest.get_modpath("ethereal") then end if minetest.get_modpath("farming") and farming.mod == "redo" then - register_food("farming:bread", 6) - register_food("farming:potato", 1) - register_food("farming:baked_potato", 6) - register_food("farming:cucumber", 4) - register_food("farming:tomato", 4) - register_food("farming:carrot", 3) - register_food("farming:carrot_gold", 6, "", nil, 8) - register_food("farming:corn", 3) - register_food("farming:corn_cob", 5) - register_food("farming:melon_slice", 2) - register_food("farming:pumpkin_slice", 1) - register_food("farming:pumpkin_bread", 9) - register_food("farming:coffee_cup", 2, "farming:drinking_cup") - register_food("farming:coffee_cup_hot", 3, "farming:drinking_cup", nil, 2) - register_food("farming:cookie", 2) - register_food("farming:chocolate_dark", 3) - register_food("farming:donut", 4) - register_food("farming:donut_chocolate", 6) - register_food("farming:donut_apple", 6) - register_food("farming:raspberries", 1) - register_food("farming:blueberries", 1) - register_food("farming:muffin_blueberry", 4) + register_food("farming_plus:bread", 6) + register_food("farming_plus:potato", 1) + register_food("farming_plus:baked_potato", 6) + register_food("farming_plus:cucumber", 4) + register_food("farming_plus:tomato", 4) + register_food("farming_plus:carrot", 3) + register_food("farming_plus:carrot_gold", 6, "", nil, 8) + register_food("farming_plus:corn", 3) + register_food("farming_plus:corn_cob", 5) + register_food("farming_plus:melon_slice", 2) + register_food("farming_plus:pumpkin_slice", 1) + register_food("farming_plus:pumpkin_bread", 9) + register_food("farming_plus:coffee_cup", 2, "farming_plus:drinking_cup") + register_food("farming_plus:coffee_cup_hot", 3, "farming_plus:drinking_cup", nil, 2) + register_food("farming_plus:cookie", 2) + register_food("farming_plus:chocolate_dark", 3) + register_food("farming_plus:donut", 4) + register_food("farming_plus:donut_chocolate", 6) + register_food("farming_plus:donut_apple", 6) + register_food("farming_plus:raspberries", 1) + register_food("farming_plus:blueberries", 1) + register_food("farming_plus:muffin_blueberry", 4) if minetest.get_modpath("vessels") then - register_food("farming:smoothie_raspberry", 2, "vessels:drinking_glass") + register_food("farming_plus:smoothie_raspberry", 2, "vessels:drinking_glass") end - register_food("farming:rhubarb", 1) - register_food("farming:rhubarb_pie", 6) + register_food("farming_plus:rhubarb", 1) + register_food("farming_plus:rhubarb_pie", 6) end if minetest.get_modpath("kpgmobs") ~= nil then @@ -266,10 +266,10 @@ if minetest.get_modpath("kpgmobs") ~= nil then end if minetest.get_modpath("jkfarming") ~= nil then - register_food("jkfarming:carrot", 3) - register_food("jkfarming:corn", 3) - register_food("jkfarming:melon_part", 2) - register_food("jkfarming:cake", 3) + register_food("jkfarming_plus:carrot", 3) + register_food("jkfarming_plus:corn", 3) + register_food("jkfarming_plus:melon_part", 2) + register_food("jkfarming_plus:cake", 3) end if minetest.get_modpath("jkanimals") ~= nil then diff --git a/mods/hunger/init.lua b/mods/hunger/init.lua index 1062460..7b2ce82 100644 --- a/mods/hunger/init.lua +++ b/mods/hunger/init.lua @@ -24,19 +24,5 @@ dofile(modpath .. "/food.lua") dofile(modpath .. "/legacy.lua") --- Callbacks - -function hunger_join_player(player) - local name = player:get_player_name() - local lvl = pd.get_number(name,"hunger_lvl") - if lvl > 20 then - lvl = 20 - end - minetest.after(0.8, function() - hud.change_item(player, "hunger", {offset = "item", item_name = "hunger"}) - hud.change_item(player, "hunger", {number = lvl, max = 20}) - end) -end - minetest.register_on_item_eat(hunger.eat) diff --git a/mods/mg/depends.txt b/mods/mg/depends.txt index 8c8f3be..beeb2d9 100644 --- a/mods/mg/depends.txt +++ b/mods/mg/depends.txt @@ -1,4 +1,4 @@ default experience? -farming? +farming_plus? bushes? diff --git a/mods/mg/dungeons.lua b/mods/mg/dungeons.lua index ed2ce66..2db6395 100644 --- a/mods/mg/dungeons.lua +++ b/mods/mg/dungeons.lua @@ -13,7 +13,7 @@ table.insert(dungeon_chest, { "potions:fly3", 50, 1}) table.insert(dungeon_chest, { "potions:bones", 70, 5}) table.insert(dungeon_chest, { "potions:magid_replenish3", 60, 10}) table.insert(dungeon_chest, { "potions:antidote", 80, 10}) -table.insert(dungeon_chest, { "farming:bread", 80, 15}) +table.insert(dungeon_chest, { "farming_plus:bread", 80, 15}) table.insert(dungeon_chest, { "mobs:meat", 80, 5}) table.insert(dungeon_chest, { "bushes:berry_pie_cooked", 90, 5}) table.insert(dungeon_chest, { "3d_armor:helmet_bronze", 70, 1}) diff --git a/mods/mg/fill_chests.lua b/mods/mg/fill_chests.lua index bd359be..2a14cb0 100644 --- a/mods/mg/fill_chests.lua +++ b/mods/mg/fill_chests.lua @@ -5,11 +5,11 @@ ADD_RCC2 = function( data ) end minetest.after(5,function() - ADD_RCC2({"farming:bread", 85, 3, 2, chest_storage=1, church=1, library=1, chest_private=1, shelf=1, shed=1, lumberjack=1, hut=1}) + ADD_RCC2({"farming_plus:bread", 85, 3, 2, chest_storage=1, church=1, library=1, chest_private=1, shelf=1, shed=1, lumberjack=1, hut=1}) ADD_RCC2({"mobs:meat_raw", 70, 2, 2, chest_storage=1, church=1, library=1, chest_private=1, shelf=1, shed=1, lumberjack=1, hut=1}) ADD_RCC2({"bushes:berry_pie_cooked", 80, 4, 3, chest_storage=1, church=1, library=1, chest_private=1, shelf=1, shed=1, lumberjack=1, hut=1}) ADD_RCC2({"throwing:arrow", 30, 1, 3, chest_storage=1, church=1, library=1, chest_private=1, shelf=1, shed=1, lumberjack=1, hut=1}) - ADD_RCC2({"farming:pumpkin_bread", 60, 3, 2, chest_storage=1, church=1, library=1, chest_private=1, shelf=1, shed=1, lumberjack=1, hut=1}) + ADD_RCC2({"farming_plus:pumpkin_bread", 60, 3, 2, chest_storage=1, church=1, library=1, chest_private=1, shelf=1, shed=1, lumberjack=1, hut=1}) ADD_RCC2({"farming_plus:potato_item", 66, 2, 2, chest_storage=1, church=1, library=1, chest_private=1, shelf=1, shed=1, lumberjack=1, hut=1}) ADD_RCC2({"experience:1_exp", 90, 6, 1, chest_storage=1, chest_private=1, shelf=1}) diff --git a/mods/mg_villages/depends.txt b/mods/mg_villages/depends.txt index 44c94d8..0a7f3d2 100644 --- a/mods/mg_villages/depends.txt +++ b/mods/mg_villages/depends.txt @@ -1,7 +1,7 @@ default handle_schematics doors -farming +farming_plus wool mg? stairs? diff --git a/mods/mg_villages/fill_chest.lua b/mods/mg_villages/fill_chest.lua index d7e5286..eaefe56 100644 --- a/mods/mg_villages/fill_chest.lua +++ b/mods/mg_villages/fill_chest.lua @@ -69,7 +69,7 @@ ADD_RCC({"fishing:pole", 60, 1, 1 }); if( minetest.get_modpath("ropes") ~= nil ) then ADD_RCC({"ropes:rope", 60, 5, 2, chest_work=1, shelf=1, chest_storage=1 }); elseif( minetest.get_modpath("farming") ~= nil ) then - ADD_RCC({"farming:string", 60, 5, 2, church=1, library=1, chest_work=1, shelf=1, chest_storage=1 }); + ADD_RCC({"farming_plus:string", 60, 5, 2, church=1, library=1, chest_work=1, shelf=1, chest_storage=1 }); elseif( minetest.get_modpath("moreblocks") ~= nil ) then ADD_RCC({"moreblocks:rope", 60, 5, 2, chest_work=1, shelf=1, chest_storage=1 }); end @@ -110,7 +110,7 @@ ADD_RCC({'cottages:anvil', 80, 1, 2, forge=1 }); ADD_RCC({'currency:minegeld', 80, 10, 2, chest_private=1, chest_work=1 }); -- TODO: could be in any chest with a certain chance -ADD_RCC({'farming:hoe_stone', 80, 1, 2, farm_tiny=2, farm_full=2, chest_work=2 }); +ADD_RCC({'farming_plus:hoe_stone', 80, 1, 2, farm_tiny=2, farm_full=2, chest_work=2 }); ADD_RCC({'homedecor:beer_mug', 50, 1, 2, tavern=5, inn=3}); ADD_RCC({'homedecor:book_blue', 50, 1, 2, church=1, library=1, chest_private=1}); diff --git a/mods/mg_villages/mapgen.lua b/mods/mg_villages/mapgen.lua index 3104812..322012d 100644 --- a/mods/mg_villages/mapgen.lua +++ b/mods/mg_villages/mapgen.lua @@ -760,12 +760,12 @@ mg_villages.village_area_fill_with_plants = function( village_area, villages, mi cid.c_savannasapling = minetest.get_content_id( 'mg:savannasapling'); cid.c_pinesapling = minetest.get_content_id( 'mg:pinesapling'); -- add farmland - cid.c_wheat = minetest.get_content_id( 'farming:wheat_8' ); - cid.c_cotton = minetest.get_content_id( 'farming:cotton_8' ); + cid.c_wheat = minetest.get_content_id( 'farming_plus:wheat_8' ); + cid.c_cotton = minetest.get_content_id( 'farming_plus:cotton_8' ); cid.c_shrub = minetest.get_content_id( 'default:dry_shrub'); -- these extra nodes are used in order to avoid abms on the huge fields around the villages - cid.c_soil_wet = minetest.get_content_id( 'mg_villages:soil' ); --'farming:soil_wet' ); - cid.c_soil_sand = minetest.get_content_id( 'mg_villages:desert_sand_soil'); --'farming:desert_sand_soil_wet' ); + cid.c_soil_wet = minetest.get_content_id( 'mg_villages:soil' ); --'farming_plus:soil_wet' ); + cid.c_soil_sand = minetest.get_content_id( 'mg_villages:desert_sand_soil'); --'farming_plus:desert_sand_soil_wet' ); -- desert sand soil is only available in minetest_next if( not( cid.c_soil_sand )) then cid.c_soil_sand = cid.c_soil_wet; @@ -776,10 +776,10 @@ mg_villages.village_area_fill_with_plants = function( village_area, villages, mi end if( mg_villages.realtest_trees ) then - cid.c_soil_wet = minetest.get_content_id( 'farming:soil' ); -- TODO: the one from mg_villages would be better...but that one lacks textures - cid.c_soil_sand = minetest.get_content_id( 'farming:soil' ); -- TODO: the one from mg_villages would be better...but that one lacks textures - cid.c_wheat = minetest.get_content_id( 'farming:spelt_4' ); - cid.c_cotton = minetest.get_content_id( 'farming:flax_4' ); + cid.c_soil_wet = minetest.get_content_id( 'farming_plus:soil' ); -- TODO: the one from mg_villages would be better...but that one lacks textures + cid.c_soil_sand = minetest.get_content_id( 'farming_plus:soil' ); -- TODO: the one from mg_villages would be better...but that one lacks textures + cid.c_wheat = minetest.get_content_id( 'farming_plus:spelt_4' ); + cid.c_cotton = minetest.get_content_id( 'farming_plus:flax_4' ); -- cid.c_shrub = minetest.get_content_id( 'default:dry_shrub'); end diff --git a/mods/mg_villages/replacements.lua b/mods/mg_villages/replacements.lua index 2474ab9..47719be 100644 --- a/mods/mg_villages/replacements.lua +++ b/mods/mg_villages/replacements.lua @@ -240,15 +240,15 @@ mg_villages.replace_tree_trunk = function( replacements, wood_type ) -- not really wood-realted, but needs to be replaced as well table.insert( replacements, {'default:furnace', 'oven:oven'}); -- farming is also handled diffrently - table.insert( replacements, {'farming:soil_wet', 'farming:soil'}); - table.insert( replacements, {'farming:cotton_1', 'farming:flax_1'}); - table.insert( replacements, {'farming:cotton_2', 'farming:flax_1'}); - table.insert( replacements, {'farming:cotton_3', 'farming:flax_2'}); - table.insert( replacements, {'farming:cotton_4', 'farming:flax_2'}); - table.insert( replacements, {'farming:cotton_5', 'farming:flax_3'}); - table.insert( replacements, {'farming:cotton_6', 'farming:flax_3'}); - table.insert( replacements, {'farming:cotton_7', 'farming:flax_4'}); - table.insert( replacements, {'farming:cotton_8', 'farming:flax_4'}); + table.insert( replacements, {'farming_plus:soil_wet', 'farming_plus:soil'}); + table.insert( replacements, {'farming_plus:cotton_1', 'farming_plus:flax_1'}); + table.insert( replacements, {'farming_plus:cotton_2', 'farming_plus:flax_1'}); + table.insert( replacements, {'farming_plus:cotton_3', 'farming_plus:flax_2'}); + table.insert( replacements, {'farming_plus:cotton_4', 'farming_plus:flax_2'}); + table.insert( replacements, {'farming_plus:cotton_5', 'farming_plus:flax_3'}); + table.insert( replacements, {'farming_plus:cotton_6', 'farming_plus:flax_3'}); + table.insert( replacements, {'farming_plus:cotton_7', 'farming_plus:flax_4'}); + table.insert( replacements, {'farming_plus:cotton_8', 'farming_plus:flax_4'}); -- stairs and slabs made out of default wood table.insert( replacements, {'stairs:stair_wood', 'trees:'..v..'_planks_stair'}); table.insert( replacements, {'stairs:slab_wood', 'trees:'..v..'_planks_slab'}); @@ -340,8 +340,8 @@ mg_villages.get_replacement_list = function( housetype, pr ) -- realtest lacks quite a lot from default if( mg_villages.realtest_trees ) then for i=1,8 do - table.insert( replacements, {'farming:wheat_'..i, 'farming:spelt_'..tostring( (i+(i%2))/2) }); - table.insert( replacements, {'farming:cotton_'..i, 'farming:flax_' ..tostring( (i+(i%2))/2) }); + table.insert( replacements, {'farming_plus:wheat_'..i, 'farming_plus:spelt_'..tostring( (i+(i%2))/2) }); + table.insert( replacements, {'farming_plus:cotton_'..i, 'farming_plus:flax_' ..tostring( (i+(i%2))/2) }); end for i=1,5 do table.insert( replacements, {'default:grass_'..i, 'air' }); @@ -936,22 +936,22 @@ mg_villages.get_fruit_replacements = function( replacements, fruit) local new_name = ''; -- farming_plus plants sometimes come in 3 or 4 variants, but not in 8 as cotton does if( minetest.registered_nodes[ 'farming_plus:'..fruit..'_'..i ]) then - old_name = "farming:cotton_"..i; + old_name = "farming_plus:cotton_"..i; new_name = 'farming_plus:'..fruit..'_'..i; -- "surplus" cotton variants will be replaced with the full grown fruit elseif( minetest.registered_nodes[ 'farming_plus:'..fruit ]) then - old_name = "farming:cotton_"..i; + old_name = "farming_plus:cotton_"..i; new_name = 'farming_plus:'..fruit; - -- and plants from farming: are supported as well - elseif( minetest.registered_nodes[ 'farming:'..fruit..'_'..i ]) then - old_name = "farming:cotton_"..i; - new_name = 'farming:'..fruit..'_'..i; + -- and plants from farming_plus: are supported as well + elseif( minetest.registered_nodes[ 'farming_plus:'..fruit..'_'..i ]) then + old_name = "farming_plus:cotton_"..i; + new_name = 'farming_plus:'..fruit..'_'..i; - elseif( minetest.registered_nodes[ 'farming:'..fruit ]) then - old_name = "farming:cotton_"..i; - new_name = 'farming:'..fruit; + elseif( minetest.registered_nodes[ 'farming_plus:'..fruit ]) then + old_name = "farming_plus:cotton_"..i; + new_name = 'farming_plus:'..fruit; end if( old_name ~= '' and new_name ~= '' ) then diff --git a/mods/mg_villages/village_types.lua b/mods/mg_villages/village_types.lua index ec42997..97ad021 100644 --- a/mods/mg_villages/village_types.lua +++ b/mods/mg_villages/village_types.lua @@ -15,17 +15,17 @@ -- of villages, the village name will consist of name_prefix..village_name..name_postfix -- sapling_divisor = 1 Villages are sourrounded by a flat area that may contain trees. Increasing this -- value decreses the mount of trees placed. --- plant_type = 'farming:wheat_8' Type of plant that is placed around villages. +-- plant_type = 'farming_plus:wheat_8' Type of plant that is placed around villages. -- plant_frequency = 1 The higher this value is, the less plants are placed. local village_type_data_list = { nore = { min = 20, max = 40, space_between_buildings=1, mods={}, texture = 'default_stone_brick.png', replacement_function = mg_villages.replacements_nore }, taoki = { min = 30, max = 70, space_between_buildings=1, mods={}, texture = 'default_brick.png' , - sapling_divisor = 5, plant_type = 'farming:cotton_8', plant_frequency = 1, + sapling_divisor = 5, plant_type = 'farming_plus:cotton_8', plant_frequency = 1, replacement_function = mg_villages.replacements_taoki }, medieval = { min = 25, max = 60, space_between_buildings=2, mods={'cottages'}, texture = 'cottages_darkage_straw.png', -- they often have straw roofs - sapling_divisor = 10, plant_type = 'farming:wheat_8', plant_frequency = 1, + sapling_divisor = 10, plant_type = 'farming_plus:wheat_8', plant_frequency = 1, replacement_function = mg_villages.replacements_medieval, roadsize_list = {2,3,4,5,6}, -- road_materials = {'default:cobble','default:gravel','default:stonebrick','default:coalblock'}, diff --git a/mods/mobs/animals/sheep.lua b/mods/mobs/animals/sheep.lua index b5c5cc0..c04cd1c 100644 --- a/mods/mobs/animals/sheep.lua +++ b/mods/mobs/animals/sheep.lua @@ -29,12 +29,12 @@ mobs:register_mob("mobs:sheep", { walk_start = 81, walk_end = 100, }, - follow = "farming:wheat", + follow = "farming_plus:wheat", view_range = 5, on_rightclick = function(self, clicker) local item = clicker:get_wielded_item() - if item:get_name() == "farming:wheat" then + if item:get_name() == "farming_plus:wheat" then if not self.tamed then if not minetest.setting_getbool("creative_mode") then item:take_item() diff --git a/mods/mobs/monsters/jungle_spider.lua b/mods/mobs/monsters/jungle_spider.lua index d736728..f5f6250 100644 --- a/mods/mobs/monsters/jungle_spider.lua +++ b/mods/mobs/monsters/jungle_spider.lua @@ -16,7 +16,7 @@ mobs:register_mob("mobs:jungle_spider",{ armor = 200, damage = 1, drops = { - {name = "farming:string", + {name = "farming_plus:string", chance = 40, min = 3, max = 6,}, diff --git a/mods/mobs/monsters/spider.lua b/mods/mobs/monsters/spider.lua index 3433d56..e63709d 100644 --- a/mods/mobs/monsters/spider.lua +++ b/mods/mobs/monsters/spider.lua @@ -16,7 +16,7 @@ mobs:register_mob("mobs:spider",{ armor = 200, damage = 3, drops = { - {name = "farming:string", + {name = "farming_plus:string", chance = 40, min = 3, max = 6,}, diff --git a/mods/mobs/npcs/women.lua b/mods/mobs/npcs/women.lua index 9759f61..b8be4b0 100644 --- a/mods/mobs/npcs/women.lua +++ b/mods/mobs/npcs/women.lua @@ -171,7 +171,7 @@ type = "npc", blood_amount = 35, blood_offset = 0.25, rewards = { - {chance=100, item="farming:bread 6"}, + {chance=100, item="farming_plus:bread 6"}, {chance=70, item="food:cheese 6"}, {chance=80, item="experience:6_exp 2"}, {chance=40, item="potions:magic_replenish1"}, diff --git a/mods/potions/items.lua b/mods/potions/items.lua index ef0207e..ab27c1b 100644 --- a/mods/potions/items.lua +++ b/mods/potions/items.lua @@ -192,7 +192,7 @@ minetest.register_craft({ minetest.register_craft({ type="shapeless", output="potions:gravity1_raw", - recipe = {"dye:green","farming:wheat","potions:ground_bones","default:mese_crystal_fragment","vessels:glass_bottle","bucket:bucket_water","potions:ground_magic"}, + recipe = {"dye:green","farming_plus:wheat","potions:ground_bones","default:mese_crystal_fragment","vessels:glass_bottle","bucket:bucket_water","potions:ground_magic"}, replacements = { { "bucket:bucket_water","bucket:bucket_empty" } } }) diff --git a/mods/quests/chest.lua b/mods/quests/chest.lua index ef3b892..e66c6ef 100644 --- a/mods/quests/chest.lua +++ b/mods/quests/chest.lua @@ -3,8 +3,8 @@ quests.chest = {} quests.chest.go = function(npc,player) local inv = player:get_inventory() local pos = npc.object:getpos() - if inv:contains_item("main","farming:flour") and inv:contains_item("main","food:bowl") then - inv:remove_item("main","farming:flour") + if inv:contains_item("main","farming_plus:flour") and inv:contains_item("main","food:bowl") then + inv:remove_item("main","farming_plus:flour") inv:remove_item("main","food:bowl") chat.local_chat(pos,"'Thank you very much, take this as a token of my appreciation!'",6) local lp = player:getpos() diff --git a/mods/throwing/depends.txt b/mods/throwing/depends.txt index 252d665..542a77d 100644 --- a/mods/throwing/depends.txt +++ b/mods/throwing/depends.txt @@ -1,4 +1,4 @@ default bucket fire -farming +farming_plus diff --git a/mods/throwing/init.lua b/mods/throwing/init.lua index 8291dbe..3c3f7b0 100644 --- a/mods/throwing/init.lua +++ b/mods/throwing/init.lua @@ -65,9 +65,9 @@ minetest.register_tool("throwing:bow_wood", { minetest.register_craft({ output = 'throwing:bow_wood', recipe = { - {'farming:string', 'default:wood', ''}, - {'farming:string', '', 'default:wood'}, - {'farming:string', 'default:wood', ''}, + {'farming_plus:string', 'default:wood', ''}, + {'farming_plus:string', '', 'default:wood'}, + {'farming_plus:string', 'default:wood', ''}, } }) @@ -94,9 +94,9 @@ minetest.register_tool("throwing:bow_steel", { minetest.register_craft({ output = 'throwing:bow_steel', recipe = { - {'farming:string', 'default:steel_ingot', ''}, - {'farming:string', '', 'default:steel_ingot'}, - {'farming:string', 'default:steel_ingot', ''}, + {'farming_plus:string', 'default:steel_ingot', ''}, + {'farming_plus:string', '', 'default:steel_ingot'}, + {'farming_plus:string', 'default:steel_ingot', ''}, } })