local setdir = false
local facings = {}
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)
minetest.chat_send_player(placer:get_player_name(), "placed "..newnode.name)
if facings[newnode.name] then
newnode.param2 = facings[newnode.name]
minetest.swap_node(pos, newnode)
end
end)
minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing)
if setdir then
facings[node.name] = node.param2
setdir = false
minetest.chat_send_player(puncher:get_player_name(), node.name..".param2 = "..node.param2)
end
end)
minetest.register_chatcommand("dir", {
params = "<mode>",
description = "Keep a direction / facing / heading",
func = function(name, param)
if param == "set" then setdir = true
elseif param == "clear" then facings = {} end
end
})
VanessaE wrote:If this is a bug anywhere, it would have to be in moreblocks/stairsplus, as moretrees does not define anything regarding slabs/stairs except what is done by moreblocks.
VanessaE wrote:Stairsplus nodes are not supposed to show up in your creative inventory - if they did, it would bloat it to as much as 100 pages' worth of stuff, depending on the game you're playing (Dreambuilder, for example has over 7000 registered nodes/items, a couple thousand of which are stairs/slabs/etc).
VanessaE wrote:That aside, I'm unsure why your code isn't working.
VanessaE wrote:Have you tried Sokomine's "replacer" mod? It does a job similar so what it looks like you're trying to do here (except it replaces the node rather than just setting its facedir).
diff --git a/leafdecay.lua b/leafdecay.lua
index 9d771d7..3f8a1dd 100644
--- a/leafdecay.lua
+++ b/leafdecay.lua
@@ -84,6 +84,21 @@ if moretrees.enable_default_leafdecay then
nodeupdate(pos)
end
})
+
+ -- Decay apple tree blossoms from nature_classic mod
+ if minetest.get_modpath("nature_classic") then
+ minetest.register_abm({
+ nodenames = "moretrees:apple_blossoms",
+ interval = moretrees.default_leafdecay_delay,
+ chance = moretrees.default_leafdecay_chance,
+ action = function(pos, node, active_object_count, active_object_count_wider)
+ if minetest.find_node_near(pos, moretrees.leafdecay_radius, { "ignore", "moretrees:apple_tree_trunk" }) then return end
+ process_drops(pos, "moretrees:apple_tree_leaves")
+ minetest.remove_node(pos)
+ nodeupdate(pos)
+ end
+ })
+ end
end
if moretrees.enable_default_jungle_leafdecay then
4aiman, post: 1625, member: 49 wrote:FM does have it, but sometimes minetest.env produces following error: "operation on bad self" (or smth like that).
Instead of [icode]minetest.env:some_func_call(...)[/icode] one should use [icode]minetest.some_func_call(...)[/icode] then all works like it should.
[icode]minetest.env[/icode] is deprecated even in MT, so the bug probably origins from there, although I didn't check.
There was smth else, but I've forgotten the details. Maybe current version is updated? Then I'm spreading nonsence.
VanessaE wrote:I haven't the foggiest idea what he's talking about, Inocudom. That post you quoted simply made no sense. Neither moretrees nor plantlife modpack contain any uses of that old minetest.env method.
-- Enable this one if you want this mod's leafdecay code to affect the old
-- default trees too; this setting is independent of the one above. You'll
-- want to manually disable the default leafdecay code in minetest_game if
-- you enable this, otherwise you'll have two sets of leaf decay code running
-- at the same time, which will just waste CPU for no benefit.
moretrees.enable_default_leafdecay = true
Minetestforfun wrote:Hi VanessaE,
Sometimes, i found this strange trees, i don't know how i can fix it... Have you an idea ? (it's like the water in generate after the tree, and erase "the parts of the tree in water")
+ Spoiler
VanessaE wrote:<snip all>
for _, object in ipairs(minetest.get_objects_inside_radius(playerPosition, 3)) do
for _, object in ipairs(minetest.get_objects_inside_radius(playerPosition, attractRadius)) do
Users browsing this forum: No registered users and 40 guests