From 987cc5a6a425b1f9bcd9000608dc389a45c675a1 Mon Sep 17 00:00:00 2001
From: you <ovvv@web.de>
Date: Mon, 05 Jun 2017 16:51:59 +0200
Subject: [PATCH] Add api documentation (#361)

---
 technic/tools/tree_tap.lua |   32 +++++++++++++++++++-------------
 1 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/technic/tools/tree_tap.lua b/technic/tools/tree_tap.lua
index fe082d4..ae68b56 100644
--- a/technic/tools/tree_tap.lua
+++ b/technic/tools/tree_tap.lua
@@ -1,5 +1,6 @@
 
 local S = technic.getter
+local mesecons_materials = minetest.get_modpath("mesecons_materials")
 
 minetest.register_tool("technic:treetap", {
 	description = S("Tree Tap"),
@@ -21,13 +22,15 @@
 		node.name = "moretrees:rubber_tree_trunk_empty"
 		minetest.swap_node(pos, node)
 		minetest.handle_node_drops(pointed_thing.above, {"technic:raw_latex"}, user)
-		local item_wear = tonumber(itemstack:get_wear())
-		item_wear = item_wear + 819
-		if item_wear > 65535 then
-			itemstack:clear()
-			return itemstack
+		if not technic.creative_mode then
+			local item_wear = tonumber(itemstack:get_wear())
+			item_wear = item_wear + 819
+			if item_wear > 65535 then
+				itemstack:clear()
+				return itemstack
+			end
+			itemstack:set_wear(item_wear)
 		end
-		itemstack:set_wear(item_wear)
 		return itemstack
 	end,
 })
@@ -39,17 +42,19 @@
 		{"",               "default:stick", "default:stick"}
 	},
 })
-     
+
 minetest.register_craftitem("technic:raw_latex", {
 	description = S("Raw Latex"),
 	inventory_image = "technic_raw_latex.png",
 })
-     
-minetest.register_craft({
-	type = "cooking",
-	output = "technic:rubber",
-	recipe = "technic:raw_latex",
-})
+
+if mesecons_materials then
+	minetest.register_craft({
+		type = "cooking",
+		recipe = "technic:raw_latex",
+		output = "mesecons_materials:glue",
+	})
+end
 
 minetest.register_craftitem("technic:rubber", {
 	description = S("Rubber Fiber"),
@@ -57,6 +62,7 @@
 })
 
 minetest.register_abm({
+	label = "Tools: tree tap",
 	nodenames = {"moretrees:rubber_tree_trunk_empty"},
 	interval = 60,
 	chance = 15,

--
Gitblit v1.8.0