]> git.lizzy.rs Git - Crafter.git/blobdiff - mods/main/saplings.lua
remove server debug
[Crafter.git] / mods / main / saplings.lua
index db0eb36b8166377ce574681fe9a6d2ebb54dfd3f..436d68aa932df751dbe2fb76279b3520ad8dd8c7 100644 (file)
@@ -21,9 +21,18 @@ local function sapling_grow(pos)
                end
                if good_to_grow == true then
                        minetest.set_node(pos,{name="main:tree"})
-                       minetest.place_schematic(pos, treeSchematic,"0",nil,false,"place_center_x, place_center_z")
+                       local schemmy = math.random(1,2)
+                       if schemmy == 1 then
+                               minetest.place_schematic(pos, tree_big,"0",nil,false,"place_center_x, place_center_z")
+                       elseif schemmy == 2 then
+                               minetest.place_schematic(pos, tree_small,"0",nil,false,"place_center_x, place_center_z")
+                       end
                        --override leaves
-                       for i = 1,4 do
+                       local max = 3
+                       if schemmy == 2 then
+                               max = 1
+                       end
+                       for i = 1,max do
                                minetest.set_node(vector.new(pos.x,pos.y+i,pos.z),{name="main:tree"})
                        end
                end
@@ -48,7 +57,7 @@ minetest.register_node("main:sapling", {
                type = "fixed",
                fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
        },
-       on_place =  on_rightclick or function(itemstack, placer, pointed_thing)
+       on_place =  function(itemstack, placer, pointed_thing)
                if not pointed_thing.type == "node" then
                        return
                end
@@ -88,7 +97,7 @@ minetest.register_abm({
        nodenames = {"group:sapling"},
        neighbors = {"group:soil"},
        interval = 6,
-       chance = 400,
+       chance = 250,
        catch_up = true,
        action = function(pos)
                sapling_grow(pos)