Don't regenerate placed rubber tree trunks

This commit is contained in:
ShadowNinja 2013-11-27 17:14:34 -05:00
parent a35db449b3
commit 05b28f553e

View File

@ -24,17 +24,21 @@ minetest.register_node(":moretrees:rubber_tree_trunk", {
"technic_rubber_tree_full.png"}, "technic_rubber_tree_full.png"},
groups = {tree=1, snappy=1, choppy=2, oddly_breakable_by_hand=1, groups = {tree=1, snappy=1, choppy=2, oddly_breakable_by_hand=1,
flammable=2}, flammable=2},
drop = "default:tree", drop = "moretrees:rubber_tree_trunk_empty",
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
}) })
minetest.register_node(":moretrees:rubber_tree_trunk_empty", { minetest.register_node(":moretrees:rubber_tree_trunk_empty", {
description = "Rubber Tree",
tiles = {"default_tree_top.png", "default_tree_top.png", tiles = {"default_tree_top.png", "default_tree_top.png",
"technic_rubber_tree_empty.png"}, "technic_rubber_tree_empty.png"},
groups = {tree=1, snappy=1, choppy=2, oddly_breakable_by_hand=1, groups = {tree=1, snappy=1, choppy=2, oddly_breakable_by_hand=1,
flammable=2, not_in_creative_inventory=1}, flammable=2, not_in_creative_inventory=1},
drop = "default:tree",
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
after_place_node = function(pos, placer, itemstack)
local meta = minetest.get_meta(pos)
meta:set_int("placed", 1)
end,
}) })
minetest.register_abm({ minetest.register_abm({
@ -42,13 +46,16 @@ minetest.register_abm({
interval = 60, interval = 60,
chance = 15, chance = 15,
action = function(pos, node) action = function(pos, node)
local meta = minetest.get_meta(pos)
if meta:get_int("placed") ~= 0 then
return
end
minetest.set_node(pos, {name="moretrees:rubber_tree_trunk"}) minetest.set_node(pos, {name="moretrees:rubber_tree_trunk"})
end end
}) })
minetest.register_node(":moretrees:rubber_tree_leaves", { minetest.register_node(":moretrees:rubber_tree_leaves", {
drawtype = "allfaces_optional", drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"technic_rubber_leaves.png"}, tiles = {"technic_rubber_leaves.png"},
paramtype = "light", paramtype = "light",
groups = {snappy=3, leafdecay=3, flammable=2, not_in_creative_inventory=1}, groups = {snappy=3, leafdecay=3, flammable=2, not_in_creative_inventory=1},