From 71b418646dc12a28ad6b7325f3b65ddc85a7ef9e Mon Sep 17 00:00:00 2001 From: cale Date: Sat, 26 Nov 2016 12:43:08 +0100 Subject: [PATCH] added birch wood + added a nodebox for string --- mods/default/craftitems.lua | 43 +++- mods/default/init.lua | 1 + mods/default/nodes.lua | 177 --------------- mods/default/textures/default_log_birch.png | Bin 0 -> 290 bytes .../textures/default_log_birch_top.png | Bin 0 -> 268 bytes mods/default/textures/default_string.png | Bin 245 -> 225 bytes .../textures/default_string_strong.png | Bin 245 -> 225 bytes mods/default/textures/default_string_top.png | Bin 0 -> 160 bytes mods/default/textures/default_wood_birch.png | Bin 0 -> 242 bytes .../default_wooden_planks_2_birch.png | Bin 0 -> 223 bytes .../textures/default_wooden_planks_birch.png | Bin 0 -> 232 bytes mods/default/trees.lua | 208 ++++++++++++++++++ 12 files changed, 244 insertions(+), 185 deletions(-) create mode 100644 mods/default/textures/default_log_birch.png create mode 100644 mods/default/textures/default_log_birch_top.png create mode 100644 mods/default/textures/default_string_top.png create mode 100644 mods/default/textures/default_wood_birch.png create mode 100644 mods/default/textures/default_wooden_planks_2_birch.png create mode 100644 mods/default/textures/default_wooden_planks_birch.png create mode 100644 mods/default/trees.lua 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 0000000000000000000000000000000000000000..7c3c3d4d44dcb479b2f05b05a4401b91a91338ee GIT binary patch literal 290 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sf18ym9Nx^)^z{5Zx$r9Iy66gHf+|;}h2Ir#G#FEq$h4Rdj3>N`Er`b$eR%&s7o+ z{=mgQf$_@kpi?_C)}HL$Tv)2)b@@s7;t@EY- zs|9Wjr=?e4;oalgRU&)#?_q`m``*4;_pN^N=43M$@uwmyZ-rHV5M=t{=k-u6Jy&?U ie;Gr}s|T-7zGJG~nJBiw{H6}joeZ9?elF{r5}E*(MsQmI literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..5f198fa875c86ac825147f3793cfa19648d68edb GIT binary patch literal 268 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sf18ym9Ndx5!$GJcu$r9Iy66gHf+|;}h2Ir#G#FEq$h4Rdj3E1y85}S Ib4q9e08>&}T>t<8 literal 0 HcmV?d00001 diff --git a/mods/default/textures/default_string.png b/mods/default/textures/default_string.png index 3350d0ce6a749f6731e3a17079dae7ea7f8e793c..a28ec51e72c387a99255dd35ac32e6e8d4ef25b5 100644 GIT binary patch delta 154 zcmey$_>ggemf?Q}AY8C_`D6wL2F?PH$YKTtZeb8+WSBKa0w~B{;_2(k{(xJG%Um*B ze%Gss(He1{o-U3d7N?UFBtA6=&VF#Fr{VvNBbU>25>!qxu(7eVJ-a6%;+)kzJt6dT z(`g1v*2G178ZI~RzuzB}*3h8v-J_84=*t8V0|N#IQ7%!(2dn2R04-whboFyt=akR{ E0EAgL=Kufz delta 174 zcmaFJ_?2;jmZ394ErY=FzM@731_sUokH}&M25w;xW@MN(M*=9wUgGKN%6^}llS{#> zx|)f7Vzfq4tfz}(h{fsT1c{6T9o|aIZvU{?+o`%V{o${O51CG39v2?W$b0<%N6yiu zeXR3)ckmo}X0%36;h1a0UyjXggemf?Q}AY8C_`D6wL2F?PH$YKTtZeb8+WSBKa0w~B{;_2(k{(xJG%iKb} zY}J;D(He1{o-U3d7N?UFBtA6=&VF#Fr{VvNBbU>25>!qxu(7eVomwU!;(Y7%wS>^q zO{W<+H5C`_X}H|rFTX!9jX~c2xFVdQ&MBb@ E0Cm?lxBvhE delta 174 zcmaFJ_?2;jmZ394ErY=FzM@731_sUokH}&M25w;xW@MN(M*=9wUgGKN%6^}llS@ft z>g-&viP0KGv7RoDAr_~T6C^SYba*?dPI_;zx6}Hx{lTvrA6#x(Ghx9&t%)`NKi=%} zmgTmSE|lyzn;H@8(9^x)mtY#RVWLyXi^oFgi%et{XE z)7O>#0k;%4yO5Hn{W74CWQl7;iF1B#Zfaf$gL6@8Vo7R>LV0FMhJw4NZ$Nk>pEyvF zl&6bhh{pNkIWq+hIB+E-DG2stNnAB3F=1e^VrDFSu9kiZsEWbU)z4*}Q$iB}>x3nD literal 0 HcmV?d00001 diff --git a/mods/default/textures/default_wood_birch.png b/mods/default/textures/default_wood_birch.png new file mode 100644 index 0000000000000000000000000000000000000000..fdaf567bab9c79d64226f4399dba7d8903242d22 GIT binary patch literal 242 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sf18ym9SyS`80x_VFWQl7;iF1B#Zfaf$gL6@8Vo7R>LV0FMhJw4NZ$Nk>pEyua zj;D)bh{y3{n{BCD%({%+`sUWYx(P`O3=j@H#T1&`fBOW@~4~3-w^JRZ}vQ7j9S_>%%iU#KrQ!R6h69N==oMzu8H=J2@qx h*WyL6;8R8p2GNaj`cCfpWk7owJYD@<);T3K0RSmHNF)FN literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..115ddf8c3a8de02e0a2b9c6c12781cb7ebc2e62c GIT binary patch literal 223 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sf18ym9Ikv@U2080Z)k!C*M8v+-EM z3wFWN&)3^$&h~L_sc`>%FvCvbEc@c02`2JA&zdjR7|h~#`^?D9%#i-WD>Y|H@fM&Z N44$rjF6*2UngAQnM4$iw literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..43dc847f52458cecf7d7707cfbda0ccd1e411970 GIT binary patch literal 232 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sf18ym9IY9-7<19cS$r9Iy66gHf+|;}h2Ir#G#FEq$h4Rdj3`WT|PfjLPDbM-yc_N>lq4HPG5h&GF$JC!wS|%i<+)%Wyn(y zX6`+>f_1T2Pn3a77uPiN_jZ>}IwD+JDl)SfeP1`9kFW2$#=h9~C|J!k_A3kw-s`mQ U|9m@v6KETQr>mdKI;Vst04BUk6#xJL literal 0 HcmV?d00001 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, +})