From 9034b560f1e4123be3cf91d1cf4ab183cf70c56a Mon Sep 17 00:00:00 2001 From: Duane Date: Mon, 13 Jun 2016 03:33:45 -0500 Subject: [PATCH] Change giant tree nodes. --- textures/fun_caves_tree.png | Bin 0 -> 653 bytes treegen.lua | 26 ++++++++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 textures/fun_caves_tree.png diff --git a/textures/fun_caves_tree.png b/textures/fun_caves_tree.png new file mode 100644 index 0000000000000000000000000000000000000000..8cfea54f946cb327f7eec501f5464703ba90e18c GIT binary patch literal 653 zcmV;80&@L{P)q)5di|RoUSWVA1fOo$NfQ2r#lsqfu2ql+sbu~f$imx2tz=D@)p_RNJ&Lc_3vC~0FXj}~ z3@44X27Y~z3vvx4E-EgX8*?1a+K3uOv6f<`h$xhzcp;?-4V9w5Zo(A{=g{#8p1G(> z#(Qy|UkFebm4&KZm@6KNsF0^f1j)l03$ab~56m0vBC9wXIFr2&F8L5vRBgnR1WqQo zmADGcpatybK|-+|6bDf!F3@HL{>hmeQ^j)~}9qKaRKGau^w!bSP|*ekY&Th4&jA))Wv}s}KsQ`u~Yw(P0;B6uwrn=Riz;J5NO` zQB?$^_F#?&?Jx2ubp~Rc^1|Fui(u>xS&aAOtOo^30!pYT$V8=~TC{#+4&E9ELn{Yy z-Dm_N23717YQ5QO;`YK@$HD;NoFvPT+^`BYf-qq{0|eCK_X(VSU)27=WkVgrgskLL zv6c|MP`i@a6ZQ|T%E#x;9t$;~gzkXd>}Mb)m`-v(+@B64Ui%QOu{MZ0nVUR|vm7&_ nyHP6GeUbZ(D3~^cg-7E*;o?<;$`wkX00000NkvXXu0mjfihUZ~ literal 0 HcmV?d00001 diff --git a/treegen.lua b/treegen.lua index 9c9f6c6..2bf7da5 100644 --- a/treegen.lua +++ b/treegen.lua @@ -7,13 +7,25 @@ local abs = math.abs local max_depth = 31000 -local newnode = fun_caves.clone_node("default:wood") +local newnode = fun_caves.clone_node("default:tree") newnode.description = "Bark" newnode.tiles = {"default_tree.png"} newnode.is_ground_content = false ---newnode.groups.oddly_breakable_by_hand minetest.register_node("fun_caves:bark", newnode) +newnode = fun_caves.clone_node("default:tree") +newnode.description = "Giant Wood" +newnode.tiles = {"fun_caves_tree.png"} +newnode.is_ground_content = false +minetest.register_node("fun_caves:tree", newnode) + +minetest.register_craft({ + output = 'default:wood 4', + recipe = { + {'fun_caves:tree'}, + } +}) + minetest.register_node("fun_caves:leaves", { description = "Leaves", visual_scale = 1.3, @@ -73,17 +85,19 @@ fun_caves.treegen = function(minp, maxp, data, p2data, area, node) end if floor(dx ^ 2 + dz ^ 2) < r ^ 2 then - data[ivm] = node['default:wood'] + data[ivm] = node['fun_caves:tree'] write = true elseif y < 222 and y > -102 and floor(dx ^ 2 + dz ^ 2) < (r + 2) ^ 2 then data[ivm] = node['fun_caves:bark'] write = true elseif y < 272 and y > 112 and floor(dx ^ 2 + dz ^ 2 + (y - 192) ^ 2) < r2 ^ 2 and y % 10 == 0 and (floor(dx / 4) % 3 == 0 or floor(dz / 4) % 3 == 0) then - data[ivm] = node['default:wood'] - write = true + if data[ivm] == node['air'] then + data[ivm] = node['fun_caves:tree'] + write = true + end elseif y < 272 and y > 112 and floor(dx ^ 2 + dz ^ 2 + (y - 192) ^ 2) < r2 ^ 2 and (y + 3) % 10 < 7 and (floor((dx + 3) / 4) % 3 < 2 or floor((dz + 3) / 4) % 3 < 2) then local r = abs(((y + 3) % 10) - 3) - if r < 2 or rand(r) == 1 then + if (r < 2 or rand(r) == 1) and data[ivm] == node['air'] then data[ivm] = node['fun_caves:leaves'] write = true end