From d452d16fa6a0364e0c8e171a4b333d6b85e0c519 Mon Sep 17 00:00:00 2001 From: est31 <MTest31@outlook.com> Date: Tue, 03 Feb 2015 07:43:58 +0100 Subject: [PATCH] Make technic chests independent from unified inventory --- technic/tools/tree_tap.lua | 32 +++++++++++++++----------------- 1 files changed, 15 insertions(+), 17 deletions(-) diff --git a/technic/tools/tree_tap.lua b/technic/tools/tree_tap.lua index 3e6b674..2ab6823 100644 --- a/technic/tools/tree_tap.lua +++ b/technic/tools/tree_tap.lua @@ -1,15 +1,12 @@ local S = technic.getter +local mesecons_materials = minetest.get_modpath("mesecons_materials") minetest.register_tool("technic:treetap", { description = S("Tree Tap"), inventory_image = "technic_tree_tap.png", on_use = function(itemstack, user, pointed_thing) if pointed_thing.type ~= "node" then - return - end - local inv = user:get_inventory() - if not inv:room_for_item("main", ItemStack("technic:raw_latex")) then return end local pos = pointed_thing.under @@ -23,8 +20,8 @@ return end node.name = "moretrees:rubber_tree_trunk_empty" - inv:add_item("main", ItemStack("technic:raw_latex")) 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 @@ -39,21 +36,23 @@ minetest.register_craft({ output = "technic:treetap", recipe = { - {"pipeworks:tube", "group:wood", "default:stick"}, + {"pipeworks:tube_1", "group:wood", "default:stick"}, {"", "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"), @@ -65,11 +64,10 @@ interval = 60, chance = 15, action = function(pos, node) - local meta = minetest.get_meta(pos) - if meta:get_int("placed") ~= 0 then - return + if minetest.find_node_near(pos, (moretrees and moretrees.leafdecay_radius) or 5, {"moretrees:rubber_tree_leaves"}) then + node.name = "moretrees:rubber_tree_trunk" + minetest.swap_node(pos, node) end - minetest.set_node(pos, {name="moretrees:rubber_tree_trunk"}) end }) -- Gitblit v1.8.0