From 7cc0d128df22888218ddb6ca128a1ca784959d13 Mon Sep 17 00:00:00 2001 From: wsor4035 <24964441+wsor4035@users.noreply.github.com> Date: Sat, 2 Mar 2024 22:42:32 -0500 Subject: [PATCH] switch to using xcompat --- .luacheckrc | 3 +- crafts.lua | 4 +-- init.lua | 7 ++--- materials.lua | 67 ----------------------------------------- mod.conf | 2 +- tubes/embedded_tube.lua | 2 +- 6 files changed, 8 insertions(+), 77 deletions(-) delete mode 100644 materials.lua diff --git a/.luacheckrc b/.luacheckrc index d128c79..215a236 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -20,6 +20,7 @@ read_globals = { -- mods "default", "mesecon", "digiline", "screwdriver", "unified_inventory", - "i3", "mcl_experience", "awards" + "i3", "mcl_experience", "awards", + "xcompat", } diff --git a/crafts.lua b/crafts.lua index 7ed9671..058cc8a 100644 --- a/crafts.lua +++ b/crafts.lua @@ -1,5 +1,5 @@ -- Crafting recipes for pipes -local materials = ... +local materials = xcompat.materials minetest.register_craft( { output = "pipeworks:pipe_1_empty 12", @@ -151,7 +151,7 @@ minetest.register_craft( { output = "pipeworks:teleport_tube_1 2", recipe = { { "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }, - { materials.desert_stone, materials.teleporter, materials.desert_stone }, + { materials.desert_stone, materials.mese, materials.desert_stone }, { "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" } }, }) diff --git a/init.lua b/init.lua index 5a86a01..42ad9b7 100644 --- a/init.lua +++ b/init.lua @@ -61,14 +61,11 @@ dofile(pipeworks.modpath.."/flowing_logic.lua") dofile(pipeworks.modpath.."/filter-injector.lua") dofile(pipeworks.modpath.."/trashcan.lua") dofile(pipeworks.modpath.."/wielder.lua") - -local materials = loadfile(pipeworks.modpath.."/materials.lua")() - dofile(pipeworks.modpath.."/tubes/registration.lua") dofile(pipeworks.modpath.."/tubes/routing.lua") dofile(pipeworks.modpath.."/tubes/sorting.lua") dofile(pipeworks.modpath.."/tubes/signal.lua") -loadfile(pipeworks.modpath.."/tubes/embedded_tube.lua")(materials) +dofile(pipeworks.modpath.."/tubes/embedded_tube.lua") dofile(pipeworks.modpath.."/tubes/pane_embedded_tube.lua") if pipeworks.enable_teleport_tube then @@ -111,7 +108,7 @@ if pipeworks.enable_autocrafter then dofile(pipeworks.modpath.."/autocrafter.lua") end -loadfile(pipeworks.modpath.."/crafts.lua")(materials) +dofile(pipeworks.modpath.."/crafts.lua") minetest.register_alias("pipeworks:pipe", "pipeworks:pipe_110000_empty") diff --git a/materials.lua b/materials.lua deleted file mode 100644 index ca9adf5..0000000 --- a/materials.lua +++ /dev/null @@ -1,67 +0,0 @@ -local materials = { - stone = "default:stone", - desert_stone = "default:desert_stone", - desert_sand = "default:desert_sand", - chest = "default:chest", - copper_ingot = "default:copper_ingot", - steel_ingot = "default:steel_ingot", - gold_ingot = "default:gold_ingot", - mese = "default:mese", - mese_crystal = "default:mese_crystal", - mese_crystal_fragment = "default:mese_crystal_fragment", - teleporter = "default:mese", - glass = "default:glass" -} - -if minetest.get_modpath("mcl_core") then - materials = { - stone = "mcl_core:stone", - desert_stone = "mcl_core:redsandstone", - desert_sand = "mcl_core:sand", - chest = "mcl_chests:chest", - steel_ingot = "mcl_core:iron_ingot", - gold_ingot = "mcl_core:gold_ingot", - mese = "mesecons_torch:redstoneblock", - mese_crystal = "mesecons:redstone", - mese_crystal_fragment = "mesecons:redstone", - teleporter = "mesecons_torch:redstoneblock", - copper_ingot = "mcl_copper:copper_ingot", - glass = "mcl_core:glass", - } -elseif minetest.get_modpath("fl_ores") and minetest.get_modpath("fl_stone") then - materials = { - stone = "fl_stone:stone", - desert_stone = "fl_stone:desert_stone", - desert_sand = "fl_stone:desert_sand", - chest = "fl_storage:wood_chest", - steel_ingot = "fl_ores:iron_ingot", - gold_ingot = "fl_ores:gold_ingot", - mese = "fl_ores:iron_ingot", - mese_crystal = "fl_ores:iron_ingot", - mese_crystal_fragment = "fl_ores:iron_ingot", - teleporter = "fl_ores:iron_ingot", - copper_ingot = "fl_ores:copper_ingot", - glass = "fl_glass:framed_glass", - } -elseif minetest.get_modpath("hades_core") then - materials = { - stone = "hades_core:stone", - desert_stone = "hades_core:stone_baked", - desert_sand = "hades_core:volcanic_sand", - chest = "hades_chests:chest"; - steel_ingot = "hades_core:steel_ingot", - gold_ingot = "hades_core:gold_ingot", - mese = "hades_core:mese", - mese_crystal = "hades_core:mese_crystal", - mese_crystal_fragment = "hades_core:mese_crystal_fragment", - teleporter = "hades_materials:teleporter_device", - copper_ingot = "hades_core:copper_ingot", - tin_ingot = "hades_core:tin_ingot", - glass = "hades_core:glass", - } - if minetest.get_modpath("hades_default") then - materials.desert_sand = "hades_default:desert_sand" - end -end - -return materials \ No newline at end of file diff --git a/mod.conf b/mod.conf index 3e57efe..479abc8 100644 --- a/mod.conf +++ b/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 +depends = basic_materials, xcompat 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 min_minetest_version = 5.5.0 diff --git a/tubes/embedded_tube.lua b/tubes/embedded_tube.lua index 05e0672..0ca6e36 100644 --- a/tubes/embedded_tube.lua +++ b/tubes/embedded_tube.lua @@ -1,4 +1,4 @@ -local materials = ... +local materials = xcompat.materials local S = minetest.get_translator("pipeworks") local straight = function(pos, node, velocity, stack) return {velocity} end