[Mod] TreeCapitator [treecapitator]

User avatar
Hybrid Dog
Member
Posts: 2834
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

by Hybrid Dog » Post

sorry

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

echosa
Member
Posts: 107
Joined: Tue Aug 30, 2016 04:01

Re: [Mod] TreeCapitator [treecapitator]

by echosa » Post

I'm curious what the difference between this mod, Timber, New Timber, and New New Timber are. I've never used any of them, so I'm not sure what the differences are.

User avatar
Hybrid Dog
Member
Posts: 2834
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

by Hybrid Dog » Post

Jeija's timber mod caused following: If you dig one of the nodes listed there then the nodes above them also become dug (if they have the same name).
It's deprecated now because its function is added to default for papyrus and cactus.

l haven't tested the other ones, deivan's mod obviously additionally removes whole trees (with leaves) in comparison to Jeija's mod.
deivan's mod is obviously three years old.
My mod doesn't add the straight digging up function to papyrus etc.,
the leaves of trees next to the chopped one are kept,
treecapitating only works if it's a tree with leaves and the tree is not rotated to avoid destroying trunk house corners,
if sneak is pressed, the tree doesn't become capitated,
a sound is played, etc..
But my version doesn't support growing_trees, which is, if l remember correctly, an old, more or less remarkable mod.

Nemin32's version is almost the same as deivan's, the only difference is that the axe is needed to chop the whole tree, l assume.
Spoiler

Code: Select all

diff --git a/init.lua b/init.lua
index b403450..cd1f5fb 100644
--- a/init.lua
+++ b/init.lua
@@ -7,9 +7,7 @@
 local nt={}
 --nt.limit=2  --Range from the last cut node to search nodes do cut, 1 is good, 2 is optimal to servers with growing trees.
 
-local nt_nodenames={}
-
-local nt_nodenames_list={
+local nt_nodenames={
   "default:jungletree",
   "default:papyrus",
   "default:cactus",
@@ -48,20 +46,36 @@ local nt_nodenames_list={
 }
 
 minetest.register_on_dignode(function(pos, node, digger)
-  local i=1
-  nm = node.name
-
-  if(nt_nodenames["default:tree"]==nil) then
-    while nt_nodenames_list[i]~=nil do
-      nt_nodenames[nt_nodenames_list[i]]=nt_nodenames_list[i]
-      i = i + 1
-    end
-  end
-
-  if(nt_nodenames[nm]~=nil) then
-    nt_primary(pos,node,digger,0)
-    return false
+  local idx = digger:get_wield_index()
+  local inv = digger:get_inventory()
+  local stack = inv:get_stack("main", idx):get_name()
+  print(stack)
+  list_of_axes = {
+  "default:axe_stone",
+  "default:axe_bronze",
+  "default:axe_steel",
+  "default:axe_mese",
+  "default:axe_stone"
+  }
+  for _,v in pairs(list_of_axes) do
+	if v == stack then
+		-- do something
+		--if stack == "default:axe_stone" then
+			local i=1
+			while nt_nodenames[i]~=nil do
+				nm = node.name
+
+				if nm==nt_nodenames[i] then
+					nt_primary(pos,node,digger,0)
+					return false
+				end
+
+				i = i + 1
+			end
+		--end
+      break
   end
+end
 end)

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

User avatar
AccidentallyRhine
Member
Posts: 252
Joined: Sun Aug 02, 2015 05:43

Re: [Mod] TreeCapitator [treecapitator]

by AccidentallyRhine » Post

FYI, appending fruits = {"default:snow"} to init.lua where pinetrees are registered, is a great way to eliminate the floating rings of snow that are left after cutting down a pine tree.

As follows:

Code: Select all

treecapitator.register_tree({
	trees = {"default:pine_tree"},
	leaves = {"default:pine_needles"},
	range = 6,
	fruits = {"default:snow"}
})
It sounds stupid, but it works ...as far as I can validate.

User avatar
Hybrid Dog
Member
Posts: 2834
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

by Hybrid Dog » Post

Using nodeupdate the snow could fall down to the ground l guess.

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

User avatar
fireglow
Member
Posts: 93
Joined: Fri Mar 28, 2014 11:36
IRC: fireglow
In-game: fireglow
Location: Germany

Re: [Mod] TreeCapitator [treecapitator]

by fireglow » Post

Could somebody please add support for the mg v7 default tree, it's now growing with branches, like so:
Image

After cutting the main trunk with, the branches remain:
Image

Edit: The main trunk is sometimes 2, sometimes 3 nodes high before it branches off.

User avatar
Hybrid Dog
Member
Posts: 2834
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] TreeCapitator [treecapitator]

by Hybrid Dog » Post

AnxiousInfusion, sorry for the long delay, now snow falls down after capitating trees (with falling_extras it makes fun watching snow suddenly fall from there).

l added support for v7 trees.
fireglow, does mgv7 also offer the other trees, the mgv6 ones?

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

User avatar
fireglow
Member
Posts: 93
Joined: Fri Mar 28, 2014 11:36
IRC: fireglow
In-game: fireglow
Location: Germany

Re: [Mod] TreeCapitator [treecapitator]

by fireglow » Post

Hybrid Dog wrote:l added support for v7 trees.
fireglow, does mgv7 also offer the other trees, the mgv6 ones?
I believe the default:sapling only grows into the branched version of the tree.
However, there are servers (like mine ;) that have other treemods installed (for example farming_plus) the trees of which are akin to the regular, old v6 trees. In the case of farming_plus, en example is farming_plus:banana_sapling.

I just tested the v7 default:sapling, everything works perfect. Thank you! :-)

atorian37
Member
Posts: 17
Joined: Mon Mar 06, 2017 13:26
IRC: atorian37

Re: [Mod] TreeCapitator [treecapitator]

by atorian37 » Post

I used this mod very often on servers with mapgen v6 and it works very well.
on servers with mapgen v7, it seems that it does not work well for all kind of trees.
do I need a newer version of the mod?

regards,
atorian37

sorry I just realised, that I did not read all the post here, I need a newer version I see....sorry :(

User avatar
Hybrid Dog
Member
Posts: 2834
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

by Hybrid Dog » Post

The new version only supports mgv7 apple trees. The other ones (e.g. jungletree) aren't implemented yet.
Trees are registered in trees.lua.
https://github.com/HybridDog/treecapita ... es.lua#L45

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

nvrsbr
Member
Posts: 57
Joined: Fri Jun 05, 2015 19:42

Re: [Mod] TreeCapitator [treecapitator]

by nvrsbr » Post

Doesnt seem to work?

User avatar
Hybrid Dog
Member
Posts: 2834
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

by Hybrid Dog » Post

It should work.

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

Post Reply

Who is online

Users browsing this forum: No registered users and 39 guests