forked from mtcontrib/pipeworks
Replace minetest
namespace with core
(#158)
Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>
This commit is contained in:
32
init.lua
32
init.lua
@ -6,16 +6,16 @@
|
||||
|
||||
pipeworks = {
|
||||
ui_cat_tube_list = {},
|
||||
worldpath = minetest.get_worldpath(),
|
||||
modpath = minetest.get_modpath("pipeworks"),
|
||||
worldpath = core.get_worldpath(),
|
||||
modpath = core.get_modpath("pipeworks"),
|
||||
liquids = {
|
||||
water = {
|
||||
source = minetest.registered_nodes["mapgen_water_source"].name,
|
||||
flowing = minetest.registered_nodes["mapgen_water_source"].liquid_alternative_flowing
|
||||
source = core.registered_nodes["mapgen_water_source"].name,
|
||||
flowing = core.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
|
||||
source = core.registered_nodes["mapgen_river_water_source"].name,
|
||||
flowing = core.registered_nodes["mapgen_river_water_source"].liquid_alternative_flowing
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -29,14 +29,14 @@ if worldsettingsfile then
|
||||
dofile(worldsettingspath)
|
||||
end
|
||||
if pipeworks.toggles.pipe_mode == "pressure" then
|
||||
minetest.log("warning", "pipeworks pressure logic mode comes with caveats and differences in behaviour, you have been warned!")
|
||||
core.log("warning", "pipeworks pressure logic mode comes with caveats and differences in behaviour, you have been warned!")
|
||||
end
|
||||
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.")
|
||||
core.log("warning", "pipeworks accelerator tubes will not entirely work with an entity update interval 0.2 or above.")
|
||||
end
|
||||
|
||||
pipeworks.logger = function(msg)
|
||||
minetest.log("action", "[pipeworks] "..msg)
|
||||
core.log("action", "[pipeworks] "..msg)
|
||||
end
|
||||
|
||||
-------------------------------------------
|
||||
@ -47,7 +47,7 @@ if pipeworks.toggles.finite_water == nil then
|
||||
dofile(pipeworks.modpath.."/autodetect-finite-water.lua")
|
||||
end
|
||||
|
||||
if minetest.get_modpath("signs_lib") then
|
||||
if core.get_modpath("signs_lib") then
|
||||
dofile(pipeworks.modpath.."/signs_compat.lua")
|
||||
end
|
||||
|
||||
@ -73,7 +73,7 @@ dofile(pipeworks.modpath.."/tubes/tags.lua")
|
||||
if pipeworks.enable_teleport_tube then
|
||||
dofile(pipeworks.modpath.."/tubes/teleport.lua")
|
||||
end
|
||||
if pipeworks.enable_lua_tube and minetest.get_modpath("mesecons") then
|
||||
if pipeworks.enable_lua_tube and core.get_modpath("mesecons") then
|
||||
dofile(pipeworks.modpath.."/tubes/lua.lua")
|
||||
end
|
||||
if pipeworks.enable_sand_tube or pipeworks.enable_mese_sand_tube then
|
||||
@ -99,10 +99,10 @@ end
|
||||
if pipeworks.enable_redefines then
|
||||
dofile(pipeworks.modpath.."/compat-chests.lua")
|
||||
end
|
||||
if pipeworks.enable_redefines and (minetest.get_modpath("default") or minetest.get_modpath("hades_core")) then
|
||||
if pipeworks.enable_redefines and (core.get_modpath("default") or core.get_modpath("hades_core")) then
|
||||
dofile(pipeworks.modpath.."/compat-furnaces.lua")
|
||||
end
|
||||
if pipeworks.enable_redefines and minetest.get_modpath("mcl_furnaces") then
|
||||
if pipeworks.enable_redefines and core.get_modpath("mcl_furnaces") then
|
||||
dofile(pipeworks.modpath.."/mcl_furnaces.lua")
|
||||
end
|
||||
if pipeworks.enable_autocrafter then
|
||||
@ -111,11 +111,11 @@ end
|
||||
|
||||
dofile(pipeworks.modpath.."/crafts.lua")
|
||||
|
||||
minetest.register_alias("pipeworks:pipe", "pipeworks:pipe_110000_empty")
|
||||
core.register_alias("pipeworks:pipe", "pipeworks:pipe_110000_empty")
|
||||
|
||||
-- Unified Inventory categories integration
|
||||
|
||||
if minetest.get_modpath("unified_inventory") and unified_inventory.registered_categories then
|
||||
if core.get_modpath("unified_inventory") and unified_inventory.registered_categories then
|
||||
if not unified_inventory.registered_categories["automation"] then
|
||||
local symbol
|
||||
if pipeworks.enable_lua_tube then
|
||||
@ -131,4 +131,4 @@ if minetest.get_modpath("unified_inventory") and unified_inventory.registered_ca
|
||||
unified_inventory.add_category_items("automation", pipeworks.ui_cat_tube_list)
|
||||
end
|
||||
|
||||
minetest.log("info", "Pipeworks loaded!")
|
||||
core.log("info", "Pipeworks loaded!")
|
||||
|
Reference in New Issue
Block a user