From: ShadowNinja Date: Wed, 27 Nov 2013 22:14:34 +0000 (-0500) Subject: Don't regenerate placed rubber tree trunks X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=05b28f553e29db491720b2763624a07da8ebbda3;p=zefram%2Fminetest%2Ftechnic.git Don't regenerate placed rubber tree trunks --- diff --git a/technic_worldgen/rubber.lua b/technic_worldgen/rubber.lua index 370d40e..8e47849 100644 --- a/technic_worldgen/rubber.lua +++ b/technic_worldgen/rubber.lua @@ -24,17 +24,21 @@ minetest.register_node(":moretrees:rubber_tree_trunk", { "technic_rubber_tree_full.png"}, groups = {tree=1, snappy=1, choppy=2, oddly_breakable_by_hand=1, flammable=2}, - drop = "default:tree", + drop = "moretrees:rubber_tree_trunk_empty", sounds = default.node_sound_wood_defaults(), }) minetest.register_node(":moretrees:rubber_tree_trunk_empty", { + description = "Rubber Tree", tiles = {"default_tree_top.png", "default_tree_top.png", "technic_rubber_tree_empty.png"}, groups = {tree=1, snappy=1, choppy=2, oddly_breakable_by_hand=1, flammable=2, not_in_creative_inventory=1}, - drop = "default:tree", 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({ @@ -42,13 +46,16 @@ minetest.register_abm({ interval = 60, chance = 15, 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"}) end }) minetest.register_node(":moretrees:rubber_tree_leaves", { drawtype = "allfaces_optional", - visual_scale = 1.3, tiles = {"technic_rubber_leaves.png"}, paramtype = "light", groups = {snappy=3, leafdecay=3, flammable=2, not_in_creative_inventory=1},