summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authortenplus1 <kinsellaja@yahoo.com>2015-01-20 18:46:37 +0000
committertenplus1 <kinsellaja@yahoo.com>2015-01-20 18:46:37 +0000
commit55b9244bc749f8b27ec278b0ecc0ed372349a623 (patch)
treef5379dc3b3339739d880c3e0bf756146d6c40c9a /init.lua
parent5f8f62356e64f0a4ee8949159b112c06e71b0c54 (diff)
Streamlined growing abm
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua9
1 files changed, 3 insertions, 6 deletions
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