From 35a659720783f8c306c55247921eff1ea3125c4e Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Wed, 18 Mar 2015 19:23:03 +0100 Subject: [PATCH] Updated farming redo mod --- mods/farming/README.txt | 1 + mods/farming/cocoa.lua | 1 + mods/farming/hoes.lua | 1 - mods/farming/init.lua | 14 ++++++++------ 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/mods/farming/README.txt b/mods/farming/README.txt index 85aa6996..e77f9aa1 100755 --- a/mods/farming/README.txt +++ b/mods/farming/README.txt @@ -13,6 +13,7 @@ This mod works by adding your new plant to the {growing=1} group and numbering t Changelog: +1.12 - Player cannot place seeds in protected area, also growing speeds changed to match defaults 1.11 - Added Straw Bale, streamlined growing abm a little, fixed melon rotation bug with screwdriver 1.10 - Added Blueberry Bush and Blueberry Muffins, also Pumpkin/Melon easier to pick up, added check for unloaded map 1.09 - Corn now uses single nodes instead of 1 ontop of the other, Ethanol recipe is more expensive (requires 5 corn) and some code cleanup. diff --git a/mods/farming/cocoa.lua b/mods/farming/cocoa.lua index 446ef509..df299887 100755 --- a/mods/farming/cocoa.lua +++ b/mods/farming/cocoa.lua @@ -93,6 +93,7 @@ minetest.register_node("farming:cocoa_1", { } }, selection_box = {type = "fixed",fixed = {-0.27, -0.45, -0.27, 0.27, 0.45, 0.27},}, + -- MODIFICATION MADE FOR MFF ^ groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,growing=1}, sounds = default.node_sound_leaves_defaults(), }) diff --git a/mods/farming/hoes.lua b/mods/farming/hoes.lua index 8320977f..bad72313 100755 --- a/mods/farming/hoes.lua +++ b/mods/farming/hoes.lua @@ -1,7 +1,6 @@ -- Hoe registration function --- Register new hoes farming.register_hoe = function(name, def) -- Check for : prefix (register new hoes in your mod's namespace) if name:sub(1,1) ~= ":" then diff --git a/mods/farming/init.lua b/mods/farming/init.lua index e7144c6b..9e874037 100755 --- a/mods/farming/init.lua +++ b/mods/farming/init.lua @@ -1,5 +1,5 @@ --[[ - Minetest Farming Redo Mod 1.11 (20th Jan 2015) + Minetest Farming Redo Mod 1.12 (1st March 2015) by TenPlus1 ]] @@ -60,11 +60,13 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname) 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() + if not minetest.is_protected(pt.above, placer:get_player_name()) then + minetest.add_node(pt.above, {name=plantname}) + if not minetest.setting_getbool("creative_mode") then + itemstack:take_item() + end + return itemstack end - return itemstack end -- Single ABM Handles Growing of All Plants @@ -98,7 +100,7 @@ minetest.register_abm({ pos.y = pos.y+1 -- check light - if minetest.get_node_light(pos) <= 11 then return end + if minetest.get_node_light(pos) < 13 then return end end