Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/upstream'
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay committed Jun 16, 2020
2 parents 64ae1fd + 88f2bc3 commit 7b24a74
Show file tree
Hide file tree
Showing 29 changed files with 121 additions and 103 deletions.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Bug report
about: Report a problem within technic
title: ''
labels: Bug
assignees: ''

---

Technic has no main developer and largely depends on
user-provided Pull Requests. It will take a while until
even important issues are noticed.
Please consider proposing a PR directly.
_______________________________________________


**Bug description**


**Steps to reproduce this issue**
11 changes: 11 additions & 0 deletions .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
on: [push, pull_request]
name: Check & Release
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: lint
uses: Roang-zero1/factorio-mod-luacheck@master
with:
luacheckrc_url: https://raw.githubusercontent.com/minetest-mods/technic/master/.luacheckrc
72 changes: 41 additions & 31 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,38 +1,48 @@
unused_args = false

-- https://luacheck.readthedocs.io/en/stable/warnings.html
ignore = {
"611", --whitespace
"631", -- line too long
"211", -- unused local
"311", -- Value assigned to a local variable is unused.
"113", -- undefined
"121" -- read only global
}
allow_defined_top = true
max_line_length = 999

globals = {
"technic",
"technic_cnc",
"wrench"
"technic", "minetest",
"srcstack",
}

read_globals = {
-- Stdlib
string = {fields = {"split"}},
table = {fields = {"copy", "getn"}},

-- Minetest
"vector", "ItemStack",
"dump", "VoxelArea",
"minetest", "default",

-- deps
"mesecon",
"pipeworks",
"monitoring",
"intllib",
"stairsplus",
"unifieddyes",
"digilines",
"digiline_remote"
string = {fields = {"split", "trim"}},
table = {fields = {"copy", "getn"}},

"intllib", "VoxelArea",
"default", "stairsplus",

"PseudoRandom", "ItemStack",
"mg", "tubelib", "vector",

"moretrees", "bucket",
"unified_inventory", "digilines",

"pipeworks", "screwdriver",
"VoxelManip", "unifieddyes",

"Settings", "mesecon",
"digiline_remote",

"protector", "isprotect",
"homedecor_expect_infinite_stacks",
}

files["concrete/init.lua"].ignore = { "steel_ingot" }
files["technic/machines/MV/tool_workshop.lua"].ignore = { "pos" }
files["technic/machines/other/frames.lua"].ignore = { "item_texture", "item_type", "adj", "connected", "" }
files["technic/machines/register/battery_box.lua"].ignore = { "pos", "tube_upgrade" }
files["technic/machines/register/cables.lua"].ignore = { "name", "from_below", "p" }
files["technic/machines/register/common.lua"].ignore = { "result" }

files["technic/machines/register/generator.lua"].ignore = { "node" }
files["technic/machines/switching_station.lua"].ignore = { "pos1", "tier", "poshash" }
files["technic/radiation.lua"].ignore = { "LAVA_VISC" }
files["technic/tools/chainsaw.lua"].ignore = { "pos" }
files["technic/tools/mining_drill.lua"].ignore = { "mode" }
files["technic_chests/register.lua"].ignore = { "fs_helpers", "name", "locked_after_place" }

files["technic_cnc/cnc.lua"].ignore = { "multiplier" }
files["wrench/init.lua"].ignore = { "name", "stack" }
2 changes: 1 addition & 1 deletion technic/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function technic.get_or_load_node(pos)
local node = minetest.get_node_or_nil(pos)
if node then return node end
local vm = VoxelManip()
local MinEdge, MaxEdge = vm:read_from_map(pos, pos)
local _, _ = vm:read_from_map(pos, pos)
return nil
end

Expand Down
2 changes: 1 addition & 1 deletion technic/machines/HV/nuclear_reactor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ minetest.register_node("technic:hv_nuclear_reactor_core_active", {
technic_run = run,
technic_on_disable = function(pos, node)
local timer = minetest.get_node_timer(pos)
timer:start(1)
timer:start(1)
end,
on_timer = function(pos, node)
local meta = minetest.get_meta(pos)
Expand Down
2 changes: 1 addition & 1 deletion technic/machines/LV/geothermal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ minetest.register_craftitem("technic:geothermal", {
local check_node_around = function(pos)
local node = minetest.get_node(pos)
if node.name == "default:water_source" or node.name == "default:water_flowing" then return 1 end
if node.name == "default:lava_source" or node.name == "default:lava_flowing" then return 2 end
if node.name == "default:lava_source" or node.name == "default:lava_flowing" then return 2 end
return 0
end

Expand Down
1 change: 0 additions & 1 deletion technic/machines/LV/music_player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ local run = function(pos, node)
local meta = minetest.get_meta(pos)
local eu_input = meta:get_int("LV_EU_input")
local machine_name = S("%s Music Player"):format("LV")
local machine_node = "technic:music_player"
local demand = 150

local current_track = meta:get_int("current_track")
Expand Down
2 changes: 1 addition & 1 deletion technic/machines/LV/solar_panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ minetest.register_node("technic:solar_panel", {
technic_machine=1, technic_lv=1},
connect_sides = {"bottom"},
sounds = default.node_sound_wood_defaults(),
description = S("Small Solar %s Generator"):format("LV"),
description = S("Small Solar %s Generator"):format("LV"),
active = false,
drawtype = "nodebox",
paramtype = "light",
Expand Down
4 changes: 2 additions & 2 deletions technic/machines/LV/water_mill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ end
local run = function(pos, node)
local meta = minetest.get_meta(pos)
local water_flow = 0
local production_level = 0
local eu_supply = 0
local production_level
local eu_supply
local max_output = 4 * 45 -- keeping it around 180, little more than previous 150 :)

local positions = {
Expand Down
4 changes: 2 additions & 2 deletions technic/machines/MV/hydro_turbine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ end
local run = function(pos, node)
local meta = minetest.get_meta(pos)
local water_flow = 0
local production_level = 0
local eu_supply = 0
local production_level
local eu_supply
local max_output = 40 * 45 -- Generates 1800EU/s

local positions = {
Expand Down
14 changes: 6 additions & 8 deletions technic/machines/MV/lighting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ function technic_homedecor_node_is_owned(pos, placer)
end
end

local dirs1 = {20, 23, 22, 21}
local dirs2 = {9, 18, 7, 12}

local technic_homedecor_rotate_and_place = function(itemstack, placer, pointed_thing)
Expand All @@ -58,7 +57,6 @@ local technic_homedecor_rotate_and_place = function(itemstack, placer, pointed_t
local under = pointed_thing.under
local pitch = placer:get_look_pitch()
local pname = minetest.get_node(under).name
local node = minetest.get_node(above)
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
local wield_name = itemstack:get_name()

Expand Down Expand Up @@ -159,7 +157,7 @@ minetest.register_node('technic:homedecor_glowlight_half_yellow_active', {
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
light_source = LIGHT_MAX,
light_source = minetest.LIGHT_MAX,
sounds = default.node_sound_wood_defaults(),

groups = { snappy = 3, not_in_creative_inventory=1},
Expand Down Expand Up @@ -240,7 +238,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_yellow_active', {
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
light_source = LIGHT_MAX-1,
light_source = minetest.LIGHT_MAX-1,
sounds = default.node_sound_wood_defaults(),

groups = { snappy = 3, not_in_creative_inventory=1},
Expand Down Expand Up @@ -322,7 +320,7 @@ minetest.register_node('technic:homedecor_glowlight_half_white_active', {
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
light_source = LIGHT_MAX,
light_source = minetest.LIGHT_MAX,
sounds = default.node_sound_wood_defaults(),

groups = { snappy = 3, not_in_creative_inventory=1},
Expand Down Expand Up @@ -403,7 +401,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_white_active', {
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
light_source = LIGHT_MAX-1,
light_source = minetest.LIGHT_MAX-1,
sounds = default.node_sound_wood_defaults(),

groups = { snappy = 3, not_in_creative_inventory=1},
Expand Down Expand Up @@ -484,7 +482,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_yellow_active', {
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
light_source = LIGHT_MAX-1,
light_source = minetest.LIGHT_MAX-1,
sounds = default.node_sound_wood_defaults(),

groups = { snappy = 3, not_in_creative_inventory=1},
Expand Down Expand Up @@ -565,7 +563,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_white_active', {
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
light_source = LIGHT_MAX-1,
light_source = minetest.LIGHT_MAX-1,
sounds = default.node_sound_wood_defaults(),

groups = { snappy = 3, not_in_creative_inventory=1},
Expand Down
2 changes: 0 additions & 2 deletions technic/machines/MV/power_radiator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,6 @@ minetest.register_abm({
-- The supply radius
local rad = power_radius

local meta1 = nil
local pos1 = {}
local used_charge = 0

-- Index all nodes within supply range
Expand Down
5 changes: 2 additions & 3 deletions technic/machines/MV/tool_workshop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ local run = function(pos, node)
local inv = meta:get_inventory()
local eu_input = meta:get_int("MV_EU_input")
local machine_name = S("%s Tool Workshop"):format("MV")
local machine_node = "technic:tool_workshop"

-- Setup meta data if it does not exist.
if not eu_input then
Expand Down Expand Up @@ -71,7 +70,7 @@ local run = function(pos, node)
meta:set_int("MV_EU_demand", 0)
return
end

if eu_input < workshop_demand[EU_upgrade+1] then
meta:set_string("infotext", S("%s Unpowered"):format(machine_name))
elseif eu_input >= workshop_demand[EU_upgrade+1] then
Expand Down Expand Up @@ -105,7 +104,7 @@ minetest.register_node("technic:tool_workshop", {
inv:set_size("src", 1)
inv:set_size("upgrade1", 1)
inv:set_size("upgrade2", 1)
end,
end,
can_dig = technic.machine_can_dig,
allow_metadata_inventory_put = technic.machine_inventory_put,
allow_metadata_inventory_take = technic.machine_inventory_take,
Expand Down
4 changes: 1 addition & 3 deletions technic/machines/other/coal_alloy_furnace.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,12 @@ minetest.register_abm({
action = function(pos, node, active_object_count, active_object_count_wider)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()

if inv:get_size("src") == 1 then -- Old furnace -> convert it
inv:set_size("src", 2)
inv:set_stack("src", 2, inv:get_stack("src2", 1))
inv:set_size("src2", 0)
end

local recipe = nil

for i, name in pairs({
"fuel_totaltime",
Expand Down
24 changes: 11 additions & 13 deletions technic/machines/other/frames.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
local S = technic.getter

frames = {}

local infinite_stacks = minetest.settings:get_bool("creative_mode")
and minetest.get_modpath("unified_inventory") == nil

Expand Down Expand Up @@ -100,7 +98,7 @@ end
local function add_table(table, toadd)
local i = 1
while true do
o = table[i]
local o = table[i]
if o == toadd then return end
if o == nil then break end
i = i + 1
Expand Down Expand Up @@ -261,8 +259,8 @@ for zp = 0, 1 do
sunlight_propagates = true,

frame_connect_all = function(nodename)
l2 = {}
l1 = {
local l2 = {}
local l1 = {
{ x = -1, y = 0, z = 0 }, { x = 1, y = 0, z = 0 },
{ x = 0, y = -1, z = 0 }, { x = 0, y = 1, z = 0 },
{ x = 0, y = 0, z = -1 }, { x = 0, y = 0, z = 1 }
Expand Down Expand Up @@ -311,7 +309,7 @@ for zp = 0, 1 do
local node = minetest.get_node(pos)
if node.name ~= "air" then
if is_supported_node(node.name) then
obj = minetest.add_entity(pos, "technic:frame_entity")
local obj = minetest.add_entity(pos, "technic:frame_entity")
obj:get_luaentity():set_node({ name = itemstack:get_name() })
end
else
Expand Down Expand Up @@ -349,8 +347,8 @@ for zp = 0, 1 do
end

-- Run script hook
local _, callback
for _, callback in ipairs(minetest.registered_on_placenodes) do
local callback = nil
for _, _ in ipairs(minetest.registered_on_placenodes) do
-- Copy pos and node because callback can modify them
local pos_copy = { x = pos.x, y = pos.y, z = pos.z }
local newnode_copy = { name = def.name, param1 = 0, param2 = 0 }
Expand All @@ -364,7 +362,7 @@ for zp = 0, 1 do
itemstack:take_item()
end

obj = minetest.add_entity(pos, "technic:frame_entity")
local obj = minetest.add_entity(pos, "technic:frame_entity")
obj:get_luaentity():set_node({ name = node.name })

return itemstack
Expand Down Expand Up @@ -414,7 +412,7 @@ minetest.register_entity("technic:frame_entity", {
item_texture = minetest.registered_items[itemname].inventory_image
item_type = minetest.registered_items[itemname].type
end
prop = {
local prop = {
is_visible = true,
textures = { node.name },
}
Expand Down Expand Up @@ -589,7 +587,7 @@ local function connected(pos, c, adj)
end

local function get_connected_nodes(pos)
c = { pos }
local c = { pos }
local nodename = minetest.get_node(pos).name
if frames_pos[pos_to_string(pos)] then
nodename = frames_pos[pos_to_string(pos)]
Expand Down Expand Up @@ -695,7 +693,7 @@ local function swap_template(pos, new)
local saved_node = meta:get_string("saved_node")
meta:set_string("saved_node", "")
technic.swap_node(pos, new)
local meta = minetest.get_meta(pos)
meta = minetest.get_meta(pos)
meta:set_string("saved_node", saved_node)
end

Expand Down Expand Up @@ -857,7 +855,7 @@ minetest.register_node("technic:template_disabled", {
on_destruct = template_on_destruct,
after_dig_node = template_drops,
on_punch = function(pos, node, puncher)
local meta = minetest.get_meta(pos)
local _ = minetest.get_meta(pos)
swap_template(pos, "technic:template_connector")
end
})
Expand Down
Loading

0 comments on commit 7b24a74

Please sign in to comment.