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/mining_drill.lua | 22 ++++++++++++++-------- 1 files changed, 14 insertions(+), 8 deletions(-) diff --git a/technic/tools/mining_drill.lua b/technic/tools/mining_drill.lua index 202123d..0612059 100644 --- a/technic/tools/mining_drill.lua +++ b/technic/tools/mining_drill.lua @@ -6,9 +6,9 @@ minetest.register_craft({ output = 'technic:mining_drill', recipe = { - {'technic:stainless_steel_ingot', 'technic:diamond_drill_head', 'technic:stainless_steel_ingot'}, + {'moreores:tin_ingot', 'technic:diamond_drill_head', 'moreores:tin_ingot'}, {'technic:stainless_steel_ingot', 'technic:motor', 'technic:stainless_steel_ingot'}, - {'', 'technic:red_energy_crystal', 'moreores:copper_ingot'}, + {'', 'technic:red_energy_crystal', 'default:copper_ingot'}, } }) minetest.register_craft({ @@ -51,12 +51,12 @@ minetest.record_protection_violation(pos, player:get_player_name()) return end - local node=minetest.env:get_node(pos) + local node=minetest.get_node(pos) if node.name == "air" or node.name == "ignore" then return end if node.name == "default:lava_source" then return end if node.name == "default:lava_flowing" then return end - if node.name == "default:water_source" then minetest.env:remove_node(pos) return end - if node.name == "default:water_flowing" then minetest.env:remove_node(pos) return end + if node.name == "default:water_source" then minetest.remove_node(pos) return end + if node.name == "default:water_flowing" then minetest.remove_node(pos) return end minetest.node_dig(pos,node,player) end @@ -229,6 +229,12 @@ minetest.sound_play("mining_drill", {pos = pos, gain = 1.0, max_hear_distance = 10,}) end +local function pos_is_pointable(pos) + local node = minetest.get_node(pos) + local nodedef = minetest.registered_nodes[node.name] + return nodedef and nodedef.pointable +end + local function mining_drill_mk2_setmode(user,itemstack) local player_name=user:get_player_name() local item=itemstack:to_table() @@ -285,7 +291,7 @@ if not meta or not meta.mode or keys.sneak then return mining_drill_mk2_setmode(user, itemstack) end - if pointed_thing.type ~= "node" or not meta.charge then + if pointed_thing.type ~= "node" or not pos_is_pointable(pointed_thing.under) or not meta.charge then return end local charge_to_take = cost_to_use(2, meta.mode) @@ -306,7 +312,7 @@ if not meta or not meta.mode or keys.sneak then return mining_drill_mk3_setmode(user, itemstack) end - if pointed_thing.type ~= "node" or not meta.charge then + if pointed_thing.type ~= "node" or not pos_is_pointable(pointed_thing.under) or not meta.charge then return end local charge_to_take = cost_to_use(3, meta.mode) @@ -329,7 +335,7 @@ wear_represents = "technic_RE_charge", on_refill = technic.refill_RE_charge, on_use = function(itemstack, user, pointed_thing) - if pointed_thing.type ~= "node" then + if pointed_thing.type ~= "node" or not pos_is_pointable(pointed_thing.under) then return itemstack end local meta = minetest.deserialize(itemstack:get_metadata()) -- Gitblit v1.8.0