From d07bbfbb87c92b56b6e0d29854492df5b49df643 Mon Sep 17 00:00:00 2001 From: Kotolegokot Date: Fri, 23 Nov 2012 15:48:06 +0600 Subject: [PATCH] Added logs --- mods/default/init.lua | 13 +--------- mods/trees/registration.lua | 27 ++++++++++----------- mods/trees/textures/trees_*_leaves.png | Bin 431 -> 0 bytes mods/trees/textures/trees__leaves.png | Bin 898 -> 0 bytes mods/trees/textures/trees__sapling.png | Bin 504 -> 0 bytes mods/trees/textures/trees__stick.png | Bin 182 -> 0 bytes mods/trees/textures/trees__trunk.png | Bin 817 -> 0 bytes mods/trees/textures/trees__trunk_top.png | Bin 674 -> 0 bytes mods/trees/textures/trees_ash_log.png | Bin 0 -> 728 bytes mods/trees/textures/trees_aspen_log.png | Bin 0 -> 752 bytes mods/trees/textures/trees_birch_log.png | Bin 0 -> 764 bytes mods/trees/textures/trees_chestnut_log.png | Bin 0 -> 660 bytes mods/trees/textures/trees_mapple_log.png | Bin 0 -> 709 bytes mods/trees/textures/trees_pine_log.png | Bin 0 -> 686 bytes mods/trees/textures/trees_sequoia_log.png | Bin 0 -> 705 bytes 15 files changed, 14 insertions(+), 26 deletions(-) delete mode 100644 mods/trees/textures/trees_*_leaves.png delete mode 100644 mods/trees/textures/trees__leaves.png delete mode 100644 mods/trees/textures/trees__sapling.png delete mode 100644 mods/trees/textures/trees__stick.png delete mode 100644 mods/trees/textures/trees__trunk.png delete mode 100644 mods/trees/textures/trees__trunk_top.png create mode 100644 mods/trees/textures/trees_ash_log.png create mode 100644 mods/trees/textures/trees_aspen_log.png create mode 100644 mods/trees/textures/trees_birch_log.png create mode 100644 mods/trees/textures/trees_chestnut_log.png create mode 100644 mods/trees/textures/trees_mapple_log.png create mode 100644 mods/trees/textures/trees_pine_log.png create mode 100644 mods/trees/textures/trees_sequoia_log.png diff --git a/mods/default/init.lua b/mods/default/init.lua index 3c1701c..482bcfd 100644 --- a/mods/default/init.lua +++ b/mods/default/init.lua @@ -1031,18 +1031,7 @@ function nodeupdate_single(p) p_bottom = {x=p.x, y=p.y-1, z=p.z} n_bottom = minetest.env:get_node(p_bottom) if not minetest.registered_nodes[n_bottom.name].walkable and n_bottom.name ~= n.name then - local meta = minetest.env:get_meta(p) - if minetest.registered_nodes[n.name].on_dropping ~= nil then - minetest.registered_nodes[n.name].on_dropping(p, n, meta) - end - minetest.env:remove_node(p) - local obj = minetest.env:add_item(p, n.name) - local x = math.random(-5,5) - local z = math.random(-5,5) - obj:setvelocity({x=1/x, y=obj:getvelocity().y, z=1/z}) - if minetest.registered_nodes[n.name].after_dropping ~= nil then - minetest.registered_nodes[n.name].after_dropping(p, n, meta) - end + minetest.env:dig_node(p) nodeupdate(p) end end diff --git a/mods/trees/registration.lua b/mods/trees/registration.lua index 46afb4d..5d05eeb 100644 --- a/mods/trees/registration.lua +++ b/mods/trees/registration.lua @@ -42,6 +42,11 @@ function realtest.register_tree(name, TreeDef) sounds = default.node_sound_defaults(), }) + minetest.register_craftitem(tree.name.."_log", { + description = tree.description.." Log", + inventory_image = tree.textures[6], + }) + minetest.register_node(tree.name.."_leaves", { description = tree.description.." Leaves", drawtype = "allfaces_optional", @@ -75,6 +80,7 @@ function realtest.register_tree(name, TreeDef) tiles = tree.textures[1], groups = {tree=1,snappy=1,choppy=2,flammable=2,dropping_node=1,drop_on_dig=1}, sounds = default.node_sound_wood_defaults(), + drop = tree.name.."_log", drawtype = "nodebox", paramtype = "light", node_box = { @@ -89,14 +95,6 @@ function realtest.register_tree(name, TreeDef) {-0.4,-0.5,-0.4,0.4,0.5,0.4}, }, }, - after_dropping = function(pos, node, meta) - for i = 1,#tree.leaves do - local p = {x=pos.x+tree.leaves[i][1], y=pos.y+tree.leaves[i][2], z=pos.z+tree.leaves[i][3]} - if minetest.env:get_node(p).name == tree.name.."_leaves" then - minetest.env:dig_node(p) - end - end - end, after_dig_node = function(pos, oldnode, oldmetadata, digger) for i = 1,#tree.leaves do local p = {x=pos.x+tree.leaves[i][1], y=pos.y+tree.leaves[i][2], z=pos.z+tree.leaves[i][3]} @@ -130,7 +128,7 @@ realtest.register_tree("trees:ash", { return 4 + math.random(4) end, textures = {{"trees_ash_trunk_top.png", "trees_ash_trunk_top.png", "trees_ash_trunk.png"},"trees_ash_leaves.png", - "trees_ash_planks.png", "trees_ash_stick.png", "trees_ash_sapling.png"} + "trees_ash_planks.png", "trees_ash_stick.png", "trees_ash_sapling.png", "trees_ash_log.png"} }) realtest.register_tree("trees:aspen", { description = "Aspen", @@ -139,7 +137,7 @@ realtest.register_tree("trees:aspen", { return 10 + math.random(4) end, textures = {{"trees_aspen_trunk_top.png", "trees_aspen_trunk_top.png", "trees_aspen_trunk.png"},"trees_aspen_leaves.png", - "trees_aspen_planks.png", "trees_aspen_stick.png", "trees_aspen_sapling.png"} + "trees_aspen_planks.png", "trees_aspen_stick.png", "trees_aspen_sapling.png", "trees_aspen_log.png"} }) realtest.register_tree("trees:birch", { description = "Birch", @@ -148,7 +146,7 @@ realtest.register_tree("trees:birch", { return 10 + math.random(4) end, textures = {{"trees_birch_trunk_top.png", "trees_birch_trunk_top.png", "trees_birch_trunk.png"},"trees_birch_leaves.png", - "trees_birch_planks.png", "trees_birch_stick.png", "trees_birch_sapling.png"} + "trees_birch_planks.png", "trees_birch_stick.png", "trees_birch_sapling.png", "trees_birch_log.png"} }) realtest.register_tree("trees:mapple", { description = "Mapple", @@ -157,7 +155,7 @@ realtest.register_tree("trees:mapple", { return 7 + math.random(5) end, textures = {{"trees_mapple_trunk_top.png", "trees_mapple_trunk_top.png", "trees_mapple_trunk.png"},"trees_mapple_leaves.png", - "trees_mapple_planks.png", "trees_mapple_stick.png", "trees_mapple_sapling.png"} + "trees_mapple_planks.png", "trees_mapple_stick.png", "trees_mapple_sapling.png", "trees_mapple_log.png"} }) realtest.register_tree("trees:chestnut", { description = "Chestnut", @@ -167,7 +165,7 @@ realtest.register_tree("trees:chestnut", { end, radius = 10, textures = {{"trees_chestnut_trunk_top.png", "trees_chestnut_trunk_top.png", "trees_chestnut_trunk.png"},"trees_chestnut_leaves.png", - "trees_chestnut_planks.png", "trees_chestnut_stick.png", "trees_chestnut_sapling.png"} + "trees_chestnut_planks.png", "trees_chestnut_stick.png", "trees_chestnut_sapling.png", "trees_chestnut_log.png"} }) realtest.register_tree("trees:pine", { description = "Pine", @@ -175,6 +173,7 @@ realtest.register_tree("trees:pine", { height = function() return 13 + math.random(4) end, + radius = 8, textures = {{"trees_pine_trunk_top.png", "trees_pine_trunk_top.png", "trees_pine_trunk.png"},"trees_pine_leaves.png", - "trees_pine_planks.png", "trees_pine_stick.png", "trees_pine_sapling.png"} + "trees_pine_planks.png", "trees_pine_stick.png", "trees_pine_sapling.png", "trees_pine_log.png"} }) diff --git a/mods/trees/textures/trees_*_leaves.png b/mods/trees/textures/trees_*_leaves.png deleted file mode 100644 index c5921a46cea61d13d9889cb045f67e22c492d4da..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 431 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85sDEfH31!Z9ZwBAbW|YuPgfJvv}5>{UvWtO#9&JcyWsQr5U_Gq7ybUJo)_G+A>0kNo)6a zrMLT-_SDxhOqjWZeWnA?{zSjD>i6FT50>mSV|RaGa6Hd#hO(>X^IQL(7OZQ3z>#D2 zC-2Mu#D8EcSfm{BD(QMZ?O1NU9!{M7-BNoIfS zUg;9Q=0Esm+lExBjptmhKUi30Zr${kdA(AYVB)SA_x#oG&VRGIw(51q`semy Xwk}@poI(x&LzBVN)z4*}Q$iB}p24l0 diff --git a/mods/trees/textures/trees__leaves.png b/mods/trees/textures/trees__leaves.png deleted file mode 100644 index 2446fe8e14cc99ef2304dc4cbfbf6168e3b8895a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 898 zcmV-|1AY97P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyt`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|6#QS(Ys{Kx=gj&1@vbh;t1n-g~qLE4F>}U5OM;N4j}3IU$pi zpD5K(XRXEi$m5+JIYm-}_1U#@&Mhl3#>R#9A!7_x)x|l7>6B>277H;(Qc8`ror1~f zuZ@k)Iez>(TXnJV-Um-%3v$kg6~qYET2gFSkeyxyz`^~!O|@=^n|Y1a(5bor%oj_l zVuiVp&0qTQ{hMs9<=gio4u^xrzML3MPI><9V2jW-Jad62A02y>e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00KZsL_t(I%cYY|PZMzv#(%T> z-%{Eli!E)1f&sNrqK1P9FGf$Ac=2qa-@uy}FZwn75+3~m>Xid1!34rfYD-&6?aQ)l zVY@pXNQ|TeO`O|2$^7z6<{9|Ul0Tcgn~X$6jIlKshEi)C$=?9x_wZCo7qf13IW;bz z((w9#gsPF&+rGKbLEcSjdLp3tAGkxnI8+1}T^ zgN}?i5TNPxISxYRGMAW0jBy+c`M9#lxMQd^J#1T8nw#eKd{##QwrwFIY}Z<>?$*gp zCQ()H-_xHQ!GsD89@24E2^hj|71v`+anc^5sx_-V^eB$303e0 z0nKionB#D3KBpr&$hk>1wnZ2z#k|Www~rzi#{uBY^T#yW9$V!)U)Fb7-`$rpr>VDn z35H<+P-*#yWigja^Xl0{RF!G>5=Z?L9xWHSyD&qsFg+Z(?Lns(Lsi2l8jd-JWIRU9 zF}!{8gxBvsaD6tzX1T$GJB#Yr#yU3~wYF~!g3vTNekU1^)9nrTwp-=h%clqy&92Xw z<3wk2Fal{ENg?Cbe>8pqkcc~cTH7K$nc`+4$J%x!62Z1EdX(~EJJ<4heBCMI_fItI zrnHcrWTR9KS9dDT`d(G!UtV_U>Xl&>MMGm-W08WYM&C;{8{ikQq508@ghu)R0000< KMNUMnLSTZo$U>9= literal 0 HcmV?d00001 diff --git a/mods/trees/textures/trees_aspen_log.png b/mods/trees/textures/trees_aspen_log.png new file mode 100644 index 0000000000000000000000000000000000000000..704d2088dce2e35c6d2230f8e371ede812b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