2013-07-14 04:39:25 +02:00
|
|
|
-- Pipeworks mod by Vanessa Ezekowitz - 2013-07-13
|
2012-07-12 23:52:35 +02:00
|
|
|
--
|
2013-07-14 04:39:25 +02:00
|
|
|
-- This mod supplies various steel pipes and plastic pneumatic tubes
|
|
|
|
-- and devices that they can connect to.
|
2012-07-12 23:52:35 +02:00
|
|
|
--
|
|
|
|
|
2024-01-14 02:40:01 +01:00
|
|
|
pipeworks = {
|
|
|
|
ui_cat_tube_list = {},
|
|
|
|
worldpath = minetest.get_worldpath(),
|
|
|
|
modpath = minetest.get_modpath("pipeworks"),
|
|
|
|
liquids = {
|
|
|
|
water = {
|
|
|
|
source = minetest.registered_nodes["mapgen_water_source"].name,
|
|
|
|
flowing = minetest.registered_nodes["mapgen_water_source"].liquid_alternative_flowing
|
|
|
|
},
|
|
|
|
river_water = {
|
|
|
|
source = minetest.registered_nodes["mapgen_river_water_source"].name,
|
|
|
|
flowing = minetest.registered_nodes["mapgen_river_water_source"].liquid_alternative_flowing
|
|
|
|
}
|
|
|
|
}
|
2022-03-15 02:39:58 +01:00
|
|
|
}
|
|
|
|
|
2017-04-14 03:13:30 +02:00
|
|
|
dofile(pipeworks.modpath.."/default_settings.lua")
|
2013-12-18 02:36:21 +01:00
|
|
|
-- Read the external config file if it exists.
|
2016-05-28 02:37:56 +02:00
|
|
|
local worldsettingspath = pipeworks.worldpath.."/pipeworks_settings.txt"
|
|
|
|
local worldsettingsfile = io.open(worldsettingspath, "r")
|
2016-05-23 19:52:26 +02:00
|
|
|
if worldsettingsfile then
|
|
|
|
worldsettingsfile:close()
|
|
|
|
dofile(worldsettingspath)
|
2013-07-14 04:39:25 +02:00
|
|
|
end
|
2017-10-20 23:46:51 +02:00
|
|
|
if pipeworks.toggles.pipe_mode == "pressure" then
|
2017-10-20 22:34:08 +02:00
|
|
|
minetest.log("warning", "pipeworks pressure logic mode comes with caveats and differences in behaviour, you have been warned!")
|
2017-09-27 18:37:46 +02:00
|
|
|
end
|
2022-05-25 01:13:41 +02:00
|
|
|
if pipeworks.entity_update_interval >= 0.2 and pipeworks.enable_accelerator_tube then
|
|
|
|
minetest.log("warning", "pipeworks accelerator tubes will not entirely work with an entity update interval 0.2 or above.")
|
|
|
|
end
|
2012-08-06 03:29:59 +02:00
|
|
|
|
2017-10-01 17:17:35 +02:00
|
|
|
pipeworks.logger = function(msg)
|
2022-08-13 22:22:53 +02:00
|
|
|
minetest.log("action", "[pipeworks] "..msg)
|
2017-10-01 17:17:35 +02:00
|
|
|
end
|
|
|
|
|
2013-12-15 10:35:59 +01:00
|
|
|
-------------------------------------------
|
|
|
|
-- Load the various other parts of the mod
|
2013-06-22 23:51:57 +02:00
|
|
|
|
2017-10-03 21:53:49 +02:00
|
|
|
-- early auto-detection for finite water mode if not explicitly disabled
|
|
|
|
if pipeworks.toggles.finite_water == nil then
|
|
|
|
dofile(pipeworks.modpath.."/autodetect-finite-water.lua")
|
|
|
|
end
|
|
|
|
|
2019-09-23 18:21:54 +02:00
|
|
|
if minetest.get_modpath("signs_lib") then
|
|
|
|
dofile(pipeworks.modpath.."/signs_compat.lua")
|
|
|
|
end
|
|
|
|
|
2014-08-14 16:22:03 +02:00
|
|
|
dofile(pipeworks.modpath.."/common.lua")
|
2013-12-15 10:35:59 +01:00
|
|
|
dofile(pipeworks.modpath.."/models.lua")
|
2013-11-26 05:55:52 +01:00
|
|
|
dofile(pipeworks.modpath.."/autoplace_pipes.lua")
|
|
|
|
dofile(pipeworks.modpath.."/autoplace_tubes.lua")
|
2014-08-14 16:22:03 +02:00
|
|
|
dofile(pipeworks.modpath.."/luaentity.lua")
|
2013-10-29 19:08:23 +01:00
|
|
|
dofile(pipeworks.modpath.."/item_transport.lua")
|
|
|
|
dofile(pipeworks.modpath.."/flowing_logic.lua")
|
2015-01-29 19:55:00 +01:00
|
|
|
dofile(pipeworks.modpath.."/filter-injector.lua")
|
2024-04-11 10:25:13 +02:00
|
|
|
dofile(pipeworks.modpath.."/chests.lua")
|
2014-07-15 01:52:33 +02:00
|
|
|
dofile(pipeworks.modpath.."/trashcan.lua")
|
2014-07-22 16:33:16 +02:00
|
|
|
dofile(pipeworks.modpath.."/wielder.lua")
|
2024-01-14 02:40:01 +01:00
|
|
|
dofile(pipeworks.modpath.."/tubes/registration.lua")
|
|
|
|
dofile(pipeworks.modpath.."/tubes/routing.lua")
|
|
|
|
dofile(pipeworks.modpath.."/tubes/sorting.lua")
|
|
|
|
dofile(pipeworks.modpath.."/tubes/signal.lua")
|
2024-03-03 12:37:46 +01:00
|
|
|
dofile(pipeworks.modpath.."/tubes/embedded_tube.lua")
|
2024-01-14 02:40:01 +01:00
|
|
|
dofile(pipeworks.modpath.."/tubes/pane_embedded_tube.lua")
|
2024-03-03 12:48:27 +01:00
|
|
|
dofile(pipeworks.modpath.."/tubes/tags.lua")
|
2024-01-14 02:40:01 +01:00
|
|
|
|
|
|
|
if pipeworks.enable_teleport_tube then
|
|
|
|
dofile(pipeworks.modpath.."/tubes/teleport.lua")
|
|
|
|
end
|
|
|
|
if pipeworks.enable_lua_tube and minetest.get_modpath("mesecons") then
|
|
|
|
dofile(pipeworks.modpath.."/tubes/lua.lua")
|
|
|
|
end
|
|
|
|
if pipeworks.enable_sand_tube or pipeworks.enable_mese_sand_tube then
|
|
|
|
dofile(pipeworks.modpath.."/tubes/vacuum.lua")
|
|
|
|
end
|
|
|
|
|
2017-10-17 15:20:55 +02:00
|
|
|
local logicdir = "/pressure_logic/"
|
2017-10-01 00:55:16 +02:00
|
|
|
|
2017-10-01 19:23:58 +02:00
|
|
|
-- note that even with these files the new flow logic is not yet default.
|
|
|
|
-- registration will take place but no actual ABMs/node logic will be installed,
|
2017-10-03 21:38:56 +02:00
|
|
|
-- unless the toggle flag is specifically enabled in the per-world settings flag.
|
2017-10-01 16:18:00 +02:00
|
|
|
dofile(pipeworks.modpath..logicdir.."flowable_node_registry.lua")
|
2017-10-01 00:55:16 +02:00
|
|
|
dofile(pipeworks.modpath..logicdir.."abms.lua")
|
|
|
|
dofile(pipeworks.modpath..logicdir.."abm_register.lua")
|
2017-10-01 16:18:00 +02:00
|
|
|
dofile(pipeworks.modpath..logicdir.."flowable_node_registry_install.lua")
|
2017-09-30 21:16:00 +02:00
|
|
|
|
2022-11-11 13:14:08 +01:00
|
|
|
if pipeworks.enable_pipes then
|
|
|
|
dofile(pipeworks.modpath.."/pipes.lua")
|
|
|
|
end
|
|
|
|
if pipeworks.enable_pipe_devices then
|
|
|
|
dofile(pipeworks.modpath.."/devices.lua")
|
|
|
|
end
|
2024-04-11 10:25:13 +02:00
|
|
|
if pipeworks.enable_redefines then
|
2017-04-11 05:13:44 +02:00
|
|
|
dofile(pipeworks.modpath.."/compat-chests.lua")
|
|
|
|
end
|
2024-04-11 10:25:13 +02:00
|
|
|
if pipeworks.enable_redefines and (minetest.get_modpath("default") or minetest.get_modpath("hades_core")) then
|
|
|
|
dofile(pipeworks.modpath.."/compat-furnaces.lua")
|
2023-09-02 21:17:14 +02:00
|
|
|
end
|
|
|
|
if pipeworks.enable_redefines and minetest.get_modpath("mcl_furnaces") then
|
|
|
|
dofile(pipeworks.modpath.."/mcl_furnaces.lua")
|
|
|
|
end
|
2022-11-11 13:14:08 +01:00
|
|
|
if pipeworks.enable_autocrafter then
|
|
|
|
dofile(pipeworks.modpath.."/autocrafter.lua")
|
|
|
|
end
|
2014-07-11 15:15:37 +02:00
|
|
|
|
2024-03-03 12:37:46 +01:00
|
|
|
dofile(pipeworks.modpath.."/crafts.lua")
|
2022-03-15 02:39:58 +01:00
|
|
|
|
2013-07-14 04:39:25 +02:00
|
|
|
minetest.register_alias("pipeworks:pipe", "pipeworks:pipe_110000_empty")
|
2013-02-01 00:49:47 +01:00
|
|
|
|
2021-04-02 21:48:28 +02:00
|
|
|
-- Unified Inventory categories integration
|
|
|
|
|
2023-11-21 04:35:51 +01:00
|
|
|
if minetest.get_modpath("unified_inventory") and unified_inventory.registered_categories then
|
2021-04-02 21:48:28 +02:00
|
|
|
if not unified_inventory.registered_categories["automation"] then
|
|
|
|
unified_inventory.register_category("automation", {
|
|
|
|
symbol = "pipeworks:lua_tube000000",
|
|
|
|
label = "Automation components"
|
|
|
|
})
|
|
|
|
end
|
|
|
|
unified_inventory.add_category_items("automation", pipeworks.ui_cat_tube_list)
|
|
|
|
end
|
|
|
|
|
2016-02-21 09:15:43 +01:00
|
|
|
minetest.log("info", "Pipeworks loaded!")
|