Aspen trees.
authorAuke Kok <sofar@foo-projects.org>
Tue, 5 Jan 2016 01:56:20 +0000 (17:56 -0800)
committerparamat <mat.gregory@virginmedia.com>
Fri, 15 Jan 2016 04:56:15 +0000 (04:56 +0000)
Adds a birch-like tree to the default_game. Aspen was chosen on
purpose instead of birch, as several birch tree mods already exist
and choosing a different name avoids any conflicts.

Schematics were made for both normal and sapling version, assuring
saplings will not be able to grief. The shape of the Aspen is "fanning
out at the top" and provides an easy tree to walk under, but still a
somewhat thick cover. The Aspen trunk is 4 to 6 blocks tall, with up
to three layers of leaves on top, making it slightly taller than an
Apple tree, but shorter than a Pine tree, which provides a good blend.

Textures were painted from scratch, except tree_top and _wood
variants, which are color modified versions of the pine_wood
variants. Appropriate licenses have been chosen for the new textures.

The leaf texture is light enough to contrast other trees, but dark
enough to offset against our light default grass color. The leaves
are drawn in the typical minetest default fashion with plenty of
transparancy, but enough definition to suggest that you're seeing
something that looks like leaves. The placement of leaves in the
schematic also suggests the top of the tree is sparse and you can
see the sky through the leaves.

Sapling texture is both traditional and different, with lush green
leaves and a well-defined stem, but slightly stick-like and skinny,
as these plants tend to grow up first, then out.

Add fallen Aspen logs. We make these logs a minimum of 2 blocks long,
and up to 3. This allows us to make these logs a place where both
red and brown mushrooms can be found, to these may be attractive to
players. However, the spawn rate for these has been reduced a lot
compared to the other logs, to account for the scarcity of Aspen.

Add stairs, slabs for these wood types as well.

Mapgen will place these trees in deciduous forests only, but in
a way that the biome is a range between entirely Apple trees, and
mostly entirely Aspen trees, with a bias to Apple trees. To make
fallen logs somewhat correlated with trees, we modify the planting
of Apple trees and logs to use perlin noise and not fill ratio,
otherwise you'd always end up with Apple logs in Aspen tree areas,
which would be suspicious. There still is a bit of a mix.

13 files changed:
mods/default/README.txt
mods/default/crafting.lua
mods/default/mapgen.lua
mods/default/nodes.lua
mods/default/schematics/aspen_tree.mts [new file with mode: 0644]
mods/default/schematics/aspen_tree_from_sapling.mts [new file with mode: 0644]
mods/default/textures/default_aspen_leaves.png [new file with mode: 0644]
mods/default/textures/default_aspen_sapling.png [new file with mode: 0644]
mods/default/textures/default_aspen_tree.png [new file with mode: 0644]
mods/default/textures/default_aspen_tree_top.png [new file with mode: 0644]
mods/default/textures/default_aspen_wood.png [new file with mode: 0644]
mods/default/trees.lua
mods/stairs/init.lua

index 5b07a36ca8c4ea792fa0b453f66df62bf51ea199..c190cee0c8b20ef53f82db9b1a35302fda29ce6f 100644 (file)
@@ -150,6 +150,11 @@ BlockMen (CC BY-SA 3.0):
 
 sofar (CC BY-SA 3.0):
   default_book_written.png, based on default_book.png
+  default_aspen_sapling
+  default_aspen_leaves
+  default_aspen_tree
+  default_aspen_tree_top, derived from default_pine_tree_top (by paramat)
+  default_aspen_wood, derived from default_pine_wood (by paramat)
 
 Neuromancer (CC BY-SA 2.0):
   default_cobble.png, based on texture by Brane praefect
index fa8df2d6312ebdcda3acaa92a015e08ba4e4b913..b470d0d42731a0151f05d5f3b4975bac784f0a6c 100644 (file)
@@ -28,6 +28,13 @@ minetest.register_craft({
        }
 })
 
+minetest.register_craft({
+       output = 'default:aspen_wood 4',
+       recipe = {
+               {'default:aspen_tree'},
+       }
+})
+
 minetest.register_craft({
        output = 'default:stick 4',
        recipe = {
index 0411bcaa3c7db289975d7eeb1474d04fcf5620f5..c92514cf4e72b26e125c7fa5afbdced44912ddd2 100644 (file)
@@ -991,8 +991,15 @@ function default.register_decorations()
        minetest.register_decoration({
                deco_type = "schematic",
                place_on = {"default:dirt_with_grass"},
-               sidelen = 80,
-               fill_ratio = 0.0015,
+               sidelen = 16,
+               noise_params = {
+                       offset = 0.002,
+                       scale = 0.001,
+                       spread = {x = 250, y = 250, z = 250},
+                       seed = 2,
+                       octaves = 3,
+                       persist = 0.66
+               },
                biomes = {"deciduous_forest"},
                y_min = 1,
                y_max = 31000,
@@ -1154,6 +1161,60 @@ function default.register_decorations()
                rotation = "random",
        })
 
+       -- Aspen tree and log
+
+       minetest.register_decoration({
+               deco_type = "schematic",
+               place_on = {"default:dirt_with_grass"},
+               sidelen = 16,
+               noise_params = {
+                       offset = 0.01,
+                       scale = -0.02,
+                       spread = {x = 250, y = 250, z = 250},
+                       seed = 2,
+                       octaves = 3,
+                       persist = 0.66
+               },
+               biomes = {"deciduous_forest"},
+               y_min = 1,
+               y_max = 31000,
+               schematic = minetest.get_modpath("default").."/schematics/aspen_tree.mts",
+               flags = "place_center_x, place_center_z",
+               rotation = "random",
+       })
+
+       minetest.register_decoration({
+               deco_type = "schematic",
+               place_on = {"default:dirt_with_grass"},
+               sidelen = 16,
+               noise_params = {
+                       offset = 0.0005,
+                       scale = -0.001,
+                       spread = {x = 250, y = 250, z = 250},
+                       seed = 2,
+                       octaves = 3,
+                       persist = 0.66
+               },
+               biomes = {"deciduous_forest"},
+               y_min = 1,
+               y_max = 31000,
+               schematic = {
+                       size = { x = 3, y = 3, z = 1},
+                       data = {
+                               { name = "air", prob = 0 },
+                               { name = "air", prob = 0 },
+                               { name = "air", prob = 0 },
+                               { name = "default:aspen_tree", param2 = 12 },
+                               { name = "default:aspen_tree", param2 = 12 },
+                               { name = "default:aspen_tree", param2 = 12, prob = 127 },
+                               { name = "flowers:mushroom_red", prob = 63 },
+                               { name = "flowers:mushroom_brown", prob = 63 },
+                               { name = "air", prob = 0 },
+                       },
+               },
+               flags = "place_center_x",
+               rotation = "random",
+       })
        -- Large cactus
 
        minetest.register_decoration({
index aecbd35784b570b4d2178a7ba555ac665f792084..62d0ec93ddb18a1c715d5dee589afe62c6ea780c 100644 (file)
@@ -78,6 +78,10 @@ default:acacia_wood
 default:acacia_leaves
 default:acacia_sapling
 
+default:aspen_tree
+default:aspen_wood
+default:aspen_leaves
+default:aspen_sapling
 Ores
 ----
 (1. In stone 2. Block)
@@ -686,6 +690,65 @@ minetest.register_node("default:acacia_sapling", {
        sounds = default.node_sound_leaves_defaults(),
 })
 
+minetest.register_node("default:aspen_tree", {
+       description = "Aspen Tree",
+       tiles = {"default_aspen_tree_top.png", "default_aspen_tree_top.png",
+               "default_aspen_tree.png"},
+       paramtype2 = "facedir",
+       is_ground_content = false,
+       groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
+       sounds = default.node_sound_wood_defaults(),
+
+       on_place = minetest.rotate_node
+})
+
+minetest.register_node("default:aspen_wood", {
+       description = "Aspen Wood Planks",
+       tiles = {"default_aspen_wood.png"},
+       is_ground_content = false,
+       groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
+       sounds = default.node_sound_wood_defaults(),
+})
+
+minetest.register_node("default:aspen_leaves", {
+       description = "Aspen Leaves",
+       drawtype = "allfaces_optional",
+       visual_scale = 1.3,
+       tiles = {"default_aspen_leaves.png"},
+       waving = 1,
+       paramtype = "light",
+       is_ground_content = false,
+       groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
+       drop = {
+               max_items = 1,
+               items = {
+                       {items = {"default:aspen_sapling"}, rarity = 20},
+                       {items = {"default:aspen_leaves"}}
+               }
+       },
+       sounds = default.node_sound_leaves_defaults(),
+
+       after_place_node = default.after_place_leaves,
+})
+
+minetest.register_node("default:aspen_sapling", {
+       description = "Aspen Tree Sapling",
+       drawtype = "plantlike",
+       visual_scale = 1.0,
+       tiles = {"default_aspen_sapling.png"},
+       inventory_image = "default_aspen_sapling.png",
+       wield_image = "default_aspen_sapling.png",
+       paramtype = "light",
+       sunlight_propagates = true,
+       walkable = false,
+       selection_box = {
+               type = "fixed",
+               fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
+       },
+       groups = {snappy = 2, dig_immediate = 3, flammable = 2,
+               attached_node = 1, sapling = 1},
+       sounds = default.node_sound_leaves_defaults(),
+})
 --
 -- Ores
 --
diff --git a/mods/default/schematics/aspen_tree.mts b/mods/default/schematics/aspen_tree.mts
new file mode 100644 (file)
index 0000000..fe54f67
Binary files /dev/null and b/mods/default/schematics/aspen_tree.mts differ
diff --git a/mods/default/schematics/aspen_tree_from_sapling.mts b/mods/default/schematics/aspen_tree_from_sapling.mts
new file mode 100644 (file)
index 0000000..6bf0f18
Binary files /dev/null and b/mods/default/schematics/aspen_tree_from_sapling.mts differ
diff --git a/mods/default/textures/default_aspen_leaves.png b/mods/default/textures/default_aspen_leaves.png
new file mode 100644 (file)
index 0000000..17a708d
Binary files /dev/null and b/mods/default/textures/default_aspen_leaves.png differ
diff --git a/mods/default/textures/default_aspen_sapling.png b/mods/default/textures/default_aspen_sapling.png
new file mode 100644 (file)
index 0000000..f8d9136
Binary files /dev/null and b/mods/default/textures/default_aspen_sapling.png differ
diff --git a/mods/default/textures/default_aspen_tree.png b/mods/default/textures/default_aspen_tree.png
new file mode 100644 (file)
index 0000000..933b9ca
Binary files /dev/null and b/mods/default/textures/default_aspen_tree.png differ
diff --git a/mods/default/textures/default_aspen_tree_top.png b/mods/default/textures/default_aspen_tree_top.png
new file mode 100644 (file)
index 0000000..fcca038
Binary files /dev/null and b/mods/default/textures/default_aspen_tree_top.png differ
diff --git a/mods/default/textures/default_aspen_wood.png b/mods/default/textures/default_aspen_wood.png
new file mode 100644 (file)
index 0000000..d16fdc9
Binary files /dev/null and b/mods/default/textures/default_aspen_wood.png differ
index 51a7a2e6d832cc5f42975aec2581fb32c7731fe7..48718e5d2d80444ac7e32326523ce69446ecd156 100644 (file)
@@ -28,7 +28,8 @@ end
 
 minetest.register_abm({
        nodenames = {"default:sapling", "default:junglesapling",
-               "default:pine_sapling", "default:acacia_sapling"},
+               "default:pine_sapling", "default:acacia_sapling",
+               "default:aspen_sapling"},
        interval = 10,
        chance = 50,
        action = function(pos, node)
@@ -65,6 +66,10 @@ minetest.register_abm({
                        minetest.log("action", "An acacia sapling grows into a tree at "..
                                minetest.pos_to_string(pos))
                        default.grow_new_acacia_tree(pos)
+               elseif node.name == "default:aspen_sapling" then
+                       minetest.log("action", "An aspen sapling grows into a tree at "..
+                               minetest.pos_to_string(pos))
+                       default.grow_new_aspen_tree(pos)
                end
        end
 })
@@ -395,3 +400,11 @@ function default.grow_new_acacia_tree(pos)
        minetest.place_schematic({x = pos.x - 4, y = pos.y - 1, z = pos.z - 4},
                path, random, nil, false)
 end
+
+-- New aspen tree
+
+function default.grow_new_aspen_tree(pos)
+       local path = minetest.get_modpath("default") .. "/schematics/aspen_tree_from_sapling.mts"
+       minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
+               path, 0, nil, false)
+end
index b3e09937fef19e2e470bc37927ec509c6b39b9ad..c3ce160e8b45e8954783406f09a8ad641d96ed4a 100644 (file)
@@ -287,6 +287,13 @@ stairs.register_stair_and_slab("acacia_wood", "default:acacia_wood",
                "Acacia Wood Slab",
                default.node_sound_wood_defaults())
 
+stairs.register_stair_and_slab("aspen_wood", "default:aspen_wood",
+               {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
+               {"default_aspen_wood.png"},
+               "Aspen Wood Stair",
+               "Aspen Wood Slab",
+               default.node_sound_wood_defaults())
+
 stairs.register_stair_and_slab("stone", "default:stone",
                {cracky = 3},
                {"default_stone.png"},