fix register_plant() growth issue

This commit is contained in:
TenPlus1 2018-05-19 15:39:49 +01:00
parent b9a9a8e8d8
commit 3176cd5127
2 changed files with 10 additions and 8 deletions

View File

@ -13,7 +13,7 @@ This mod works by adding your new plant to the {growing=1} group and numbering t
Changelog: Changelog:
1.36 - Added Beetroot, Beetroot Soup (6x beetroot, 1x bowl) 1.36 - Added Beetroot, Beetroot Soup (6x beetroot, 1x bowl), fix register_plant() issue
1.35 - Deprecated bronze/mese/diamond hoe's, added hoe bomb and deprecated hoe's as lucky block prizes 1.35 - Deprecated bronze/mese/diamond hoe's, added hoe bomb and deprecated hoe's as lucky block prizes
1.34 - Added scarecrow Base (5x sticks in a cross shape) 1.34 - Added scarecrow Base (5x sticks in a cross shape)
1.33 - Added cooking utensils (wooden bowl, saucepan, cooking pot, baking tray, skillet, cutting board, mortar & pestle, juicer, glass mixing bowl) for easier food crafts. 1.33 - Added cooking utensils (wooden bowl, saucepan, cooking pot, baking tray, skillet, cutting board, mortar & pestle, juicer, glass mixing bowl) for easier food crafts.

View File

@ -7,7 +7,7 @@
farming = {} farming = {}
farming.mod = "redo" farming.mod = "redo"
farming.version = "20180506" farming.version = "20180519"
farming.path = minetest.get_modpath("farming") farming.path = minetest.get_modpath("farming")
farming.select = { farming.select = {
type = "fixed", type = "fixed",
@ -273,15 +273,16 @@ minetest.after(0, function()
end) end)
local abm_func = farming.handle_growth
-- Just in case a growing type or added node is missed (also catches existing -- Just in case a growing type or added node is missed (also catches existing
-- nodes added to map before timers were incorporated). -- nodes added to map before timers were incorporated).
minetest.register_abm({ minetest.register_abm({
nodenames = { "group:growing" }, nodenames = { "group:growing" },
interval = 300, interval = 300,
chance = 1, 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.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}) 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 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, inventory_image = def.inventory_image,
wield_image = def.inventory_image, wield_image = def.inventory_image,
drawtype = "signlike", drawtype = "signlike",
groups = {seed = 1, snappy = 3, attached_node = 1}, groups = {seed = 1, snappy = 3, attached_node = 1, flammable = 2},
paramtype = "light", paramtype = "light",
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
walkable = false, walkable = false,
@ -559,6 +562,7 @@ farming.register_plant = function(name, def)
place_param2 = def.place_param2, place_param2 = def.place_param2,
walkable = false, walkable = false,
buildable_to = true, buildable_to = true,
sunlight_propagates = true,
drop = drop, drop = drop,
selection_box = farming.select, selection_box = farming.select,
groups = g, groups = g,
@ -567,8 +571,6 @@ farming.register_plant = function(name, def)
maxlight = def.maxlight, maxlight = def.maxlight,
next_plant = next_plant, next_plant = next_plant,
}) })
register_plant_node(node_name)
end end
-- Return info -- Return info