From 55b9244bc749f8b27ec278b0ecc0ed372349a623 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Tue, 20 Jan 2015 18:46:37 +0000 Subject: [PATCH] Streamlined growing abm --- README.txt | 1 + init.lua | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/README.txt b/README.txt index c9a9de6..85aa699 100644 --- a/README.txt +++ b/README.txt @@ -13,6 +13,7 @@ This mod works by adding your new plant to the {growing=1} group and numbering t Changelog: +1.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. 1.08 - Added Farming Plus compatibility, plus can be removed and no more missing nodes diff --git a/init.lua b/init.lua index a7493c3..3ee27c5 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,5 @@ --[[ - Minetest Farming Redo Mod 1.10 (10th December 2014) + Minetest Farming Redo Mod 1.11 (20th Jan 2015) by TenPlus1 ]] @@ -78,11 +78,8 @@ minetest.register_abm({ action = function(pos, node) -- get node type (e.g. farming:wheat_1) - - local data = nil - data = string.split(node.name, '_', 2) - local plant = data[1].."_" - local numb = data[2] + local plant = node.name:split("_")[1].."_" + local numb = node.name:split("_")[2] -- check if fully grown if not minetest.registered_nodes[plant..(numb + 1)] then return end