diff --git a/mods/default/craftitems.lua b/mods/default/craftitems.lua index d036144..0a90df3 100644 --- a/mods/default/craftitems.lua +++ b/mods/default/craftitems.lua @@ -1,6 +1,39 @@ -minetest.register_craftitem("default:string", { +minetest.register_node("default:string", { description = "String", - inventory_image = "default_string.png", + tiles = {"default_string_top.png", "default_string_top.png", "default_string.png"}, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = { + {-2/16, -3/16, -2/16, 2/16, 4/16, 2/16}, + {-3/16, -4/16, -3/16, 3/16, -3/16, 3/16}, + {-3/16, 4/16, -3/16, 3/16, 5/16, 3/16} + } + }, + placeable = false, + groups = {cracky = 3, snappy = 3}, + on_place = minetest.rotate_and_place, +}) + +minetest.register_node("default:string_strong", { + description = "Strong String", + tiles = {"default_string_top.png", "default_string_top.png", "default_string_strong.png"}, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = { + {-2/16, -3/16, -2/16, 2/16, 4/16, 2/16}, + {-3/16, -4/16, -3/16, 3/16, -3/16, 3/16}, + {-3/16, 4/16, -3/16, 3/16, 5/16, 3/16} + } + }, + placeable = false, + groups = {cracky = 3, snappy = 3}, + on_place = minetest.rotate_and_place, }) minetest.register_craftitem("default:stone_item", { @@ -34,12 +67,6 @@ minetest.register_craftitem("default:ruby", { inventory_image = "default_ruby.png", }) - -minetest.register_craftitem("default:string_strong", { - description = "Strong String", - inventory_image = "default_string_strong.png", -}) - minetest.register_craftitem("default:stick", { description = "Stick", inventory_image = "default_stick.png", diff --git a/mods/default/init.lua b/mods/default/init.lua index d4bcf7d..7eaf433 100644 --- a/mods/default/init.lua +++ b/mods/default/init.lua @@ -5,6 +5,7 @@ local modpath = minetest.get_modpath("default") dofile(modpath.."/functions.lua") dofile(modpath.."/player.lua") dofile(modpath.."/craftitems.lua") +dofile(modpath.."/trees.lua") dofile(modpath.."/nodes.lua") dofile(modpath.."/tools.lua") dofile(modpath.."/craft.lua") diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index 05db422..e4265b3 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -299,185 +299,8 @@ minetest.register_node("default:water_flowing", { post_effect_color = {a=100, r=0, g=64, b=200}, }) --- wood - -minetest.register_node("default:wood", { - description = "Wood", - tiles = {"default_wood.png"}, - groups = {choppy = 3}, - sounds = default.sounds.wood(), -}) - -minetest.register_node("default:wooden_planks", { - description = "Wooden Planks", - tiles = {"default_wooden_planks.png"}, - groups = {choppy = 3}, - sounds = default.sounds.wood(), -}) - -minetest.register_node("default:wooden_planks_2", { - description = "Wooden Planks", - tiles = {"default_wooden_planks_2.png"}, - groups = {choppy = 3}, - sounds = default.sounds.wood(), -}) - -minetest.register_node("default:jungle_wood", { - description = "Jungle Wood", - tiles = {"default_jungle_wood.png"}, - groups = {choppy = 3}, - sounds = default.sounds.wood(), -}) - -minetest.register_node("default:wooden_planks_jungle", { - description = "Wooden Planks (Jungle wood)", - tiles = {"default_wooden_planks_jungle.png"}, - groups = {choppy = 3}, - sounds = default.sounds.wood(), -}) - -minetest.register_node("default:wooden_planks_2_jungle", { - description = "Wooden Planks (Jungle wood)", - tiles = {"default_wooden_planks_2_jungle.png"}, - groups = {choppy = 3}, - sounds = default.sounds.wood(), -}) - --- log - -minetest.register_node("default:log", { - description = "Log", - tiles = {"default_log_top.png","default_log_top.png","default_log.png"}, - groups = {choppy = 3}, - sounds = default.sounds.wood(), - paramtype2 = "facedir", - on_place = minetest.rotate_and_place, -}) - -minetest.register_node("default:log_1", { - description = "Log (thick)", - tiles = {"default_log_top.png","default_log_top.png","default_log.png"}, - groups = {choppy = 3}, - paramtype = "light", - paramtype2 = "facedir", - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-6/16, -0.5, -6/16, 6/16, 0.5, 6/16}, - }, - }, - sounds = default.sounds.wood(), - paramtype2 = "facedir", - on_place = minetest.rotate_and_place, -}) - -minetest.register_node("default:log_2", { - description = "Log", - tiles = {"default_log_top.png","default_log_top.png","default_log.png"}, - groups = {choppy = 3}, - paramtype = "light", - paramtype2 = "facedir", - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-4/16, -0.5, -4/16, 4/16, 0.5, 4/16}, - }, - }, - sounds = default.sounds.wood(), - paramtype2 = "facedir", - on_place = minetest.rotate_and_place, -}) - -minetest.register_node("default:log_3", { - description = "Log (thin)", - tiles = {"default_log_top.png","default_log_top.png","default_log.png"}, - groups = {choppy = 3}, - paramtype = "light", - paramtype2 = "facedir", - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-2/16, -0.5, -2/16, 2/16, 0.5, 2/16}, - }, - }, - sounds = default.sounds.wood(), - paramtype2 = "facedir", - on_place = minetest.rotate_and_place, -}) - -minetest.register_node("default:jungle_tree", { - description = "Jungle Tree", - tiles = {"default_jungle_tree_top.png", "default_jungle_tree_top.png", "default_jungle_tree.png"}, - groups = {choppy = 3}, - sounds = default.sounds.wood(), - paramtype2 = "facedir", - on_place = minetest.rotate_and_place, -}) - -- plants -minetest.register_node("default:sapling", { - description = "Sapling", - tiles = {"default_sapling.png"}, - drawtype = "plantlike", - paramtype = "light", - inventory_image = "default_sapling.png", - buildable_to = true, - walkable = false, - groups = {crumbly = 3, sapling = 1}, - selection_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}, - }, -}) - -minetest.register_abm({ - nodenames = {"default:sapling"}, - neighbors = {"default:grass", "default:dirt"}, - interval = 1.0, - chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - minetest.set_node(pos, {name = "air"}) - if math.random(2) == 1 then - local path = minetest.get_modpath("default") .. "/schematics/tree2.mts" - minetest.place_schematic({x = pos.x - 1, y = pos.y - 0, z = pos.z - 1}, path, 0, nil, false) - else - local path = minetest.get_modpath("default") .. "/schematics/tree1.mts" - minetest.place_schematic({x = pos.x - 2, y = pos.y - 0, z = pos.z - 2}, path, 0, nil, false) - end - end, -}) - -minetest.register_node("default:sapling_2", { - description = "Sapling", - tiles = {"default_sapling_2.png"}, - drawtype = "plantlike", - paramtype = "light", - inventory_image = "default_sapling_2.png", - buildable_to = true, - walkable = false, - groups = {crumbly = 3, sapling = 1}, - selection_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}, - }, -}) - -minetest.register_abm({ - nodenames = {"default:sapling_2"}, - neighbors = {"default:grass", "default:dirt"}, - interval = 1.0, - chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - minetest.set_node(pos, {name = "air"}) - local path = minetest.get_modpath("default") .. "/schematics/pinetree1.mts" - minetest.place_schematic({x = pos.x - 2, y = pos.y - 0, z = pos.z - 2}, path, 0, nil, false) - end, -}) - minetest.register_node("default:plant_grass", { description = "Grass (Plant)", tiles = {"default_plant_grass.png"}, diff --git a/mods/default/textures/default_log_birch.png b/mods/default/textures/default_log_birch.png new file mode 100644 index 0000000..7c3c3d4 Binary files /dev/null and b/mods/default/textures/default_log_birch.png differ diff --git a/mods/default/textures/default_log_birch_top.png b/mods/default/textures/default_log_birch_top.png new file mode 100644 index 0000000..5f198fa Binary files /dev/null and b/mods/default/textures/default_log_birch_top.png differ diff --git a/mods/default/textures/default_string.png b/mods/default/textures/default_string.png index 3350d0c..a28ec51 100644 Binary files a/mods/default/textures/default_string.png and b/mods/default/textures/default_string.png differ diff --git a/mods/default/textures/default_string_strong.png b/mods/default/textures/default_string_strong.png index b99501b..6f670af 100644 Binary files a/mods/default/textures/default_string_strong.png and b/mods/default/textures/default_string_strong.png differ diff --git a/mods/default/textures/default_string_top.png b/mods/default/textures/default_string_top.png new file mode 100644 index 0000000..cc1a767 Binary files /dev/null and b/mods/default/textures/default_string_top.png differ diff --git a/mods/default/textures/default_wood_birch.png b/mods/default/textures/default_wood_birch.png new file mode 100644 index 0000000..fdaf567 Binary files /dev/null and b/mods/default/textures/default_wood_birch.png differ diff --git a/mods/default/textures/default_wooden_planks_2_birch.png b/mods/default/textures/default_wooden_planks_2_birch.png new file mode 100644 index 0000000..115ddf8 Binary files /dev/null and b/mods/default/textures/default_wooden_planks_2_birch.png differ diff --git a/mods/default/textures/default_wooden_planks_birch.png b/mods/default/textures/default_wooden_planks_birch.png new file mode 100644 index 0000000..43dc847 Binary files /dev/null and b/mods/default/textures/default_wooden_planks_birch.png differ diff --git a/mods/default/trees.lua b/mods/default/trees.lua new file mode 100644 index 0000000..a30104a --- /dev/null +++ b/mods/default/trees.lua @@ -0,0 +1,208 @@ +-- wood + +minetest.register_node("default:wood", { + description = "Wood", + tiles = {"default_wood.png"}, + groups = {choppy = 3}, + sounds = default.sounds.wood(), +}) + +minetest.register_node("default:wooden_planks", { + description = "Wooden Planks", + tiles = {"default_wooden_planks.png"}, + groups = {choppy = 3}, + sounds = default.sounds.wood(), +}) + +minetest.register_node("default:wooden_planks_2", { + description = "Wooden Planks", + tiles = {"default_wooden_planks_2.png"}, + groups = {choppy = 3}, + sounds = default.sounds.wood(), +}) + +minetest.register_node("default:jungle_wood", { + description = "Jungle Wood", + tiles = {"default_jungle_wood.png"}, + groups = {choppy = 3}, + sounds = default.sounds.wood(), +}) + +minetest.register_node("default:wooden_planks_jungle", { + description = "Wooden Planks (Jungle Wood)", + tiles = {"default_wooden_planks_jungle.png"}, + groups = {choppy = 3}, + sounds = default.sounds.wood(), +}) + +minetest.register_node("default:wooden_planks_2_jungle", { + description = "Wooden Planks (Jungle Wood)", + tiles = {"default_wooden_planks_2_jungle.png"}, + groups = {choppy = 3}, + sounds = default.sounds.wood(), +}) + +minetest.register_node("default:birch_wood", { + description = "Birch Wood", + tiles = {"default_wood_birch.png"}, + groups = {choppy = 3}, + sounds = default.sounds.wood(), +}) + +minetest.register_node("default:wooden_planks_jungle", { + description = "Wooden Planks (Birch Wood)", + tiles = {"default_wooden_planks_birch.png"}, + groups = {choppy = 3}, + sounds = default.sounds.wood(), +}) + +minetest.register_node("default:wooden_planks_2_jungle", { + description = "Wooden Planks (Birch Wood)", + tiles = {"default_wooden_planks_2_birch.png"}, + groups = {choppy = 3}, + sounds = default.sounds.wood(), +}) + +-- log + +minetest.register_node("default:log", { + description = "Log", + tiles = {"default_log_top.png","default_log_top.png","default_log.png"}, + groups = {choppy = 3}, + sounds = default.sounds.wood(), + paramtype2 = "facedir", + on_place = minetest.rotate_and_place, +}) + +minetest.register_node("default:log_1", { + description = "Log (thick)", + tiles = {"default_log_top.png","default_log_top.png","default_log.png"}, + groups = {choppy = 3}, + paramtype = "light", + paramtype2 = "facedir", + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-6/16, -0.5, -6/16, 6/16, 0.5, 6/16}, + }, + }, + sounds = default.sounds.wood(), + paramtype2 = "facedir", + on_place = minetest.rotate_and_place, +}) + +minetest.register_node("default:log_2", { + description = "Log", + tiles = {"default_log_top.png","default_log_top.png","default_log.png"}, + groups = {choppy = 3}, + paramtype = "light", + paramtype2 = "facedir", + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-4/16, -0.5, -4/16, 4/16, 0.5, 4/16}, + }, + }, + sounds = default.sounds.wood(), + paramtype2 = "facedir", + on_place = minetest.rotate_and_place, +}) + +minetest.register_node("default:log_3", { + description = "Log (thin)", + tiles = {"default_log_top.png","default_log_top.png","default_log.png"}, + groups = {choppy = 3}, + paramtype = "light", + paramtype2 = "facedir", + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-2/16, -0.5, -2/16, 2/16, 0.5, 2/16}, + }, + }, + sounds = default.sounds.wood(), + paramtype2 = "facedir", + on_place = minetest.rotate_and_place, +}) + +minetest.register_node("default:jungle_tree", { + description = "Jungle Tree", + tiles = {"default_jungle_tree_top.png", "default_jungle_tree_top.png", "default_jungle_tree.png"}, + groups = {choppy = 3}, + sounds = default.sounds.wood(), + paramtype2 = "facedir", + on_place = minetest.rotate_and_place, +}) + +minetest.register_node("default:log_birch", { + description = "Birch Log", + tiles = {"default_log_birch_top.png","default_log_birch_top.png","default_log_birch.png"}, + groups = {choppy = 3}, + sounds = default.sounds.wood(), + paramtype2 = "facedir", + on_place = minetest.rotate_and_place, +}) + +-- saplings + +minetest.register_node("default:sapling", { + description = "Sapling", + tiles = {"default_sapling.png"}, + drawtype = "plantlike", + paramtype = "light", + inventory_image = "default_sapling.png", + buildable_to = true, + walkable = false, + groups = {crumbly = 3, sapling = 1}, + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}, + }, +}) + +minetest.register_abm({ + nodenames = {"default:sapling"}, + neighbors = {"default:grass", "default:dirt"}, + interval = 1.0, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + minetest.set_node(pos, {name = "air"}) + if math.random(2) == 1 then + local path = minetest.get_modpath("default") .. "/schematics/tree2.mts" + minetest.place_schematic({x = pos.x - 1, y = pos.y - 0, z = pos.z - 1}, path, 0, nil, false) + else + local path = minetest.get_modpath("default") .. "/schematics/tree1.mts" + minetest.place_schematic({x = pos.x - 2, y = pos.y - 0, z = pos.z - 2}, path, 0, nil, false) + end + end, +}) + +minetest.register_node("default:sapling_2", { + description = "Sapling", + tiles = {"default_sapling_2.png"}, + drawtype = "plantlike", + paramtype = "light", + inventory_image = "default_sapling_2.png", + buildable_to = true, + walkable = false, + groups = {crumbly = 3, sapling = 1}, + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}, + }, +}) + +minetest.register_abm({ + nodenames = {"default:sapling_2"}, + neighbors = {"default:grass", "default:dirt"}, + interval = 1.0, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + minetest.set_node(pos, {name = "air"}) + local path = minetest.get_modpath("default") .. "/schematics/pinetree1.mts" + minetest.place_schematic({x = pos.x - 2, y = pos.y - 0, z = pos.z - 2}, path, 0, nil, false) + end, +})