From 8ebc1de29c2c5105ed4348fd8e93d3787dd106d9 Mon Sep 17 00:00:00 2001 From: Vanessa Dannenberg Date: Mon, 17 Dec 2018 01:53:07 -0500 Subject: [PATCH 1/5] make sure MV turbines only turn on in response to *flowing* water --- technic/machines/MV/hydro_turbine.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/technic/machines/MV/hydro_turbine.lua b/technic/machines/MV/hydro_turbine.lua index 36aac91..e5df5e6 100644 --- a/technic/machines/MV/hydro_turbine.lua +++ b/technic/machines/MV/hydro_turbine.lua @@ -18,7 +18,7 @@ minetest.register_craft({ local function get_water_flow(pos) local node = minetest.get_node(pos) - if minetest.get_item_group(node.name, "water") == 3 then + if minetest.get_item_group(node.name, "water") == 3 and string.find(node.name, "flowing") then return node.param2 -- returns approx. water flow, if any end return 0 From 6e58a8e939206380b97a2e032553892eb111dba4 Mon Sep 17 00:00:00 2001 From: Christopher Head Date: Sat, 26 Jan 2019 05:14:45 -0800 Subject: [PATCH 2/5] Make power meter work on LV battery box (#483) --- technic/machines/register/battery_box.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/technic/machines/register/battery_box.lua b/technic/machines/register/battery_box.lua index d10b705..4f1f76e 100644 --- a/technic/machines/register/battery_box.lua +++ b/technic/machines/register/battery_box.lua @@ -129,11 +129,11 @@ local tube = { } local function add_on_off_buttons(meta, ltier, charge_percent) - local formspec = "" - if ltier == "mv" or ltier == "hv" then - formspec = "image[1,1;1,2;technic_power_meter_bg.png" + local formspec = "image[1,1;1,2;technic_power_meter_bg.png" .."^[lowpart:"..charge_percent - ..":technic_power_meter_fg.png]".. + ..":technic_power_meter_fg.png]" + if ltier == "mv" or ltier == "hv" then + formspec = formspec.. fs_helpers.cycling_button( meta, "image_button[3,2.0;1,0.6", From 5f6b87d43a7c38ae103e91180ee5d2cabf225bfb Mon Sep 17 00:00:00 2001 From: Christopher Head Date: Sat, 26 Jan 2019 05:15:08 -0800 Subject: [PATCH 3/5] Fix spelling errors (#481) --- manual.md | 2 +- technic/machines/LV/water_mill.lua | 2 +- technic/machines/MV/hydro_turbine.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manual.md b/manual.md index edca994..460f58e 100644 --- a/manual.md +++ b/manual.md @@ -1152,7 +1152,7 @@ dig identical areas, one on each side of the square cross section. ### forcefield emitter ### The forcefield emitter is an HV powered machine that generates a -forcefield remeniscent of those seen in many science-fiction stories. +forcefield reminiscent of those seen in many science-fiction stories. The emitter can be configured to generate a forcefield of either spherical or cubical shape, in either case centered on the emitter. diff --git a/technic/machines/LV/water_mill.lua b/technic/machines/LV/water_mill.lua index 33834ec..ed3c1e1 100644 --- a/technic/machines/LV/water_mill.lua +++ b/technic/machines/LV/water_mill.lua @@ -1,5 +1,5 @@ -- A water mill produces LV EUs by exploiting flowing water across it --- It is a LV EU supplyer and fairly low yield (max 180EUs) +-- It is a LV EU supplier and fairly low yield (max 180EUs) -- It is a little over half as good as the thermal generator. local S = technic.getter diff --git a/technic/machines/MV/hydro_turbine.lua b/technic/machines/MV/hydro_turbine.lua index e5df5e6..e5317fd 100644 --- a/technic/machines/MV/hydro_turbine.lua +++ b/technic/machines/MV/hydro_turbine.lua @@ -1,5 +1,5 @@ -- A Hydro Turbine produces MV EUs by exploiting flowing water across it --- It is a MV EU supplyer and fairly high yield (max 1800EUs) +-- It is a MV EU supplier and fairly high yield (max 1800EUs) local S = technic.getter From 4f78a69ffc714886c9d6e812f78d543bb33fe674 Mon Sep 17 00:00:00 2001 From: Christopher Head Date: Sat, 26 Jan 2019 05:15:40 -0800 Subject: [PATCH 4/5] Fix trailing whitespace (#482) Trim all trailing whitespace characters, --- README.md | 2 +- concrete/init.lua | 8 ++-- extranodes/init.lua | 2 +- manual.md | 8 ++-- technic/init.lua | 4 +- technic/items.lua | 6 +-- technic/locale/de.txt | 8 ++-- technic/locale/es.txt | 2 +- technic/locale/template.txt | 2 +- technic/machines/HV/cables.lua | 2 +- technic/machines/LV/cables.lua | 2 +- technic/machines/LV/geothermal.lua | 2 +- technic/machines/MV/cables.lua | 2 +- technic/machines/MV/hydro_turbine.lua | 2 +- technic/machines/MV/lighting.lua | 4 +- technic/machines/other/injector.lua | 8 ++-- technic/machines/register/alloy_recipes.lua | 2 +- technic/machines/register/cables.lua | 2 +- technic/machines/register/common.lua | 6 +-- technic/machines/register/generator.lua | 10 ++--- technic/machines/register/machine_base.lua | 2 +- technic/tools/flashlight.lua | 2 +- technic/tools/mining_drill.lua | 2 +- technic/tools/prospector.lua | 4 +- technic/tools/sonic_screwdriver.lua | 2 +- technic_chests/README.md | 2 +- technic_chests/locale/tr.txt | 2 +- technic_worldgen/locale/template.txt | 42 ++++++++++----------- technic_worldgen/locale/tr.txt | 28 +++++++------- technic_worldgen/nodes.lua | 10 ++--- wrench/support.lua | 4 +- wrench/technic.lua | 4 +- 32 files changed, 94 insertions(+), 94 deletions(-) diff --git a/README.md b/README.md index 406deab..afe1b34 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,6 @@ FAQ License ------- -Unless otherwise stated, all components of this modpack are licensed under the +Unless otherwise stated, all components of this modpack are licensed under the LGPL, V2 or later. See also the individual mod folders for their secondary/alternate licenses, if any. diff --git a/concrete/init.lua b/concrete/init.lua index d309613..ced0471 100644 --- a/concrete/init.lua +++ b/concrete/init.lua @@ -1,4 +1,4 @@ ---Minetest 0.4.7 mod: concrete +--Minetest 0.4.7 mod: concrete --(c) 2013 by RealBadAngel local technic = rawget(_G, "technic") or {} @@ -89,15 +89,15 @@ minetest.register_node(":technic:concrete_post_platform", { groups={cracky=1, level=2}, sounds = default.node_sound_stone_defaults(), paramtype = "light", - drawtype = "nodebox", + drawtype = "nodebox", node_box = { type = "fixed", fixed = {box_platform} }, on_place = function (itemstack, placer, pointed_thing) local node = minetest.get_node(pointed_thing.under) - if node.name ~= "technic:concrete_post" then - return minetest.item_place_node(itemstack, placer, pointed_thing) + if node.name ~= "technic:concrete_post" then + return minetest.item_place_node(itemstack, placer, pointed_thing) end minetest.set_node(pointed_thing.under, {name="technic:concrete_post_with_platform"}) itemstack:take_item() diff --git a/extranodes/init.lua b/extranodes/init.lua index edc7e87..b8c3093 100644 --- a/extranodes/init.lua +++ b/extranodes/init.lua @@ -87,7 +87,7 @@ if minetest.get_modpath("moreblocks") then minetest.register_alias(modname .. ":panel_" .. origname .. "_vertical", newmod..":panel_" .. newname .. "_vertical") minetest.register_alias(modname .. ":micro_" .. origname .. "_bottom", newmod..":micro_" .. newname .. "_bottom") minetest.register_alias(modname .. ":micro_" .. origname .. "_top", newmod..":micro_" .. newname .. "_top") - end + end register_technic_stairs_alias("stairsplus", "concrete", "technic", "concrete") register_technic_stairs_alias("stairsplus", "marble", "technic", "marble") diff --git a/manual.md b/manual.md index 460f58e..aeb3a4d 100644 --- a/manual.md +++ b/manual.md @@ -14,7 +14,7 @@ The technic modpack depends on some other modpacks: * pipeworks, which supports the automation of item transport * moreores, which provides some additional ore types -This manual doesn't explain how to use these other modpacks, which have +This manual doesn't explain how to use these other modpacks, which have their own manuals: * [Minetest Game Documentation](https://wiki.minetest.net/Main_Page) @@ -74,9 +74,9 @@ Although common, it is very heavily used, and most of the time it will be the material that most limits your activity. Tin is part of the basic Minetest game (having migrated there from -moreores). It is found from elevation +8 downwards, with no -elevation-dependent variations in abundance beyond that point. -It is a common metal. Its main use in pure form is as a component +moreores). It is found from elevation +8 downwards, with no +elevation-dependent variations in abundance beyond that point. +It is a common metal. Its main use in pure form is as a component of electrical batteries. Apart from that its main purpose is as the secondary ingredient in bronze (the base being copper), but bronze is itself little used. Its abundance is well in excess of its usage, diff --git a/technic/init.lua b/technic/init.lua index 0d97319..370c71b 100644 --- a/technic/init.lua +++ b/technic/init.lua @@ -26,10 +26,10 @@ dofile(modpath.."/config.lua") -- Helper functions dofile(modpath.."/helpers.lua") --- Items +-- Items dofile(modpath.."/items.lua") --- Craft recipes for items +-- Craft recipes for items dofile(modpath.."/crafts.lua") -- Register functions diff --git a/technic/items.lua b/technic/items.lua index d89ed46..cf57229 100644 --- a/technic/items.lua +++ b/technic/items.lua @@ -35,7 +35,7 @@ minetest.register_tool("technic:blue_energy_crystal", { fleshy = {times={}, uses=10000, maxlevel=0} } } -}) +}) minetest.register_tool("technic:green_energy_crystal", { description = S("Green Energy Crystal"), @@ -51,7 +51,7 @@ minetest.register_tool("technic:green_energy_crystal", { fleshy = {times={}, uses=10000, maxlevel=0} } } -}) +}) minetest.register_tool("technic:red_energy_crystal", { description = S("Red Energy Crystal"), @@ -67,7 +67,7 @@ minetest.register_tool("technic:red_energy_crystal", { fleshy = {times={}, uses=10000, maxlevel=0} } } -}) +}) minetest.register_craftitem("technic:copper_coil", { description = S("Copper Coil"), diff --git a/technic/locale/de.txt b/technic/locale/de.txt index 69bcb3d..45ff387 100644 --- a/technic/locale/de.txt +++ b/technic/locale/de.txt @@ -25,7 +25,7 @@ Mixed Metal Ingot = Mischmetallbarren Composite Plate = Verbundplatte Copper Plate = Kupferplatte Carbon Plate = Kohlefaserplatte -Graphite = Graphit +Graphite = Graphit Carbon Cloth = Kohlefasergewebe Raw Latex = Rohlatex Rubber Fiber = Gummifaser @@ -42,7 +42,7 @@ Inventory move disallowed due to protection = Das Inventar ist geschuetzt, Zugri %s Enabled = %s Idle = %s ist bereit %s Improperly Placed = %s ist falsch plaziert -%s Unpowered = %s hat keine Stromversorgung +%s Unpowered = %s hat keine Stromversorgung %s Out Of Fuel = %s hat keinen Brennstoff %s Has Bad Cabling = %s ist falsch verkabelt %s Has No Network = %s hat kein Netzwerk @@ -69,7 +69,7 @@ Disabled = %s Cable = %s Kabel %s Compressor = %s Kompressor %s Extractor = %s Extraktor -%s Forcefield Emitter = %s Kraftfeld-Emitter +%s Forcefield Emitter = %s Kraftfeld-Emitter %s Furnace = %s Ofen %s Grinder = %s Schleifmaschine %s Music Player = %s Musikspieler @@ -105,7 +105,7 @@ Administrative World Anchor = Charge = Aufladen Discharge = Entladen Power level = Energiestufe -# $1: Tier $2: current_charge $3: max_charge +# $1: Tier $2: current_charge $3: max_charge @1 Battery Box: @2/@3 = @1 Batteriebox: @2/@3 # $1: Machine name $2: Supply $3: Demand @1. Supply: @2 Demand: @3 = @1. Versorgung: @2 Bedarf: @3 diff --git a/technic/locale/es.txt b/technic/locale/es.txt index 2c1cdca..fa66988 100644 --- a/technic/locale/es.txt +++ b/technic/locale/es.txt @@ -101,7 +101,7 @@ Administrative World Anchor = Charge = Cargar Discharge = Descargar Power level = Nivel de Poder -# $1: Tier $2: current_charge $3: max_charge +# $1: Tier $2: current_charge $3: max_charge @1 Battery Box: @2/@3 = Caja de Bateria @1: @2/@3 # $1: Machine name $2: Supply $3: Demand @1. Supply: @2 Demand: @3 = @1. Alimentacion: @2 Demanda: @3 diff --git a/technic/locale/template.txt b/technic/locale/template.txt index f94ccda..12dbc65 100644 --- a/technic/locale/template.txt +++ b/technic/locale/template.txt @@ -110,7 +110,7 @@ Administrative World Anchor = Charge = Discharge = Power level = -# $1: Tier $2: current_charge $3: max_charge +# $1: Tier $2: current_charge $3: max_charge @1 Battery Box: @2/@3 = # $1: Machine name $2: Supply $3: Demand @1. Supply: @2 Demand: @3 = diff --git a/technic/machines/HV/cables.lua b/technic/machines/HV/cables.lua index 0b86a23..e084cf0 100644 --- a/technic/machines/HV/cables.lua +++ b/technic/machines/HV/cables.lua @@ -6,7 +6,7 @@ minetest.register_craft({ {'technic:mv_cable', 'technic:mv_cable', 'technic:mv_cable'}, {'homedecor:plastic_sheeting', 'homedecor:plastic_sheeting', 'homedecor:plastic_sheeting'}, } -}) +}) technic.register_cable("HV", 3/16) diff --git a/technic/machines/LV/cables.lua b/technic/machines/LV/cables.lua index d4ed880..69c0a24 100644 --- a/technic/machines/LV/cables.lua +++ b/technic/machines/LV/cables.lua @@ -8,7 +8,7 @@ minetest.register_craft({ {'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'}, {'default:paper', 'default:paper', 'default:paper'}, } -}) +}) technic.register_cable("LV", 2/16) diff --git a/technic/machines/LV/geothermal.lua b/technic/machines/LV/geothermal.lua index d828f6d..c66547e 100644 --- a/technic/machines/LV/geothermal.lua +++ b/technic/machines/LV/geothermal.lua @@ -22,7 +22,7 @@ minetest.register_craft({ minetest.register_craftitem("technic:geothermal", { description = S("Geothermal %s Generator"):format("LV"), -}) +}) local check_node_around = function(pos) local node = minetest.get_node(pos) diff --git a/technic/machines/MV/cables.lua b/technic/machines/MV/cables.lua index 0c1f457..7d63dfd 100644 --- a/technic/machines/MV/cables.lua +++ b/technic/machines/MV/cables.lua @@ -8,7 +8,7 @@ minetest.register_craft({ {'technic:lv_cable', 'technic:lv_cable', 'technic:lv_cable'}, {'technic:rubber', 'technic:rubber', 'technic:rubber'}, } -}) +}) technic.register_cable("MV", 2.5/16) diff --git a/technic/machines/MV/hydro_turbine.lua b/technic/machines/MV/hydro_turbine.lua index e5317fd..19dfebb 100644 --- a/technic/machines/MV/hydro_turbine.lua +++ b/technic/machines/MV/hydro_turbine.lua @@ -25,7 +25,7 @@ local function get_water_flow(pos) end --- --- 10 times better than LV hydro because of 2 extra water mills and 4 stainless steel, a transformer and whatnot ;P. +-- 10 times better than LV hydro because of 2 extra water mills and 4 stainless steel, a transformer and whatnot ;P. -- Man hydro turbines are tough and long lasting. So, give it some value :) local run = function(pos, node) local meta = minetest.get_meta(pos) diff --git a/technic/machines/MV/lighting.lua b/technic/machines/MV/lighting.lua index 76fcb20..8ff2702 100644 --- a/technic/machines/MV/lighting.lua +++ b/technic/machines/MV/lighting.lua @@ -49,7 +49,7 @@ local dirs1 = {20, 23, 22, 21} local dirs2 = {9, 18, 7, 12} local technic_homedecor_rotate_and_place = function(itemstack, placer, pointed_thing) - if not technic_homedecor_node_is_owned(pointed_thing.under, placer) + if not technic_homedecor_node_is_owned(pointed_thing.under, placer) and not technic_homedecor_node_is_owned(pointed_thing.above, placer) then local node = minetest.get_node(pointed_thing.under) if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].on_rightclick then @@ -76,7 +76,7 @@ local technic_homedecor_rotate_and_place = function(itemstack, placer, pointed_t if not minetest.registered_nodes[minetest.get_node(pos1).name]["buildable_to"] then return end - if iswall then + if iswall then minetest.add_node(pos1, {name = wield_name, param2 = dirs2[fdir+1] }) -- place wall variant elseif isceiling then minetest.add_node(pos1, {name = wield_name, param2 = 20 }) -- place upside down variant diff --git a/technic/machines/other/injector.lua b/technic/machines/other/injector.lua index 4fe78b2..c98be59 100644 --- a/technic/machines/other/injector.lua +++ b/technic/machines/other/injector.lua @@ -6,7 +6,7 @@ local fs_helpers = pipeworks.fs_helpers local tube_entry = "^pipeworks_tube_connection_metallic.png" local function inject_items (pos) - local meta=minetest.get_meta(pos) + local meta=minetest.get_meta(pos) local inv = meta:get_inventory() local mode=meta:get_string("mode") if mode=="single items" then @@ -15,7 +15,7 @@ local function inject_items (pos) i=i+1 if stack then local item0=stack:to_table() - if item0 then + if item0 then item0["count"] = "1" technic.tube_inject_item(pos, pos, vector.new(0, -1, 0), item0) stack:take_item(1) @@ -31,7 +31,7 @@ local function inject_items (pos) i=i+1 if stack then local item0=stack:to_table() - if item0 then + if item0 then technic.tube_inject_item(pos, pos, vector.new(0, -1, 0), item0) stack:clear() inv:set_stack("main", i, stack) @@ -142,7 +142,7 @@ minetest.register_abm({ chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) local pos1 = vector.add(pos, vector.new(0, -1, 0)) - local node1 = minetest.get_node(pos1) + local node1 = minetest.get_node(pos1) if minetest.get_item_group(node1.name, "tubedevice") > 0 then inject_items(pos) end diff --git a/technic/machines/register/alloy_recipes.lua b/technic/machines/register/alloy_recipes.lua index 8731b8e..d5a4a4e 100644 --- a/technic/machines/register/alloy_recipes.lua +++ b/technic/machines/register/alloy_recipes.lua @@ -26,7 +26,7 @@ local recipes = { {"technic:silicon_wafer", "technic:gold_dust", "technic:doped_silicon_wafer"}, -- from https://en.wikipedia.org/wiki/Carbon_black -- The highest volume use of carbon black is as a reinforcing filler in rubber products, especially tires. - -- "[Compounding a] pure gum vulcanizate … with 50% of its weight of carbon black improves its tensile strength and wear resistance …" + -- "[Compounding a] pure gum vulcanizate … with 50% of its weight of carbon black improves its tensile strength and wear resistance …" {"technic:raw_latex 4", "technic:coal_dust 2", "technic:rubber 6", 2}, } diff --git a/technic/machines/register/cables.lua b/technic/machines/register/cables.lua index 924128e..63ee851 100644 --- a/technic/machines/register/cables.lua +++ b/technic/machines/register/cables.lua @@ -122,7 +122,7 @@ local function item_place_override_node(itemstack, placer, pointed, node) local temp_itemstack = ItemStack(itemstack) temp_itemstack:set_name(node.name) local original_count = temp_itemstack:get_count() - temp_itemstack = + temp_itemstack = minetest.item_place(temp_itemstack, placer, pointed, node.param2) or temp_itemstack -- Remove the same number of items from the real itemstack diff --git a/technic/machines/register/common.lua b/technic/machines/register/common.lua index dfa2948..38354f9 100644 --- a/technic/machines/register/common.lua +++ b/technic/machines/register/common.lua @@ -66,14 +66,14 @@ function technic.send_items(pos, x_velocity, z_velocity, output_name) output_name = "dst" end - local meta = minetest.get_meta(pos) + local meta = minetest.get_meta(pos) local inv = meta:get_inventory() local i = 0 for _, stack in ipairs(inv:get_list(output_name)) do i = i + 1 if stack then local item0 = stack:to_table() - if item0 then + if item0 then item0["count"] = "1" technic.tube_inject_item(pos, pos, vector.new(x_velocity, 0, z_velocity), item0) stack:take_item(1) @@ -124,7 +124,7 @@ function technic.handle_machine_pipeworks(pos, tube_upgrade, send_function) if node.param2 == 0 then pos1.x = pos1.x + 1 x_velocity = 1 end local output_tube_connected = false - local node1 = minetest.get_node(pos1) + local node1 = minetest.get_node(pos1) if minetest.get_item_group(node1.name, "tubedevice") > 0 then output_tube_connected = true end diff --git a/technic/machines/register/generator.lua b/technic/machines/register/generator.lua index 87ef6e7..f8d7e6a 100644 --- a/technic/machines/register/generator.lua +++ b/technic/machines/register/generator.lua @@ -57,7 +57,7 @@ function technic.register_generator(data) -- Burn another piece of fuel if burn_time == 0 then local inv = meta:get_inventory() - if not inv:is_empty("src") then + if not inv:is_empty("src") then local fuellist = inv:get_list("src") local fuel local afterfuel @@ -96,7 +96,7 @@ function technic.register_generator(data) } )..pipeworks.button_label end - meta:set_string("formspec", + meta:set_string("formspec", "size[8, 9]".. "label[0, 0;"..minetest.formspec_escape(desc).."]".. "list[current_name;src;3, 1;1, 1;]".. @@ -120,7 +120,7 @@ function technic.register_generator(data) "technic_"..ltier.."_generator_side.png"..tentry, "technic_"..ltier.."_generator_side.png"..tentry, "technic_"..ltier.."_generator_front.png" - }, + }, paramtype2 = "facedir", groups = groups, connect_sides = {"bottom", "back", "left", "right"}, @@ -240,7 +240,7 @@ function technic.register_generator(data) } )..pipeworks.button_label end - meta:set_string("formspec", + meta:set_string("formspec", "size[8, 9]".. "label[0, 0;"..minetest.formspec_escape(desc).."]".. "list[current_name;src;3, 1;1, 1;]".. @@ -274,7 +274,7 @@ function technic.register_generator(data) local burn_time = meta:get_int("burn_time") local percent = math.floor(burn_time / burn_totaltime * 100) - meta:set_string("formspec", + meta:set_string("formspec", "size[8, 9]".. "label[0, 0;"..minetest.formspec_escape(desc).."]".. "list[current_name;src;3, 1;1, 1;]".. diff --git a/technic/machines/register/machine_base.lua b/technic/machines/register/machine_base.lua index 14cf998..15fb8ea 100644 --- a/technic/machines/register/machine_base.lua +++ b/technic/machines/register/machine_base.lua @@ -147,7 +147,7 @@ function technic.register_base_machine(data) minetest.register_node("technic:"..ltier.."_"..machine_name, { description = machine_desc:format(tier), tiles = { - "technic_"..ltier.."_"..machine_name.."_top.png"..tentry, + "technic_"..ltier.."_"..machine_name.."_top.png"..tentry, "technic_"..ltier.."_"..machine_name.."_bottom.png"..tentry, "technic_"..ltier.."_"..machine_name.."_side.png"..tentry, "technic_"..ltier.."_"..machine_name.."_side.png"..tentry, diff --git a/technic/tools/flashlight.lua b/technic/tools/flashlight.lua index 252dc8c..30f2480 100644 --- a/technic/tools/flashlight.lua +++ b/technic/tools/flashlight.lua @@ -8,7 +8,7 @@ local S = technic.getter technic.register_power_tool("technic:flashlight", flashlight_max_charge) minetest.register_alias("technic:light_off", "air") - + minetest.register_tool("technic:flashlight", { description = S("Flashlight"), inventory_image = "technic_flashlight.png", diff --git a/technic/tools/mining_drill.lua b/technic/tools/mining_drill.lua index 250c461..cb16914 100644 --- a/technic/tools/mining_drill.lua +++ b/technic/tools/mining_drill.lua @@ -62,7 +62,7 @@ end local function drill_dig_it1 (player) local dir=player:get_look_dir() - if math.abs(dir.x)>math.abs(dir.z) then + if math.abs(dir.x)>math.abs(dir.z) then if dir.x>0 then return 0 end return 1 end diff --git a/technic/tools/prospector.lua b/technic/tools/prospector.lua index 9a918a2..12437a7 100644 --- a/technic/tools/prospector.lua +++ b/technic/tools/prospector.lua @@ -93,7 +93,7 @@ minetest.register_tool("technic:prospector", { "label[0,7.5;Accuracy:]".. "label[0,8;98%]") return - end, + end, }) minetest.register_on_player_receive_fields(function(user, formname, fields) @@ -117,7 +117,7 @@ minetest.register_on_player_receive_fields(function(user, formname, fields) user:set_wielded_item(toolstack) return true end) - + minetest.register_craft({ output = "technic:prospector", recipe = { diff --git a/technic/tools/sonic_screwdriver.lua b/technic/tools/sonic_screwdriver.lua index 300d363..536f47c 100644 --- a/technic/tools/sonic_screwdriver.lua +++ b/technic/tools/sonic_screwdriver.lua @@ -86,7 +86,7 @@ minetest.register_tool("technic:sonic_screwdriver", { return itemstack end, }) - + minetest.register_craft({ output = "technic:sonic_screwdriver", recipe = { diff --git a/technic_chests/README.md b/technic_chests/README.md index a570346..c4f3eac 100644 --- a/technic_chests/README.md +++ b/technic_chests/README.md @@ -18,7 +18,7 @@ VanessaE: (WTFPL) sdzen (Elise Staudter) modified by VanessaE (CC BY-SA 3.0): * copper, iron, silver, gold, mithril chest textures 16x16 - + RealBadAngel: (WTFPL) * Everything else. diff --git a/technic_chests/locale/tr.txt b/technic_chests/locale/tr.txt index 6bef5be..1f07ce6 100644 --- a/technic_chests/locale/tr.txt +++ b/technic_chests/locale/tr.txt @@ -1,5 +1,5 @@ # Turkish translation -# mahmutelmas06@hotmail.com +# mahmutelmas06@hotmail.com # Türkçe çeviri %s Chest = %s Sandık diff --git a/technic_worldgen/locale/template.txt b/technic_worldgen/locale/template.txt index 594e0ce..40d0029 100644 --- a/technic_worldgen/locale/template.txt +++ b/technic_worldgen/locale/template.txt @@ -2,36 +2,36 @@ # technic_worldgen translation template ###crafts.lua -Uranium Lump = -Uranium Ingot = -Chromium Lump = -Chromium Ingot = -Zinc Lump = -Zinc Ingot = -Brass Ingot = +Uranium Lump = +Uranium Ingot = +Chromium Lump = +Chromium Ingot = +Zinc Lump = +Zinc Ingot = +Brass Ingot = Wrought Iron Ingot = Cast Iron Ingot = Carbon Steel Ingot = -Stainless Steel Ingot = +Stainless Steel Ingot = Iron = ###nodes.lua -Uranium Ore = -Chromium Ore = -Zinc Ore = -Granite = -Marble = -Marble Bricks = -Uranium Block = -Chromium Block = -Zinc Block = +Uranium Ore = +Chromium Ore = +Zinc Ore = +Granite = +Marble = +Marble Bricks = +Uranium Block = +Chromium Block = +Zinc Block = Wrought Iron Block = Cast Iron Block = Carbon Steel Block = -Stainless Steel Block = -Brass Block = +Stainless Steel Block = +Brass Block = Wrought Iron = ###rubber.lua -Rubber Tree Sapling = -Rubber Tree = +Rubber Tree Sapling = +Rubber Tree = diff --git a/technic_worldgen/locale/tr.txt b/technic_worldgen/locale/tr.txt index a04597f..1c0fc44 100644 --- a/technic_worldgen/locale/tr.txt +++ b/technic_worldgen/locale/tr.txt @@ -1,38 +1,38 @@ # Turkish translation -# mahmutelmas06@hotmail.com +# mahmutelmas06@hotmail.com # Türkçe çeviri ###crafts.lua -Uranium Lump = Uranyum yığını +Uranium Lump = Uranyum yığını Uranium Ingot = Uranyum külçesi Chromium Lump = Krom yığını Chromium Ingot = Krom külçesi Zinc Lump = Çinko yığını Zinc Ingot = Çünko külçesi -Brass Ingot = Pirinç yığını +Brass Ingot = Pirinç yığını Wrought Iron Ingot = İşlenmiş demir yığını Cast Iron Ingot = Döküm demir yığını -Carbon Steel Ingot = Karbon çelik külçe -Stainless Steel Ingot =Paslanmaz çelik külçe +Carbon Steel Ingot = Karbon çelik külçe +Stainless Steel Ingot =Paslanmaz çelik külçe Iron = Demir ###nodes.lua -Uranium Ore = Uranyum madeni -Chromium Ore = Krom madeni -Zinc Ore = Çinko madeni +Uranium Ore = Uranyum madeni +Chromium Ore = Krom madeni +Zinc Ore = Çinko madeni Granite = Granit Marble = Mermer -Marble Bricks = Mermer tuğla -Uranium Block = Uranyum blok -Chromium Block = Karbon blok -Zinc Block = Çinko blok +Marble Bricks = Mermer tuğla +Uranium Block = Uranyum blok +Chromium Block = Karbon blok +Zinc Block = Çinko blok Wrought Iron Block = İşlenmiş demir blok Cast Iron Block = Döküm demir blok Carbon Steel Block = Karbon çelik blok -Stainless Steel Block = Paslanmaz çelik blok +Stainless Steel Block = Paslanmaz çelik blok Brass Block = Pirinç blok Wrought Iron = İşlenmiş demir ###rubber.lua Rubber Tree Sapling = Kauçuk ağacı fidanı -Rubber Tree = Kauçuk ağacı +Rubber Tree = Kauçuk ağacı diff --git a/technic_worldgen/nodes.lua b/technic_worldgen/nodes.lua index 14b4eba..d4d3e4c 100644 --- a/technic_worldgen/nodes.lua +++ b/technic_worldgen/nodes.lua @@ -8,7 +8,7 @@ minetest.register_node( ":technic:mineral_uranium", { groups = {cracky=3, radioactive=1}, sounds = default.node_sound_stone_defaults(), drop = "technic:uranium_lump", -}) +}) minetest.register_node( ":technic:mineral_chromium", { description = S("Chromium Ore"), @@ -17,7 +17,7 @@ minetest.register_node( ":technic:mineral_chromium", { groups = {cracky=3}, sounds = default.node_sound_stone_defaults(), drop = "technic:chromium_lump", -}) +}) minetest.register_node( ":technic:mineral_zinc", { description = S("Zinc Ore"), @@ -52,7 +52,7 @@ minetest.register_node( ":technic:granite", { is_ground_content = true, groups = {cracky=1}, sounds = default.node_sound_stone_defaults(), -}) +}) minetest.register_node( ":technic:marble", { description = S("Marble"), @@ -60,7 +60,7 @@ minetest.register_node( ":technic:marble", { is_ground_content = true, groups = {cracky=3, marble=1}, sounds = default.node_sound_stone_defaults(), -}) +}) minetest.register_node( ":technic:marble_bricks", { description = S("Marble Bricks"), @@ -68,7 +68,7 @@ minetest.register_node( ":technic:marble_bricks", { is_ground_content = true, groups = {cracky=3}, sounds = default.node_sound_stone_defaults(), -}) +}) minetest.register_node(":technic:uranium_block", { description = S("Uranium Block"), diff --git a/wrench/support.lua b/wrench/support.lua index 1d21811..21aebfc 100644 --- a/wrench/support.lua +++ b/wrench/support.lua @@ -11,7 +11,7 @@ Syntax: store_meta_always = true, } owned - nodes that are protected by owner requirements (Ex. locked chests) - store_meta_always - when nodes are broken this ensures metadata and + store_meta_always - when nodes are broken this ensures metadata and inventory is always stored (Ex. active state for machines) --]] @@ -19,7 +19,7 @@ wrench.META_TYPE_INT = 0 wrench.META_TYPE_FLOAT = 1 wrench.META_TYPE_STRING = 2 -local INT, STRING, FLOAT = +local INT, STRING, FLOAT = wrench.META_TYPE_INT, wrench.META_TYPE_STRING, wrench.META_TYPE_FLOAT diff --git a/wrench/technic.lua b/wrench/technic.lua index c404180..5b529e8 100644 --- a/wrench/technic.lua +++ b/wrench/technic.lua @@ -1,5 +1,5 @@ -local INT, STRING, FLOAT = +local INT, STRING, FLOAT = wrench.META_TYPE_INT, wrench.META_TYPE_STRING, wrench.META_TYPE_FLOAT @@ -294,7 +294,7 @@ wrench:register_node("technic:mv_centrifuge_active", { local chest_mark_colors = { '_black', - '_blue', + '_blue', '_brown', '_cyan', '_dark_green', From 5bddd0c7fae8543585255d9aa55c634972160a2d Mon Sep 17 00:00:00 2001 From: Thomas Rudin Date: Fri, 1 Feb 2019 21:20:03 +0100 Subject: [PATCH 5/5] add mithril protected chest (works with any protection mod that overrides minetest.is_protected()) --- technic_chests/common.lua | 24 +++++++++++++++++- technic_chests/depends.txt | 2 ++ technic_chests/mithril_chest.lua | 22 +++++++++++++++++ technic_chests/register.lua | 42 +++++++++++++++++++++++++++++--- 4 files changed, 86 insertions(+), 4 deletions(-) diff --git a/technic_chests/common.lua b/technic_chests/common.lua index 6369b7a..e0e98b0 100644 --- a/technic_chests/common.lua +++ b/technic_chests/common.lua @@ -27,6 +27,8 @@ technic.chests.can_dig = function(pos, player) return inv:is_empty("main") end +-- utils for locked chest + local function inv_change(pos, count, player) -- Skip check for pipeworks (fake player) if minetest.is_player(player) and @@ -46,6 +48,27 @@ function technic.chests.inv_take(pos, listname, index, stack, player) return inv_change(pos, stack:get_count(), player) end +-- utils for protected chest + +local function inv_change_protected(pos, count, player) + if minetest.is_protected(pos, player:get_player_name()) then + return 0 + end + return count +end + +function technic.chests.inv_move_protected(pos, from_list, from_index, to_list, to_index, count, player) + return inv_change_protected(pos, count, player) +end +function technic.chests.inv_put_protected(pos, listname, index, stack, player) + return inv_change_protected(pos, stack:get_count(), player) +end +function technic.chests.inv_take_protected(pos, listname, index, stack, player) + return inv_change_protected(pos, stack:get_count(), player) +end + +-- logging utils + function technic.chests.on_inv_move(pos, from_list, from_index, to_list, to_index, count, player) minetest.log("action", player:get_player_name().. " moves stuff in chest at " @@ -63,4 +86,3 @@ function technic.chests.on_inv_take(pos, listname, index, stack, player) " takes " .. stack:get_name() .. " from chest at " .. minetest.pos_to_string(pos)) end - diff --git a/technic_chests/depends.txt b/technic_chests/depends.txt index 5d9ea6c..b2b9b68 100644 --- a/technic_chests/depends.txt +++ b/technic_chests/depends.txt @@ -4,3 +4,5 @@ moreblocks? moreores? pipeworks? intllib? +protector? +areas? \ No newline at end of file diff --git a/technic_chests/mithril_chest.lua b/technic_chests/mithril_chest.lua index 05cbc40..fb7917a 100644 --- a/technic_chests/mithril_chest.lua +++ b/technic_chests/mithril_chest.lua @@ -26,6 +26,7 @@ minetest.register_craft({ } }) +-- plain chest technic.chests:register("Mithril", { width = 15, height = 6, @@ -36,6 +37,7 @@ technic.chests:register("Mithril", { locked = false, }) +-- owned locked chest technic.chests:register("Mithril", { width = 15, height = 6, @@ -46,3 +48,23 @@ technic.chests:register("Mithril", { locked = true, }) +if minetest.get_modpath("protector") or minetest.get_modpath("areas") then + -- protected chest (works with any protection mod that overrides minetest.is_protected) + technic.chests:register("Mithril", { + width = 15, + height = 6, + sort = true, + autosort = true, + infotext = false, + color = false, + protected = true, + }) + + minetest.register_craft({ + output = 'technic:mithril_protected_chest 1', + recipe = { + {'basic_materials:padlock'}, + {'technic:mithril_locked_chest'}, + } + }) +end diff --git a/technic_chests/register.lua b/technic_chests/register.lua index 61d49d3..c255530 100644 --- a/technic_chests/register.lua +++ b/technic_chests/register.lua @@ -3,6 +3,8 @@ local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end local pipeworks = rawget(_G, "pipeworks") local fs_helpers = rawget(_G, "fs_helpers") +local has_protector_mod = minetest.get_modpath("protector") + local allow_label = "" local tube_entry = "" local shift_edit_field = 0 @@ -238,14 +240,25 @@ function technic.chests:definition(name, data) :format(name, meta:get_string("owner"))) pipeworks.after_place(pos) end - table.insert(front, "technic_"..lname.."_chest_lock_overlay.png") else locked_after_place = pipeworks.after_place end + if data.locked then + table.insert(front, "technic_"..lname.."_chest_lock_overlay.png") + end + + if data.protected and has_protector_mod then + -- use overlay from protector mod + table.insert(front, "protector_logo.png") + end + + local desc if data.locked then desc = S("%s Locked Chest"):format(name) + elseif data.protected then + desc = S("%s Protected Chest"):format(name) else desc = S("%s Chest"):format(name) end @@ -326,6 +339,16 @@ function technic.chests:definition(name, data) return secret, "a locked chest", owner end + elseif data.protected then + def.allow_metadata_inventory_move = self.inv_move_protected + def.allow_metadata_inventory_put = self.inv_put_protected + def.allow_metadata_inventory_take = self.inv_take_protected + def.on_blast = function() end + def.can_dig = function(pos,player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + return inv:is_empty("main") and not minetest.is_protected(pos, player:get_player_name()) + end end return def end @@ -333,7 +356,21 @@ end function technic.chests:register(name, data) local def = technic.chests:definition(name, data) - local nn = "technic:"..name:lower()..(data.locked and "_locked" or "").."_chest" + -- prefix + local nn = "technic:"..name:lower() + + if data.locked then + -- locked chest + nn = nn .. "_locked" + + elseif data.protected then + -- protected chest + nn = nn .. "_protected" + end + + -- suffix + nn = nn .. "_chest" + minetest.register_node(":"..nn, def) if data.color then @@ -357,4 +394,3 @@ function technic.chests:register(name, data) end end -