diff --git a/minetestforfun_game/mods/default/trees.lua b/minetestforfun_game/mods/default/trees.lua index dda0c081..e1b9d3e1 100755 --- a/minetestforfun_game/mods/default/trees.lua +++ b/minetestforfun_game/mods/default/trees.lua @@ -157,6 +157,7 @@ local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid, end end +default.add_trunk_and_leaves = add_trunk_and_leaves -- MFF edit 2016-08-21 -- Apple tree diff --git a/mods/mff/mff_classic/abms.lua b/mods/mff/mff_classic/abms.lua index f5bab914..a4f2c5b9 100644 --- a/mods/mff/mff_classic/abms.lua +++ b/mods/mff/mff_classic/abms.lua @@ -1,7 +1,8 @@ local modname = minetest.get_current_modname() +local thismod = _G[modname] minetest.register_abm({ - nodenames = {'default:cherry_sapling', modname .. 'mg_cherry_sapling'}, + nodenames = {modname .. ':cherry_sapling', modname .. 'mg_cherry_sapling'}, interval = 80, chance = 3, action = function(pos, node) @@ -14,6 +15,6 @@ minetest.register_abm({ end minetest.remove_node({x=pos.x, y=pos.y, z=pos.z}) - default.grow_cherry_tree(pos, false, 'default:cherry_tree', 'default:cherry_blossom_leaves') + thismod.grow_cherry_tree(pos, false, modname .. ':cherry_tree', modname .. ':cherry_blossom_leaves') end, }) diff --git a/mods/mff/mff_classic/mapgen.lua b/mods/mff/mff_classic/mapgen.lua index d0a425ac..38baaf7f 100644 --- a/mods/mff/mff_classic/mapgen.lua +++ b/mods/mff/mff_classic/mapgen.lua @@ -224,7 +224,7 @@ function thismod.generate_nyancats(minp, maxp, seed) local y0 = pr:next(minp.y, maxp.y) local z0 = pr:next(minp.z, maxp.z) local p0 = {x = x0, y = y0, z = z0} - default.make_nyancat(p0, pr:next(0, 3), pr:next(10, 15)) + thismod.make_nyancat(p0, pr:next(0, 3), pr:next(10, 15)) end end end diff --git a/mods/mff/mff_classic/trees.lua b/mods/mff/mff_classic/trees.lua index 49b9aeff..67b588ed 100644 --- a/mods/mff/mff_classic/trees.lua +++ b/mods/mff/mff_classic/trees.lua @@ -1,4 +1,5 @@ local modname = minetest.get_current_modname() +local thismod = _G[modname] -- From BFD: @@ -24,7 +25,7 @@ minetest.register_on_generated(function(minp, maxp, seed) local p_pos = area:index(x,y,z) local content_id = data[p_pos] if content_id == c_mg_cherry_sapling then - minetest.after(1, default.grow_cherry_tree, + minetest.after(1, thismod.grow_cherry_tree, {x=x, y=y, z=z}, false, modname .. ':cherry_tree', @@ -40,7 +41,7 @@ minetest.register_on_generated(function(minp, maxp, seed) minetest.log('action', trees_grown..geninfo) end) -function default.grow_cherry_tree(pos, is_apple_tree, trunk_node, leaves_node) +function thismod.grow_cherry_tree(pos, is_apple_tree, trunk_node, leaves_node) --[[ NOTE: Tree-placing code is currently duplicated in the engine and in games that have saplings; both are deprecated but not @@ -60,7 +61,7 @@ function default.grow_cherry_tree(pos, is_apple_tree, trunk_node, leaves_node) local a = VoxelArea:new({MinEdge = minp, MaxEdge = maxp}) local data = vm:get_data() - add_trunk_and_leaves(data, a, pos, c_tree, c_leaves, height, 2, 8, is_apple_tree) + default.add_trunk_and_leaves(data, a, pos, c_tree, c_leaves, height, 2, 8, is_apple_tree) vm:set_data(data) vm:write_to_map()