mirror of
https://github.com/mt-mods/pipeworks.git
synced 2025-01-15 12:30:35 +01:00
Merge branch 'master' into luacheck-builtin-std
This commit is contained in:
commit
42dd6bc32b
@ -14,4 +14,5 @@ read_globals = {
|
||||
"screwdriver", "unified_inventory",
|
||||
"i3", "mcl_experience", "awards",
|
||||
"xcompat", "fakelib"
|
||||
"xcompat", "fakelib", "vizlib"
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ function pipeworks.scan_pipe_surroundings(pos)
|
||||
pzm = 1
|
||||
end
|
||||
|
||||
print("stage 2 returns "..pxm+8*pxp+2*pym+16*pyp+4*pzm+32*pzp..
|
||||
minetest.log("info", "stage 2 returns "..pxm+8*pxp+2*pym+16*pyp+4*pzm+32*pzp..
|
||||
" for nodes surrounding "..minetest.get_node(pos).name.." at "..minetest.pos_to_string(pos))
|
||||
return pxm+8*pxp+2*pym+16*pyp+4*pzm+32*pzp
|
||||
end
|
||||
|
@ -36,7 +36,7 @@ function pipeworks.override_chest(chestname, override, connect_sides)
|
||||
pipeworks.after_place(pos)
|
||||
end
|
||||
|
||||
local old_after_dig = override.after_dig or old_def.after_dig or function() end
|
||||
local old_after_dig = override.after_dig or old_def.after_dig_node or function() end
|
||||
override.after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
old_after_dig(pos, oldnode, oldmetadata, digger)
|
||||
pipeworks.after_dig(pos, oldnode, oldmetadata, digger)
|
||||
|
2
mod.conf
2
mod.conf
@ -1,5 +1,5 @@
|
||||
name = pipeworks
|
||||
description = This mod uses mesh nodes and nodeboxes to supply a complete set of 3D pipes and tubes, along with devices that work with them.
|
||||
depends = basic_materials, xcompat, fakelib
|
||||
optional_depends = mesecons, mesecons_mvps, digilines, signs_lib, unified_inventory, default, screwdriver, fl_mapgen, sound_api, i3, hades_core, hades_furnaces, hades_chests, mcl_mapgen_core, mcl_barrels, mcl_furnaces, mcl_experience
|
||||
optional_depends = mesecons, mesecons_mvps, digilines, signs_lib, unified_inventory, default, screwdriver, fl_mapgen, sound_api, i3, hades_core, hades_furnaces, hades_chests, mcl_mapgen_core, mcl_barrels, mcl_furnaces, mcl_experience, vizlib
|
||||
min_minetest_version = 5.5.0
|
||||
|
@ -87,3 +87,7 @@ pipeworks_entity_update_interval (Entity Update Interval) float 0 0 0.8
|
||||
|
||||
# if set to true, items passing through teleport tubes will log log where they came from and where they went.
|
||||
pipeworks_log_teleport_tubes (Log Teleport Tubes) bool false
|
||||
|
||||
# Behavior of print() inside a lua tube. By default, this emits a message into actionstream.
|
||||
# Set it to noop if you wish to disable that behavior.
|
||||
pipeworks_lua_tube_print_behavior (Behavior of print in Lua Tube) enum log log,noop
|
||||
|
@ -229,12 +229,14 @@ end
|
||||
-------------------------
|
||||
|
||||
local function safe_print(param)
|
||||
if (minetest.settings:get("pipeworks_lua_tube_print_behavior") or "log") == "log" then
|
||||
local string_meta = getmetatable("")
|
||||
local sandbox = string_meta.__index
|
||||
string_meta.__index = string -- Leave string sandbox temporarily
|
||||
print(dump(param))
|
||||
minetest.log("action", string.format("[pipeworks.tubes.lua] print(%s)", dump(param)))
|
||||
string_meta.__index = sandbox -- Restore string sandbox
|
||||
end
|
||||
end
|
||||
|
||||
local function safe_date()
|
||||
return(os.date("*t",os.time()))
|
||||
@ -603,7 +605,7 @@ local function save_memory(pos, meta, mem)
|
||||
meta:set_string("lc_memory", memstring)
|
||||
meta:mark_as_private("lc_memory")
|
||||
else
|
||||
print("Error: lua_tube memory overflow. "..memsize_max.." bytes available, "
|
||||
minetest.log("info", "lua_tube memory overflow. "..memsize_max.." bytes available, "
|
||||
..#memstring.." required. Controller overheats.")
|
||||
burn_controller(pos)
|
||||
end
|
||||
|
@ -1,6 +1,8 @@
|
||||
|
||||
local S = minetest.get_translator("pipeworks")
|
||||
|
||||
local has_vislib = minetest.get_modpath("vizlib")
|
||||
|
||||
local enable_max = minetest.settings:get_bool("pipeworks_enable_items_per_tube_limit", true)
|
||||
local max_items = tonumber(minetest.settings:get("pipeworks_max_items_per_tube")) or 30
|
||||
max_items = math.ceil(max_items / 2) -- Limit vacuuming to half the max limit
|
||||
@ -38,6 +40,15 @@ local function repair_tube(pos, was_node)
|
||||
set_timer(pos)
|
||||
end
|
||||
|
||||
local function show_area(pos, node, player)
|
||||
if not player or player:get_wielded_item():get_name() ~= "" then
|
||||
-- Only show area when using an empty hand
|
||||
return
|
||||
end
|
||||
local radius = tonumber(minetest.get_meta(pos):get("dist")) or 2
|
||||
vizlib.draw_cube(pos, radius + 0.5, {player = player})
|
||||
end
|
||||
|
||||
if pipeworks.enable_sand_tube then
|
||||
pipeworks.register_tube("pipeworks:sand_tube", {
|
||||
description = S("Vacuuming Pneumatic Tube Segment"),
|
||||
@ -56,6 +67,7 @@ if pipeworks.enable_sand_tube then
|
||||
vacuum(pos, 2)
|
||||
set_timer(pos)
|
||||
end,
|
||||
on_punch = has_vislib and show_area or nil,
|
||||
},
|
||||
})
|
||||
end
|
||||
@ -101,6 +113,7 @@ if pipeworks.enable_mese_sand_tube then
|
||||
meta:set_int("dist", dist)
|
||||
meta:set_string("infotext", S("Adjustable Vacuuming Tube (@1m)", dist))
|
||||
end,
|
||||
on_punch = has_vislib and show_area or nil,
|
||||
},
|
||||
})
|
||||
end
|
||||
|
@ -281,7 +281,6 @@ if pipeworks.enable_node_breaker then
|
||||
-- Don't mechanically wear out tool
|
||||
if stack:get_wear() ~= old_stack:get_wear() and stack:get_count() == old_stack:get_count()
|
||||
and (item_def.wear_represents == nil or item_def.wear_represents == "mechanical_wear") then
|
||||
print("replaced")
|
||||
fakeplayer:set_wielded_item(old_stack)
|
||||
end
|
||||
elseif not stack:is_empty() then
|
||||
|
Loading…
Reference in New Issue
Block a user