From b951f4b505c89c71cc0faae3241419903c837802 Mon Sep 17 00:00:00 2001 From: OgelGames Date: Sun, 6 Aug 2023 19:34:27 +1000 Subject: [PATCH 1/2] remove wrench --- .luacheckrc | 2 +- README.md | 1 - technic/config.lua | 1 - technic/doc/tools.md | 6 -- technic/spec/fixtures/technic.conf | 1 - wrench/functions.lua | 131 ----------------------------- wrench/init.lua | 58 ------------- wrench/legacy.lua | 126 --------------------------- wrench/locale/template.txt | 12 --- wrench/locale/wrench.de.tr | 14 --- wrench/locale/wrench.es.tr | 12 --- wrench/locale/wrench.fr.tr | 12 --- wrench/locale/wrench.ja.tr | 8 -- wrench/locale/wrench.pl.tr | 14 --- wrench/locale/wrench.pt_BR.tr | 14 --- wrench/locale/wrench.tr.tr | 12 --- wrench/locale/wrench.zh_CN.tr | 9 -- wrench/mod.conf | 2 - wrench/nodes/default.lua | 63 -------------- wrench/nodes/digtron.lua | 23 ----- wrench/nodes/drawers.lua | 36 -------- wrench/nodes/technic.lua | 93 -------------------- wrench/nodes/technic_chests.lua | 112 ------------------------ wrench/nodes/technic_cnc.lua | 40 --------- wrench/textures/technic_wrench.png | Bin 140 -> 0 bytes wrench/tool.lua | 37 -------- 26 files changed, 1 insertion(+), 838 deletions(-) delete mode 100644 wrench/functions.lua delete mode 100644 wrench/init.lua delete mode 100644 wrench/legacy.lua delete mode 100644 wrench/locale/template.txt delete mode 100644 wrench/locale/wrench.de.tr delete mode 100644 wrench/locale/wrench.es.tr delete mode 100644 wrench/locale/wrench.fr.tr delete mode 100644 wrench/locale/wrench.ja.tr delete mode 100644 wrench/locale/wrench.pl.tr delete mode 100644 wrench/locale/wrench.pt_BR.tr delete mode 100644 wrench/locale/wrench.tr.tr delete mode 100644 wrench/locale/wrench.zh_CN.tr delete mode 100644 wrench/mod.conf delete mode 100644 wrench/nodes/default.lua delete mode 100644 wrench/nodes/digtron.lua delete mode 100644 wrench/nodes/drawers.lua delete mode 100644 wrench/nodes/technic.lua delete mode 100644 wrench/nodes/technic_chests.lua delete mode 100644 wrench/nodes/technic_cnc.lua delete mode 100644 wrench/textures/technic_wrench.png delete mode 100644 wrench/tool.lua diff --git a/.luacheckrc b/.luacheckrc index 68939d82..4c933d5c 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -6,7 +6,7 @@ exclude_files = { } globals = { - "technic", "technic_cnc", "minetest", "wrench" + "technic", "technic_cnc", "minetest" } read_globals = { diff --git a/README.md b/README.md index 97a2ffb3..32254036 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,6 @@ Recommended mods that build on the `technic mod`: | enable_mining_drill | | | enable_mining_laser | | | enable_flashlight | | -| enable_wrench_crafting | enable recipe for wrench | | enable_wind_mill | | | enable_frames | | | enable_corium_griefing | | diff --git a/technic/config.lua b/technic/config.lua index c14f0269..d78c92b1 100644 --- a/technic/config.lua +++ b/technic/config.lua @@ -12,7 +12,6 @@ local defaults = { enable_sonic_screwdriver = "true", enable_tree_tap = "true", enable_vacuum = "true", - enable_wrench_crafting = "false", -- Power tool options multimeter_remote_start_ttl = "300", diff --git a/technic/doc/tools.md b/technic/doc/tools.md index 848ac9b0..2cdf737e 100644 --- a/technic/doc/tools.md +++ b/technic/doc/tools.md @@ -61,9 +61,3 @@ This manual tool allows for harvesting latex from rubber trees. Extracting latex The water can works similarly to the bucket tool from minetest_game, but it can hold 16 `water_source` (the water blocks that don't look like they're flowing) blocks instead of 1. To use, simply equip the water can and click on water source blocks (they will highlight in black). Then clicking anywhere where there isn't a `water_source` block with the water can equipped will place them. **Warning:** Be careful where you place these source blocks! Since you're placing water source blocks, water will flow out of them and may trap or drown you depending on where you are. - -## Wrench - - - -The manual tool allows for moving blocks which contain an inventory, like chests. A shift-right-click on a machine/chest will immediately add it to the inventory. diff --git a/technic/spec/fixtures/technic.conf b/technic/spec/fixtures/technic.conf index 1b5a0d00..3f7e5c9d 100644 --- a/technic/spec/fixtures/technic.conf +++ b/technic/spec/fixtures/technic.conf @@ -8,7 +8,6 @@ enable_prospector = true enable_sonic_screwdriver = true enable_tree_tap = true enable_vacuum = true -enable_wrench_crafting = true multimeter_remote_start_ttl = 300 diff --git a/wrench/functions.lua b/wrench/functions.lua deleted file mode 100644 index 9a866987..00000000 --- a/wrench/functions.lua +++ /dev/null @@ -1,131 +0,0 @@ - -local S = minetest.get_translator(minetest.get_current_modname()) - -local SERIALIZATION_VERSION = 1 - -local errors = { - owned = function(owner) return S("Cannot pickup node. Owned by @1.", owner) end, - full_inv = S("Not enough room in inventory to pickup node."), - bad_item = function(item) return S("Cannot pickup node containing @1.", item) end, - nested = S("Cannot pickup node. Nesting inventories is not allowed."), - metadata = S("Cannot pickup node. Node contains too much metadata."), -} - -local function get_stored_metadata(itemstack) - local meta = itemstack:get_meta() - local data = meta:get("data") or meta:get("") - if not data then - return - end - data = minetest.deserialize(data) - if not data or not data.version or not data.name then - return - end - return data -end - -local function get_description(def, pos, meta, node, player) - local t = type(def.description) - if t == "string" then - return def.description - elseif t == "function" then - local desc = def.description(pos, meta, node, player) - if desc then - return desc - end - end - return S("@1 with items", minetest.registered_nodes[node.name].description) -end - -function wrench.pickup_node(pos, player) - local node = minetest.get_node(pos) - local def = wrench.registered_nodes[node.name] - if not def then - return - end - local meta = minetest.get_meta(pos) - if def.owned and not minetest.check_player_privs(player, "protection_bypass") then - local owner = meta:get_string("owner") - if owner ~= "" and owner ~= player:get_player_name() then - return false, errors.owned(owner) - end - end - local data = { - name = node.name, - version = SERIALIZATION_VERSION, - lists = {}, - metas = {}, - } - local inv = meta:get_inventory() - for _, listname in pairs(def.lists or {}) do - local list = inv:get_list(listname) - for i, stack in pairs(list) do - if wrench.blacklisted_items[stack:get_name()] then - local desc = stack:get_definition().description - return false, errors.bad_item(desc) - end - local sdata = get_stored_metadata(stack) - if sdata and sdata.lists and next(sdata.lists) ~= nil then - return false, errors.nested - end - list[i] = stack:to_string() - end - data.lists[listname] = list - end - for name, meta_type in pairs(def.metas or {}) do - if meta_type == wrench.META_TYPE_FLOAT then - data.metas[name] = meta:get_float(name) - elseif meta_type == wrench.META_TYPE_STRING then - data.metas[name] = meta:get_string(name) - elseif meta_type == wrench.META_TYPE_INT then - data.metas[name] = meta:get_int(name) - end - end - local stack = ItemStack(node.name) - local item_meta = stack:get_meta() - item_meta:set_string("data", minetest.serialize(data)) - item_meta:set_string("description", get_description(def, pos, meta, node, player)) - if #stack:to_string() > 65000 then - return false, errors.metadata - end - local player_inv = player:get_inventory() - if not player_inv:room_for_item("main", stack) then - return false, errors.full_inv - end - player_inv:add_item("main", stack) - minetest.remove_node(pos) - return true -end - -function wrench.restore_node(pos, player, stack) - if not stack then - return - end - local data = get_stored_metadata(stack) - if not data then - return - end - local def = wrench.registered_nodes[data.name] - if not def then - return - end - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - for listname, list in pairs(data.lists) do - inv:set_list(listname, list) - end - for name, value in pairs(data.metas) do - local meta_type = def.metas and def.metas[name] - if meta_type == wrench.META_TYPE_INT then - meta:set_int(name, value) - elseif meta_type == wrench.META_TYPE_FLOAT then - meta:set_float(name, value) - elseif meta_type == wrench.META_TYPE_STRING then - meta:set_string(name, value) - end - end - if def.after_place then - def.after_place(pos, player, stack) - end - return true -end diff --git a/wrench/init.lua b/wrench/init.lua deleted file mode 100644 index 2b0e2bd0..00000000 --- a/wrench/init.lua +++ /dev/null @@ -1,58 +0,0 @@ - -local modpath = minetest.get_modpath("wrench") - -wrench = { - registered_nodes = {}, - blacklisted_items = {}, - META_TYPE_FLOAT = 1, - META_TYPE_STRING = 2, - META_TYPE_INT = 3, -} - -dofile(modpath.."/legacy.lua") -dofile(modpath.."/functions.lua") -dofile(modpath.."/tool.lua") - -function wrench.register_node(name, def) - assert(type(name) == "string", "wrench.register_node invalid type for name") - assert(type(def) == "table", "wrench.register_node invalid type for def") - local node_def = minetest.registered_nodes[name] - if node_def then - wrench.registered_nodes[name] = table.copy(def) - local old_after_place = node_def.after_place_node - minetest.override_item(name, { - after_place_node = function(...) - if not wrench.restore_node(...) and old_after_place then - return old_after_place(...) - end - end - }) - else - minetest.log("warning", "Attempt to register unknown node for wrench: "..name) - end -end - -function wrench.blacklist_item(name) - assert(type(name) == "string", "wrench:blacklist_item invalid type for name") - local node_def = minetest.registered_items[name] - if node_def then - wrench.blacklisted_items[name] = true - else - minetest.log("warning", "Attempt to blacklist unknown item for wrench: "..name) - end -end - -local mods = { - "default", - "digtron", - "drawers", - "technic", - "technic_chests", - "technic_cnc", -} - -for _, modname in pairs(mods) do - if minetest.get_modpath(modname) then - dofile(modpath.."/nodes/"..modname..".lua") - end -end diff --git a/wrench/legacy.lua b/wrench/legacy.lua deleted file mode 100644 index 01b2c077..00000000 --- a/wrench/legacy.lua +++ /dev/null @@ -1,126 +0,0 @@ - --- Register aliases for old wrench:picked_up_* nodes - -local all_nodes = { - default = { - "default:chest", - "default:chest_locked", - "default:furnace", - "default:furnace_active" - }, - drawers = { - "drawers:acacia_wood1", - "drawers:acacia_wood2", - "drawers:acacia_wood4", - "drawers:aspen_wood1", - "drawers:aspen_wood2", - "drawers:aspen_wood4", - "drawers:junglewood1", - "drawers:junglewood2", - "drawers:junglewood4", - "drawers:pine_wood1", - "drawers:pine_wood2", - "drawers:pine_wood4", - "drawers:wood1", - "drawers:wood2", - "drawers:wood4" - }, - technic_chests = { - "technic:copper_chest", - "technic:copper_locked_chest", - "technic:gold_chest", - "technic:gold_chest_black", - "technic:gold_chest_blue", - "technic:gold_chest_brown", - "technic:gold_chest_cyan", - "technic:gold_chest_dark_green", - "technic:gold_chest_dark_grey", - "technic:gold_chest_green", - "technic:gold_chest_grey", - "technic:gold_chest_magenta", - "technic:gold_chest_orange", - "technic:gold_chest_pink", - "technic:gold_chest_red", - "technic:gold_chest_violet", - "technic:gold_chest_white", - "technic:gold_chest_yellow", - "technic:gold_locked_chest", - "technic:gold_locked_chest_black", - "technic:gold_locked_chest_blue", - "technic:gold_locked_chest_brown", - "technic:gold_locked_chest_cyan", - "technic:gold_locked_chest_dark_green", - "technic:gold_locked_chest_dark_grey", - "technic:gold_locked_chest_green", - "technic:gold_locked_chest_grey", - "technic:gold_locked_chest_magenta", - "technic:gold_locked_chest_orange", - "technic:gold_locked_chest_pink", - "technic:gold_locked_chest_red", - "technic:gold_locked_chest_violet", - "technic:gold_locked_chest_white", - "technic:gold_locked_chest_yellow", - "technic:iron_chest", - "technic:iron_locked_chest", - "technic:mithril_chest", - "technic:mithril_locked_chest", - "technic:silver_chest", - "technic:silver_locked_chest" - }, - technic = { - "technic:cnc", - "technic:cnc_active", - "technic:coal_alloy_furnace", - "technic:coal_alloy_furnace_active", - "technic:hv_battery_box0", - "technic:hv_battery_box1", - "technic:hv_battery_box2", - "technic:hv_battery_box3", - "technic:hv_battery_box4", - "technic:hv_battery_box5", - "technic:hv_battery_box6", - "technic:hv_battery_box7", - "technic:hv_battery_box8", - "technic:lv_battery_box0", - "technic:lv_battery_box1", - "technic:lv_battery_box2", - "technic:lv_battery_box3", - "technic:lv_battery_box4", - "technic:lv_battery_box5", - "technic:lv_battery_box6", - "technic:lv_battery_box7", - "technic:lv_battery_box8", - "technic:lv_electric_furnace", - "technic:lv_electric_furnace_active", - "technic:mv_alloy_furnace", - "technic:mv_alloy_furnace_active", - "technic:mv_battery_box0", - "technic:mv_battery_box1", - "technic:mv_battery_box2", - "technic:mv_battery_box3", - "technic:mv_battery_box4", - "technic:mv_battery_box5", - "technic:mv_battery_box6", - "technic:mv_battery_box7", - "technic:mv_battery_box8", - "technic:mv_centrifuge", - "technic:mv_centrifuge_active", - "technic:mv_compressor", - "technic:mv_compressor_active", - "technic:mv_electric_furnace", - "technic:mv_electric_furnace_active", - "technic:mv_extractor", - "technic:mv_extractor_active", - "technic:mv_grinder", - "technic:mv_grinder_active", - "technic:tool_workshop" - } -} - -for mod, nodes in pairs(all_nodes) do - if minetest.get_modpath(mod) then - for _,n in pairs(nodes) do - minetest.register_alias("wrench:picked_up_"..n:gsub(":", "_"), n) - end - end -end diff --git a/wrench/locale/template.txt b/wrench/locale/template.txt deleted file mode 100644 index b7879cad..00000000 --- a/wrench/locale/template.txt +++ /dev/null @@ -1,12 +0,0 @@ -# textdomain: wrench - -# technic_wrench translation template - -Wrench= -@1 with items= - -Cannot pickup node. Owned by @1.= -Not enough room in inventory to pickup node.= -Cannot pickup node containing @1.= -Cannot pickup node. Nesting inventories is not allowed.= -Cannot pickup node. Node contains too much metadata.= diff --git a/wrench/locale/wrench.de.tr b/wrench/locale/wrench.de.tr deleted file mode 100644 index 1044becc..00000000 --- a/wrench/locale/wrench.de.tr +++ /dev/null @@ -1,14 +0,0 @@ -# textdomain: wrench - -# German Translation for technic_wrench -# Deutsche Übersetzung von technic_wrench -# by Xanthin - -Wrench=Schraubenschluessel -@1 with items=@1 mit Gegenstaenden - -Cannot pickup node. Owned by @1.= -Not enough room in inventory to pickup node.= -Cannot pickup node containing @1.= -Cannot pickup node. Nesting inventories is not allowed.= -Cannot pickup node. Node contains too much metadata.= diff --git a/wrench/locale/wrench.es.tr b/wrench/locale/wrench.es.tr deleted file mode 100644 index bc298fa7..00000000 --- a/wrench/locale/wrench.es.tr +++ /dev/null @@ -1,12 +0,0 @@ -# textdomain: wrench - -# technic_wrench traducido por Carlos Barraza - -Wrench=Llave Inglesa -@1 with items=@1 con elementos - -Cannot pickup node. Owned by @1.= -Not enough room in inventory to pickup node.= -Cannot pickup node containing @1.= -Cannot pickup node. Nesting inventories is not allowed.= -Cannot pickup node. Node contains too much metadata.= diff --git a/wrench/locale/wrench.fr.tr b/wrench/locale/wrench.fr.tr deleted file mode 100644 index f4f1ecaf..00000000 --- a/wrench/locale/wrench.fr.tr +++ /dev/null @@ -1,12 +0,0 @@ -# textdomain: wrench - -# technic_wrench translation template - -Wrench=Clé -@1 with items=@1 avec des objets - -Cannot pickup node. Owned by @1.= -Not enough room in inventory to pickup node.= -Cannot pickup node containing @1.= -Cannot pickup node. Nesting inventories is not allowed.= -Cannot pickup node. Node contains too much metadata.= diff --git a/wrench/locale/wrench.ja.tr b/wrench/locale/wrench.ja.tr deleted file mode 100644 index 647dd057..00000000 --- a/wrench/locale/wrench.ja.tr +++ /dev/null @@ -1,8 +0,0 @@ -# textdomain: wrench - -# technic_wrench japanese translation -# technic_wrenchの日本語への翻訳 -# by damiemk - -Wrench=レンチ -@1 with items=アイテム付きレンチ @1 diff --git a/wrench/locale/wrench.pl.tr b/wrench/locale/wrench.pl.tr deleted file mode 100644 index 9a707630..00000000 --- a/wrench/locale/wrench.pl.tr +++ /dev/null @@ -1,14 +0,0 @@ -# textdomain: wrench - -# Polish Translation for technic_wrench -# Polskie tłumaczenie technic_wrench -# by mat9117 - -Wrench=Klucz -@1 with items=@1 z rzeczami - -Cannot pickup node. Owned by @1.= -Not enough room in inventory to pickup node.= -Cannot pickup node containing @1.= -Cannot pickup node. Nesting inventories is not allowed.= -Cannot pickup node. Node contains too much metadata.= diff --git a/wrench/locale/wrench.pt_BR.tr b/wrench/locale/wrench.pt_BR.tr deleted file mode 100644 index 577cfad2..00000000 --- a/wrench/locale/wrench.pt_BR.tr +++ /dev/null @@ -1,14 +0,0 @@ -# textdomain: wrench - -# Braziliam portuguese translation for wrench -# Tradução portuguesa brasileira para wrench -# By Sires - -Wrench=Chave Inglesa -@1 with items=@1 com items - -Cannot pickup node. Owned by @1.= -Not enough room in inventory to pickup node.= -Cannot pickup node containing @1.= -Cannot pickup node. Nesting inventories is not allowed.= -Cannot pickup node. Node contains too much metadata.= diff --git a/wrench/locale/wrench.tr.tr b/wrench/locale/wrench.tr.tr deleted file mode 100644 index d33af980..00000000 --- a/wrench/locale/wrench.tr.tr +++ /dev/null @@ -1,12 +0,0 @@ -# textdomain: wrench - -# Turkish translation by mahmutelmas06 -# mahmutelmas06@hotmail.com - -Wrench=İngiliz anahtarı -@1 with items=Araçlarla birlikte @1 -Cannot pickup node. Owned by @1.= -Not enough room in inventory to pickup node.= -Cannot pickup node containing @1.= -Cannot pickup node. Nesting inventories is not allowed.= -Cannot pickup node. Node contains too much metadata.= diff --git a/wrench/locale/wrench.zh_CN.tr b/wrench/locale/wrench.zh_CN.tr deleted file mode 100644 index 9d53dd52..00000000 --- a/wrench/locale/wrench.zh_CN.tr +++ /dev/null @@ -1,9 +0,0 @@ -# textdomain: wrench - -Wrench=扳手 -@1 with items=@1带物品 -Cannot pickup node. Owned by @1.= -Not enough room in inventory to pickup node.= -Cannot pickup node containing @1.= -Cannot pickup node. Nesting inventories is not allowed.= -Cannot pickup node. Node contains too much metadata.= diff --git a/wrench/mod.conf b/wrench/mod.conf deleted file mode 100644 index f784bbcd..00000000 --- a/wrench/mod.conf +++ /dev/null @@ -1,2 +0,0 @@ -name = wrench -optional_depends = technic, technic_chests, technic_worldgen, drawers, default, digtron diff --git a/wrench/nodes/default.lua b/wrench/nodes/default.lua deleted file mode 100644 index 17902e00..00000000 --- a/wrench/nodes/default.lua +++ /dev/null @@ -1,63 +0,0 @@ - --- Register nodes from default / minetest_game - -wrench.register_node("default:chest", { - lists = {"main"}, -}) - -wrench.register_node("default:chest_locked", { - lists = {"main"}, - metas = { - owner = wrench.META_TYPE_STRING, - infotext = wrench.META_TYPE_STRING - }, - owned = true, -}) - -wrench.register_node("default:furnace", { - lists = {"fuel", "src", "dst"}, - metas = { - infotext = wrench.META_TYPE_STRING, - fuel_totaltime = wrench.META_TYPE_FLOAT, - fuel_time = wrench.META_TYPE_FLOAT, - src_totaltime = wrench.META_TYPE_FLOAT, - src_time = wrench.META_TYPE_FLOAT - }, -}) - -wrench.register_node("default:furnace_active", { - lists = {"fuel", "src", "dst"}, - metas = { - infotext = wrench.META_TYPE_STRING, - fuel_totaltime = wrench.META_TYPE_FLOAT, - fuel_time = wrench.META_TYPE_FLOAT, - src_totaltime = wrench.META_TYPE_FLOAT, - src_time = wrench.META_TYPE_FLOAT - }, - store_meta_always = true, -}) - -local function get_sign_description(pos, meta, node) - local desc = minetest.registered_nodes[node.name].description - local text = meta:get_string("text") - if #text > 32 then - text = text:sub(1, 24).."..." - end - return string.format("%s with text \"%s\"", desc, text) -end - -wrench.register_node("default:sign_wall_wood", { - metas = { - infotext = wrench.META_TYPE_STRING, - text = wrench.META_TYPE_STRING - }, - description = get_sign_description, -}) - -wrench.register_node("default:sign_wall_steel", { - metas = { - infotext = wrench.META_TYPE_STRING, - text = wrench.META_TYPE_STRING - }, - description = get_sign_description, -}) diff --git a/wrench/nodes/digtron.lua b/wrench/nodes/digtron.lua deleted file mode 100644 index 2273d669..00000000 --- a/wrench/nodes/digtron.lua +++ /dev/null @@ -1,23 +0,0 @@ - --- Register wrench support for digtron - -wrench.register_node("digtron:battery_holder", { - lists = {"batteries"} -}) - -wrench.register_node("digtron:inventory", { - lists = {"main"} -}) - -wrench.register_node("digtron:fuelstore", { - lists = {"fuel"} -}) - -wrench.register_node("digtron:combined_storage", { - lists = {"main", "fuel"} -}) - --- Blacklist loaded crates to prevent nesting of inventories - -wrench.blacklist_item("digtron:loaded_crate") -wrench.blacklist_item("digtron:loaded_locked_crate") diff --git a/wrench/nodes/drawers.lua b/wrench/nodes/drawers.lua deleted file mode 100644 index e5c4e851..00000000 --- a/wrench/nodes/drawers.lua +++ /dev/null @@ -1,36 +0,0 @@ - --- Register wrench support for drawers mod nodes - -local INT, STRING = wrench.META_TYPE_INT, wrench.META_TYPE_STRING - --- Assemble definitions for drawer type 1, 2 and 4 -for _, drawer_type in ipairs({1, 2, 4}) do - - local def = { - lists = {"upgrades"}, - metas = {}, - after_place = drawers.spawn_visuals - } - - for i=1, drawer_type do - - local suffix = "" - if drawer_type ~= 1 then - -- Index as suffix - suffix = i - end - - def.metas["name" .. suffix] = STRING - def.metas["count" .. suffix] = INT - def.metas["max_count" .. suffix] = INT - def.metas["base_stack_max" .. suffix] = INT - def.metas["entity_infotext" .. suffix] = STRING - def.metas["stack_max_factor" .. suffix] = INT - end - - wrench.register_node("drawers:wood" .. drawer_type, def) - wrench.register_node("drawers:acacia_wood" .. drawer_type, def) - wrench.register_node("drawers:aspen_wood" .. drawer_type, def) - wrench.register_node("drawers:junglewood" .. drawer_type, def) - wrench.register_node("drawers:pine_wood" .. drawer_type, def) -end diff --git a/wrench/nodes/technic.lua b/wrench/nodes/technic.lua deleted file mode 100644 index 288b8573..00000000 --- a/wrench/nodes/technic.lua +++ /dev/null @@ -1,93 +0,0 @@ - --- Register wrench support for technic mod machines and other containers - -local machine_invlist = {"src", "dst"} -local machine_invlist_upgrades = {"src", "dst", "upgrade1", "upgrade2"} - -local function register_machine_node(nodename, tier) - local lists = tier ~= "LV" and machine_invlist_upgrades or machine_invlist - local metas = { - infotext = wrench.META_TYPE_STRING, - formspec = wrench.META_TYPE_STRING, - [tier.."_EU_demand"] = wrench.META_TYPE_INT, - [tier.."_EU_input"] = wrench.META_TYPE_INT, - tube_time = tier ~= "LV" and wrench.META_TYPE_INT or nil, - src_time = wrench.META_TYPE_INT, - } - wrench.register_node(nodename, {lists = lists, metas = metas}) -end - --- base_machines table row format: name = { extra meta fields } -local defaults = { tiers = {"LV", "MV", "HV"} } -local base_machines = { - electric_furnace = defaults, - grinder = defaults, - compressor = defaults, - alloy_furnace = {tiers = {"LV", "MV"}}, - extractor = {tiers = {"LV", "MV"}}, - centrifuge = {tiers = {"MV"}}, - freezer = {tiers = {"MV"}}, -} - -for name, data in pairs(base_machines) do - for _,tier in ipairs(data.tiers) do - local nodename = "technic:"..tier:lower().."_"..name - register_machine_node(nodename, tier) - if minetest.registered_nodes[nodename.."_active"] then - register_machine_node(nodename.."_active", tier) - end - end -end - ---------------------------------------------------------------------- --- Special nodes - -wrench.register_node("technic:coal_alloy_furnace", { - lists = {"fuel", "src", "dst"}, - metas = { - infotext = wrench.META_TYPE_STRING, - fuel_totaltime = wrench.META_TYPE_FLOAT, - fuel_time = wrench.META_TYPE_FLOAT, - src_totaltime = wrench.META_TYPE_FLOAT, - src_time = wrench.META_TYPE_FLOAT - }, -}) - -wrench.register_node("technic:coal_alloy_furnace_active", { - lists = {"fuel", "src", "dst"}, - metas = { - infotext = wrench.META_TYPE_STRING, - fuel_totaltime = wrench.META_TYPE_FLOAT, - fuel_time = wrench.META_TYPE_FLOAT, - src_totaltime = wrench.META_TYPE_FLOAT, - src_time = wrench.META_TYPE_FLOAT - }, -}) - -wrench.register_node("technic:tool_workshop", { - lists = {"src", "upgrade1", "upgrade2"}, - metas = { - infotext = wrench.META_TYPE_STRING, - formspec = wrench.META_TYPE_STRING, - MV_EU_demand = wrench.META_TYPE_INT, - MV_EU_input = wrench.META_TYPE_INT, - tube_time = wrench.META_TYPE_INT - }, -}) - -for _, tier in pairs({"LV", "MV", "HV"}) do - for i = 0, 8 do - wrench.register_node("technic:"..tier:lower().."_battery_box"..i, { - lists = tier ~= "LV" and machine_invlist_upgrades or machine_invlist, - metas = { - infotext = wrench.META_TYPE_STRING, - formspec = wrench.META_TYPE_STRING, - [tier.."_EU_demand"] = wrench.META_TYPE_INT, - [tier.."_EU_supply"] = wrench.META_TYPE_INT, - [tier.."_EU_input"] = wrench.META_TYPE_INT, - internal_EU_charge = wrench.META_TYPE_INT, - last_side_shown = wrench.META_TYPE_INT - }, - }) - end -end diff --git a/wrench/nodes/technic_chests.lua b/wrench/nodes/technic_chests.lua deleted file mode 100644 index 9e97b14e..00000000 --- a/wrench/nodes/technic_chests.lua +++ /dev/null @@ -1,112 +0,0 @@ - --- Register wrench support for technic_chests - -local function get_chest_description(pos, meta, node) - local desc = minetest.registered_nodes[node.name].description - local text = meta:get_string("infotext") - if text ~= desc then - return text - end -end - -local function with_owner_field(metas) - local result = table.copy(metas) - result.owner = wrench.META_TYPE_STRING - return result -end - -local chests_meta = { - iron = { - infotext = wrench.META_TYPE_STRING, - formspec = wrench.META_TYPE_STRING, - sort_mode = wrench.META_TYPE_INT, - }, - copper = { - infotext = wrench.META_TYPE_STRING, - formspec = wrench.META_TYPE_STRING, - sort_mode = wrench.META_TYPE_INT, - autosort = wrench.META_TYPE_INT, - }, - silver = { - infotext = wrench.META_TYPE_STRING, - formspec = wrench.META_TYPE_STRING, - sort_mode = wrench.META_TYPE_INT, - autosort = wrench.META_TYPE_INT, - }, - gold = { - infotext = wrench.META_TYPE_STRING, - formspec = wrench.META_TYPE_STRING, - sort_mode = wrench.META_TYPE_INT, - autosort = wrench.META_TYPE_INT, - }, - mithril = { - infotext = wrench.META_TYPE_STRING, - formspec = wrench.META_TYPE_STRING, - sort_mode = wrench.META_TYPE_INT, - autosort = wrench.META_TYPE_INT, - channel = wrench.META_TYPE_STRING, - send_put = wrench.META_TYPE_INT, - send_take = wrench.META_TYPE_INT, - send_inject = wrench.META_TYPE_INT, - send_pull = wrench.META_TYPE_INT, - send_overflow = wrench.META_TYPE_INT, - }, -} - -for name, metas in pairs(chests_meta) do - wrench.register_node("technic:"..name.."_chest", { - lists = {"main"}, - metas = metas, - description = get_chest_description, - }) - wrench.register_node("technic:"..name.."_protected_chest", { - lists = {"main"}, - metas = metas, - description = get_chest_description, - }) - wrench.register_node("technic:"..name.."_locked_chest", { - lists = {"main"}, - metas = with_owner_field(metas), - description = get_chest_description, - owned = true, - }) -end - --- Register extra nodes with color marking for gold chest - -local chest_mark_colors = { - '_black', - '_blue', - '_brown', - '_cyan', - '_dark_green', - '_dark_grey', - '_green', - '_grey', - '_magenta', - '_orange', - '_pink', - '_red', - '_violet', - '_white', - '_yellow', -} - -for i = 1, 15 do - wrench.register_node("technic:gold_chest"..chest_mark_colors[i], { - lists = {"main"}, - metas = chests_meta.gold, - description = get_chest_description, - }) - wrench.register_node("technic:gold_protected_chest"..chest_mark_colors[i], { - lists = {"main"}, - metas = chests_meta.gold, - description = get_chest_description, - }) - wrench.register_node("technic:gold_locked_chest"..chest_mark_colors[i], { - lists = {"main"}, - metas = with_owner_field(chests_meta.gold), - description = get_chest_description, - owned = true, - }) -end diff --git a/wrench/nodes/technic_cnc.lua b/wrench/nodes/technic_cnc.lua deleted file mode 100644 index 3adf8bb6..00000000 --- a/wrench/nodes/technic_cnc.lua +++ /dev/null @@ -1,40 +0,0 @@ - --- Register wrench support for Technic CNC - -local function register_cnc(name, def) - wrench.register_node(name, def) - if minetest.registered_nodes[name.."_active"] then - -- Only available if technic is active - wrench.register_node(name.."_active", def) - end -end - -register_cnc("technic:cnc", { - lists = {"src", "dst"}, - metas = { - infotext = wrench.META_TYPE_STRING, - formspec = wrench.META_TYPE_STRING, - LV_EU_demand = wrench.META_TYPE_INT, - LV_EU_input = wrench.META_TYPE_INT, - src_time = wrench.META_TYPE_INT, - size = wrench.META_TYPE_INT, - program = wrench.META_TYPE_STRING, - cnc_user = wrench.META_TYPE_STRING, - }, -}) - -if minetest.registered_nodes["technic:cnc_mk2"] then - register_cnc("technic:cnc_mk2", { - lists = {"src", "dst", "upgrade1", "upgrade2"}, - metas = { - infotext = wrench.META_TYPE_STRING, - formspec = wrench.META_TYPE_STRING, - LV_EU_demand = wrench.META_TYPE_INT, - LV_EU_input = wrench.META_TYPE_INT, - src_time = wrench.META_TYPE_INT, - size = wrench.META_TYPE_INT, - program = wrench.META_TYPE_STRING, - cnc_user = wrench.META_TYPE_STRING, - }, - }) -end diff --git a/wrench/textures/technic_wrench.png b/wrench/textures/technic_wrench.png deleted file mode 100644 index 0b57c7f748fa137763ca530240f44d07319a5978..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJPk>K|E0Bf&e}Dh`YdpF diff --git a/wrench/tool.lua b/wrench/tool.lua deleted file mode 100644 index 2e759021..00000000 --- a/wrench/tool.lua +++ /dev/null @@ -1,37 +0,0 @@ - -local S = minetest.get_translator(minetest.get_current_modname()) - -minetest.register_tool("wrench:wrench", { - description = S("Wrench"), - inventory_image = "technic_wrench.png", - on_use = function(itemstack, player, pointed_thing) - if not player or not pointed_thing then - return - end - local name = player:get_player_name() - local pos = pointed_thing.under - if not pos or minetest.is_protected(pos, name) then - return - end - local picked_up, err_msg = wrench.pickup_node(pos, player) - if not picked_up then - if err_msg then - minetest.chat_send_player(name, err_msg) - end - return - end - itemstack:add_wear(65535 / 20) - return itemstack - end, -}) - -if minetest.get_modpath("technic") and technic.config:get_bool("enable_wrench_crafting") then - minetest.register_craft({ - output = "wrench:wrench", - recipe = { - {"technic:carbon_steel_ingot", "", "technic:carbon_steel_ingot"}, - {"", "technic:carbon_steel_ingot", ""}, - {"", "technic:carbon_steel_ingot", ""} - } - }) -end From f214e33e523da57c93c5492b900cf7b225a530d5 Mon Sep 17 00:00:00 2001 From: OgelGames Date: Mon, 7 Aug 2023 15:15:16 +1000 Subject: [PATCH 2/2] add note to readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 32254036..ad0eddd4 100644 --- a/README.md +++ b/README.md @@ -98,12 +98,15 @@ Suitable for multiplayer environments. ## Compatibility This mod is meant as a **drop-in replacement** for the upstream `technic` mod. + It also provides some additional machines and items, notably: * HV Grinder, Furnace, and Compressor * LV Lamp * LV, MV, and HV Digiline cables +Note that the `wrench` mod has been separated from the modpack. It can now be found at [mt-mods/wrench](https://github.com/mt-mods/wrench). + # Recommended mods Dependencies: