diff --git a/.github/workflows/luacheck.yml b/.github/workflows/luacheck.yml new file mode 100644 index 0000000..a13efa9 --- /dev/null +++ b/.github/workflows/luacheck.yml @@ -0,0 +1,13 @@ +name: luacheck +on: [push, pull_request] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: apt + run: sudo apt-get install -y luarocks + - name: luacheck install + run: luarocks install --local luacheck + - name: luacheck run + run: $HOME/.luarocks/bin/luacheck ./ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index ff51e7e..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,8 +0,0 @@ -stages: - - test - -luacheck: - stage: test - image: pipelinecomponents/luacheck:latest - script: - - luacheck . diff --git a/README b/README index 8b74b76..4af070d 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ This mod uses nodeboxes to supply a complete set of 3D pipes and tubes, along devices that work with them. -See https://gitlab.com/VanessaE/pipeworks/wikis/ for detailed information about usage of this mod. +See https://github.com/mt-mods/pipeworks/wiki/ for detailed information about usage of this mod. Unlike the previous version of this mod, these pipes are rounded, and when placed, they'll automatically join together as needed. Pipes can go vertically diff --git a/autocrafter.lua b/autocrafter.lua index 6134e03..d309862 100644 --- a/autocrafter.lua +++ b/autocrafter.lua @@ -280,8 +280,7 @@ minetest.register_node("pipeworks:autocrafter", { update_meta(meta, false) end, on_receive_fields = function(pos, formname, fields, sender) - if not fields.channel or (fields.quit and not fields.key_enter_field) - or not pipeworks.may_configure(pos, sender) then + if (fields.quit and not fields.key_enter_field) or not pipeworks.may_configure(pos, sender) then return end local meta = minetest.get_meta(pos) diff --git a/compat-furnaces.lua b/compat-furnaces.lua index 1894056..797ecfd 100644 --- a/compat-furnaces.lua +++ b/compat-furnaces.lua @@ -189,8 +189,25 @@ local function furnace_node_timer(pos, elapsed) fuel_totaltime = 0 src_time = 0 else - -- Take fuel from fuel list - inv:set_stack("fuel", 1, afterfuel.items[1]) + -- prevent blocking of fuel inventory (for automatization mods) + local is_fuel = minetest.get_craft_result({method = "fuel", width = 1, items = {afterfuel.items[1]:to_string()}}) + if is_fuel.time == 0 then + table.insert(fuel.replacements, afterfuel.items[1]) + inv:set_stack("fuel", 1, "") + else + -- Take fuel from fuel list + inv:set_stack("fuel", 1, afterfuel.items[1]) + end + -- Put replacements in dst list or drop them on the furnace. + local replacements = fuel.replacements + if replacements[1] then + local leftover = inv:add_item("dst", replacements[1]) + if not leftover:is_empty() then + local above = vector.new(pos.x, pos.y + 1, pos.z) + local drop_pos = minetest.find_node_near(above, 1, {"air"}) or above + minetest.item_drop(replacements[1], nil, drop_pos) + end + end update = true fuel_totaltime = fuel.time + (fuel_time - fuel_totaltime) src_time = src_time + elapsed diff --git a/devices.lua b/devices.lua index 49875c8..0acbc76 100644 --- a/devices.lua +++ b/devices.lua @@ -1,6 +1,8 @@ local S = minetest.get_translator("pipeworks") local new_flow_logic_register = pipeworks.flowables.register +local texture_alpha_mode = minetest.features.use_texture_alpha_string_modes + local polys = "" if pipeworks.enable_lowpoly then polys = "_lowpoly" end @@ -28,7 +30,9 @@ function pipeworks.rotate_on_place(itemstack, placer, pointed_thing) if (not placer:get_player_control().sneak) and minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then - minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) + minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, + node, placer, itemstack, pointed_thing) + else local pitch = placer:get_look_pitch() @@ -140,6 +144,7 @@ for s in ipairs(states) do drawtype = "mesh", mesh = "pipeworks_pump"..polys..".obj", tiles = { "pipeworks_pump_"..states[s]..".png" }, + use_texture_alpha = texture_alpha_mode and "clip" or true, paramtype = "light", paramtype2 = "facedir", groups = dgroups, @@ -284,6 +289,7 @@ minetest.register_node("pipeworks:grating", { "pipeworks_grating_sides.png", "pipeworks_grating_sides.png" }, + use_texture_alpha = texture_alpha_mode and "clip" or true, drawtype = "nodebox", node_box = { type = "fixed", @@ -355,6 +361,7 @@ minetest.register_node(nodename_spigot_loaded, { }, { name = "pipeworks_spigot.png" } }, + use_texture_alpha = texture_alpha_mode and "blend" or true, sunlight_propagates = true, paramtype = "light", paramtype2 = "facedir", diff --git a/item_transport.lua b/item_transport.lua index e1ee192..76fe538 100644 --- a/item_transport.lua +++ b/item_transport.lua @@ -1,5 +1,5 @@ local luaentity = pipeworks.luaentity -local enable_max_limit = minetest.settings:get("pipeworks_enable_items_per_tube_limit") +local enable_max_limit = minetest.settings:get_bool("pipeworks_enable_items_per_tube_limit") local max_tube_limit = tonumber(minetest.settings:get("pipeworks_max_items_per_tube")) or 30 if enable_max_limit == nil then enable_max_limit = true end diff --git a/routing_tubes.lua b/routing_tubes.lua index e7bc596..a99d1c3 100644 --- a/routing_tubes.lua +++ b/routing_tubes.lua @@ -163,11 +163,15 @@ if pipeworks.enable_crossing_tube then }) end +local texture_alpha_mode = minetest.features.use_texture_alpha_string_modes + and "clip" or true + if pipeworks.enable_one_way_tube then minetest.register_node("pipeworks:one_way_tube", { description = S("One way tube"), tiles = {"pipeworks_one_way_tube_top.png", "pipeworks_one_way_tube_top.png", "pipeworks_one_way_tube_output.png", "pipeworks_one_way_tube_input.png", "pipeworks_one_way_tube_side.png", "pipeworks_one_way_tube_top.png"}, + use_texture_alpha = texture_alpha_mode, paramtype2 = "facedir", drawtype = "nodebox", paramtype = "light", diff --git a/teleport_tube.lua b/teleport_tube.lua index e812b70..c59f740 100644 --- a/teleport_tube.lua +++ b/teleport_tube.lua @@ -287,5 +287,7 @@ pipeworks.tptube = { hash = hash, save_tube_db = save_tube_db, get_db = function() return tp_tube_db or read_tube_db() end, + set_tube = set_tube, + update_meta = update_meta, tp_tube_db_version = tp_tube_db_version }