Skip to content

Commit

Permalink
tree tap use func minetest.add_item(pos, item) in MCL
Browse files Browse the repository at this point in the history
  • Loading branch information
nonfreegithub committed Nov 1, 2023
1 parent 4465fb5 commit f00f556
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion technic/tools/tree_tap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
local S = technic.getter
local mesecons_materials = minetest.get_modpath("mesecons_materials")

local function drop_raw_latex(pointed_thing, user)
if minetest.get_modpath("mcl_core") then
minetest.add_item(user:get_pos(), "technic:raw_latex")
else
minetest.handle_node_drops(pointed_thing.above, {"technic:raw_latex"}, user)
end
end

minetest.register_tool("technic:treetap", {
description = S("Tree Tap"),
inventory_image = "technic_tree_tap.png",
Expand All @@ -21,7 +29,7 @@ minetest.register_tool("technic:treetap", {
end
node.name = "moretrees:rubber_tree_trunk_empty"
minetest.swap_node(pos, node)
minetest.handle_node_drops(pointed_thing.above, {"technic:raw_latex"}, user)
drop_raw_latex(pointed_thing, user)
if not technic.creative_mode then
local item_wear = tonumber(itemstack:get_wear())
item_wear = item_wear + 819
Expand Down

0 comments on commit f00f556

Please sign in to comment.