summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2018-05-19 15:39:49 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2018-05-19 15:39:49 +0100
commit3176cd51279a3b150ea39e2e90e4a7aa31b73dc8 (patch)
tree7bcd2b5830b63d65574d840b58152f6e884131d9 /init.lua
parentb9a9a8e8d8cb053f884a420ef7b67aea36b41b91 (diff)
fix register_plant() growth issue
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua16
1 files changed, 9 insertions, 7 deletions
diff --git a/init.lua b/init.lua
index fa0c532..43e70fe 100644
--- a/init.lua
+++ b/init.lua
@@ -7,7 +7,7 @@
farming = {}
farming.mod = "redo"
-farming.version = "20180506"
+farming.version = "20180519"
farming.path = minetest.get_modpath("farming")
farming.select = {
type = "fixed",
@@ -273,15 +273,16 @@ minetest.after(0, function()
end)
-local abm_func = farming.handle_growth
-
-- Just in case a growing type or added node is missed (also catches existing
-- nodes added to map before timers were incorporated).
minetest.register_abm({
nodenames = { "group:growing" },
interval = 300,
chance = 1,
- action = abm_func
+ catch_up = false,
+ action = function(pos, node)
+ farming.handle_growth(pos, node)
+ end
})
@@ -445,6 +446,8 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname)
minetest.set_node(pt.above, {name = plantname, param2 = p2})
+--minetest.get_node_timer(pt.above):start(1)
+
minetest.sound_play("default_place_node", {pos = pt.above, gain = 1.0})
if not placer or not farming.is_creative(placer:get_player_name()) then
@@ -494,7 +497,7 @@ farming.register_plant = function(name, def)
inventory_image = def.inventory_image,
wield_image = def.inventory_image,
drawtype = "signlike",
- groups = {seed = 1, snappy = 3, attached_node = 1},
+ groups = {seed = 1, snappy = 3, attached_node = 1, flammable = 2},
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
@@ -559,6 +562,7 @@ farming.register_plant = function(name, def)
place_param2 = def.place_param2,
walkable = false,
buildable_to = true,
+ sunlight_propagates = true,
drop = drop,
selection_box = farming.select,
groups = g,
@@ -567,8 +571,6 @@ farming.register_plant = function(name, def)
maxlight = def.maxlight,
next_plant = next_plant,
})
-
- register_plant_node(node_name)
end
-- Return info