Merge remote-tracking branch 'upstream/master'

This commit is contained in:
bri cassa 2022-03-06 16:37:56 +01:00
commit 66070dd801
9 changed files with 49 additions and 15 deletions

13
.github/workflows/luacheck.yml vendored Normal file
View File

@ -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 ./

View File

@ -1,8 +0,0 @@
stages:
- test
luacheck:
stage: test
image: pipelinecomponents/luacheck:latest
script:
- luacheck .

2
README
View File

@ -1,7 +1,7 @@
This mod uses nodeboxes to supply a complete set of 3D pipes and tubes, This mod uses nodeboxes to supply a complete set of 3D pipes and tubes,
along devices that work with them. 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 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 placed, they'll automatically join together as needed. Pipes can go vertically

View File

@ -280,8 +280,7 @@ minetest.register_node("pipeworks:autocrafter", {
update_meta(meta, false) update_meta(meta, false)
end, end,
on_receive_fields = function(pos, formname, fields, sender) on_receive_fields = function(pos, formname, fields, sender)
if not fields.channel or (fields.quit and not fields.key_enter_field) if (fields.quit and not fields.key_enter_field) or not pipeworks.may_configure(pos, sender) then
or not pipeworks.may_configure(pos, sender) then
return return
end end
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)

View File

@ -188,9 +188,26 @@ local function furnace_node_timer(pos, elapsed)
-- No valid fuel in fuel list -- No valid fuel in fuel list
fuel_totaltime = 0 fuel_totaltime = 0
src_time = 0 src_time = 0
else
-- 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 else
-- Take fuel from fuel list -- Take fuel from fuel list
inv:set_stack("fuel", 1, afterfuel.items[1]) 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 update = true
fuel_totaltime = fuel.time + (fuel_time - fuel_totaltime) fuel_totaltime = fuel.time + (fuel_time - fuel_totaltime)
src_time = src_time + elapsed src_time = src_time + elapsed

View File

@ -1,6 +1,8 @@
local S = minetest.get_translator("pipeworks") local S = minetest.get_translator("pipeworks")
local new_flow_logic_register = pipeworks.flowables.register local new_flow_logic_register = pipeworks.flowables.register
local texture_alpha_mode = minetest.features.use_texture_alpha_string_modes
local polys = "" local polys = ""
if pipeworks.enable_lowpoly then polys = "_lowpoly" end 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) if (not placer:get_player_control().sneak)
and minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name]
and minetest.registered_nodes[node.name].on_rightclick then 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 else
local pitch = placer:get_look_pitch() local pitch = placer:get_look_pitch()
@ -140,6 +144,7 @@ for s in ipairs(states) do
drawtype = "mesh", drawtype = "mesh",
mesh = "pipeworks_pump"..polys..".obj", mesh = "pipeworks_pump"..polys..".obj",
tiles = { "pipeworks_pump_"..states[s]..".png" }, tiles = { "pipeworks_pump_"..states[s]..".png" },
use_texture_alpha = texture_alpha_mode and "clip" or true,
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
groups = dgroups, groups = dgroups,
@ -284,6 +289,7 @@ minetest.register_node("pipeworks:grating", {
"pipeworks_grating_sides.png", "pipeworks_grating_sides.png",
"pipeworks_grating_sides.png" "pipeworks_grating_sides.png"
}, },
use_texture_alpha = texture_alpha_mode and "clip" or true,
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",
@ -355,6 +361,7 @@ minetest.register_node(nodename_spigot_loaded, {
}, },
{ name = "pipeworks_spigot.png" } { name = "pipeworks_spigot.png" }
}, },
use_texture_alpha = texture_alpha_mode and "blend" or true,
sunlight_propagates = true, sunlight_propagates = true,
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",

View File

@ -1,5 +1,5 @@
local luaentity = pipeworks.luaentity 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 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 if enable_max_limit == nil then enable_max_limit = true end

View File

@ -163,11 +163,15 @@ if pipeworks.enable_crossing_tube then
}) })
end end
local texture_alpha_mode = minetest.features.use_texture_alpha_string_modes
and "clip" or true
if pipeworks.enable_one_way_tube then if pipeworks.enable_one_way_tube then
minetest.register_node("pipeworks:one_way_tube", { minetest.register_node("pipeworks:one_way_tube", {
description = S("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", 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"}, "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", paramtype2 = "facedir",
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",

View File

@ -287,5 +287,7 @@ pipeworks.tptube = {
hash = hash, hash = hash,
save_tube_db = save_tube_db, save_tube_db = save_tube_db,
get_db = function() return tp_tube_db or read_tube_db() end, 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 tp_tube_db_version = tp_tube_db_version
} }