From d3ad69dd2392afd9484181caaf0052078f2cc0f7 Mon Sep 17 00:00:00 2001 From: wsor4035 <24964441+wsor4035@users.noreply.github.com> Date: Fri, 5 Apr 2024 21:43:37 -0400 Subject: [PATCH] start work on xcompating this --- .luacheckrc | 2 +- computers/computers.lua | 12 +++---- computers/mod.conf | 1 + home_vending_machines/crafts.lua | 61 ++++++++++++++++---------------- home_vending_machines/mod.conf | 1 + home_workshop_machines/init.lua | 15 ++++---- home_workshop_machines/mod.conf | 2 +- home_workshop_misc/crafts.lua | 12 ++++--- home_workshop_misc/init.lua | 2 +- home_workshop_misc/mod.conf | 1 + 10 files changed, 58 insertions(+), 51 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 784ff1a..c2cef01 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -21,5 +21,5 @@ read_globals = { "vector", "ItemStack", "dump", "DIR_DELIM", "VoxelArea", "Settings", "PcgRandom", "VoxelManip", "PseudoRandom", --mod produced - "default", "screwdriver", "unifieddyes", "computers", "farming", + "default", "screwdriver", "unifieddyes", "computers", "farming", "xcompat", } \ No newline at end of file diff --git a/computers/computers.lua b/computers/computers.lua index 73327f7..2364c80 100644 --- a/computers/computers.lua +++ b/computers/computers.lua @@ -85,7 +85,7 @@ minetest.register_node("computers:piepad", { groups = {oddly_breakable_by_hand=2}, is_ground_content = false, selection_box = {type = "wallmounted"}, - sounds = default and default.node_sound_wood_defaults() or nil + sounds = xcompat.sounds.node_sound_wood_defaults() }) -- Commodore 64 lookalike @@ -182,7 +182,7 @@ minetest.register_node("computers:router", { walkable = false, groups = {snappy=3}, is_ground_content = false, - sound = default and default.node_sound_wood_defaults() or nil, + sound = xcompat.sounds.node_sound_wood_defaults(), drawtype = "nodebox", node_box = { type = "fixed", @@ -211,7 +211,7 @@ minetest.register_node("computers:tower", { paramtype2 = "facedir", groups = {snappy=3}, is_ground_content = false, - sound = default and default.node_sound_wood_defaults() or nil, + sound = xcompat.sounds.node_sound_wood_defaults(), selection_box = pct_cbox, collision_box = pct_cbox }) @@ -242,7 +242,7 @@ minetest.register_node("computers:server", { type = "fixed", fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375} }, - sounds = default and default.node_sound_wood_defaults() or nil, + sounds = xcompat.sounds.node_sound_wood_defaults(), on_rightclick = function(pos, node, clicker, itemstack) node.name = "computers:server_on" minetest.set_node(pos, node) @@ -283,7 +283,7 @@ minetest.register_node("computers:server_on", { type = "fixed", fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375} }, - sounds = default and default.node_sound_wood_defaults() or nil, + sounds = xcompat.sounds.node_sound_wood_defaults(), drop = 'computers:server', on_rightclick = function(pos, node, clicker, itemstack) node.name = "computers:server" @@ -305,7 +305,7 @@ minetest.register_node("computers:printer", { walkable = true, groups = {snappy=3}, is_ground_content = false, - sound = default and default.node_sound_wood_defaults() or nil, + sound = xcompat.sounds.node_sound_wood_defaults(), drawtype = "nodebox", node_box = { type = "fixed", diff --git a/computers/mod.conf b/computers/mod.conf index 77e5d97..368b2a5 100644 --- a/computers/mod.conf +++ b/computers/mod.conf @@ -1,2 +1,3 @@ name = computers +depends = xcompat optional_depends = screwdriver, default, basic_materials diff --git a/home_vending_machines/crafts.lua b/home_vending_machines/crafts.lua index 760439c..d828898 100644 --- a/home_vending_machines/crafts.lua +++ b/home_vending_machines/crafts.lua @@ -1,32 +1,33 @@ +local materials = xcompat.materials + if minetest.get_modpath("default") then - if minetest.get_modpath("dye") then - minetest.register_craft({ - output = "home_workshop_misc:soda_machine", - recipe = { - {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, - {"default:steel_ingot", "dye:red", "default:steel_ingot"}, - {"default:steel_ingot", "default:copperblock", "default:steel_ingot"}, - }, - }) - end - if minetest.get_modpath("vessels") then - minetest.register_craft({ - output = "home_vending_machines:drink_machine", - recipe = { - {"default:steel_ingot", "group:vessel", "default:steel_ingot"}, - {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, - {"default:steel_ingot", "default:copperblock", "default:steel_ingot"}, - }, - }) - end - if minetest.global_exists("farming") and farming.mod == "redo" then - minetest.register_craft({ - output = "home_vending_machines:sweet_machine", - recipe = { - {"default:steel_ingot", "group:food_sugar", "default:steel_ingot"}, - {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, - {"default:steel_ingot", "default:copperblock", "default:steel_ingot"}, - }, - }) - end + minetest.register_craft({ + output = "home_workshop_misc:soda_machine", + recipe = { + {materials.steel_ingot, materials.steel_ingot, materials.steel_ingot}, + {materials.steel_ingot, materials.dye_red, materials.steel_ingot}, + {materials.steel_ingot, "default:copperblock", materials.steel_ingot}, + }, + }) end +if minetest.get_modpath("vessels") then + minetest.register_craft({ + output = "home_vending_machines:drink_machine", + recipe = { + {materials.steel_ingot, "group:vessel", materials.steel_ingot}, + {materials.steel_ingot, materials.steel_ingot, materials.steel_ingot}, + {materials.steel_ingot, "default:copperblock", materials.steel_ingot}, + }, + }) +end +if minetest.global_exists("farming") and farming.mod == "redo" then + minetest.register_craft({ + output = "home_vending_machines:sweet_machine", + recipe = { + {materials.steel_ingot, "group:food_sugar", materials.steel_ingot}, + {materials.steel_ingot, materials.steel_ingot, materials.steel_ingot}, + {materials.steel_ingot, "default:copperblock", materials.steel_ingot}, + }, + }) +end + diff --git a/home_vending_machines/mod.conf b/home_vending_machines/mod.conf index b39b636..e88c440 100644 --- a/home_vending_machines/mod.conf +++ b/home_vending_machines/mod.conf @@ -1,2 +1,3 @@ name = home_vending_machines +depends = xcompat optional_depends = screwdriver, default, dye, vessels, farming \ No newline at end of file diff --git a/home_workshop_machines/init.lua b/home_workshop_machines/init.lua index 76ac45f..100ace8 100644 --- a/home_workshop_machines/init.lua +++ b/home_workshop_machines/init.lua @@ -1,4 +1,5 @@ local S = minetest.get_translator("home_workshop_machines") +local materials = xcompat.materials -- "bedflinger" style 3D Printer (Prusa i3 or equivalent) @@ -18,7 +19,7 @@ minetest.register_node("home_workshop_machines:3dprinter_bedflinger", { walkable = true, groups = {snappy=3, ud_param2_colorable = 1}, is_ground_content = false, - sound = default and default.node_sound_wood_defaults() or nil, + sound = xcompat.sounds.node_sound_wood_defaults(), drawtype = "mesh", mesh = "home_workshop_machines_3dprinter_bedflinger.obj", paramtype2 = "colorwallmounted", @@ -49,7 +50,7 @@ minetest.register_node("home_workshop_machines:3dprinter_corexy", { walkable = true, groups = {snappy=3, ud_param2_colorable = 1}, is_ground_content = false, - sound = default and default.node_sound_wood_defaults() or nil, + sound = xcompat.sounds.node_sound_wood_defaults(), drawtype = "mesh", mesh = "home_workshop_machines_3dprinter_corexy.obj", paramtype2 = "colorwallmounted", @@ -67,9 +68,9 @@ if minetest.get_modpath("basic_materials") then minetest.register_craft({ output = "home_workshop_machines:3dprinter_bedflinger", recipe = { - {"basic_materials:plastic_sheet", "dye:white", "basic_materials:plastic_sheet"}, + {"basic_materials:plastic_sheet", materials.dye_white, "basic_materials:plastic_sheet"}, {"basic_materials:motor", "basic_materials:heating_element", "basic_materials:motor"}, - {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, + {materials.steel_ingot, materials.steel_ingot, materials.steel_ingot}, }, }) end @@ -78,9 +79,9 @@ if minetest.get_modpath("basic_materials") then minetest.register_craft({ output = "home_workshop_machines:3dprinter_corexy", recipe = { - {"default:steel_ingot", "basic_materials:motor", "basic_materials:plastic_sheet"}, - {"default:glass", "basic_materials:heating_element", "default:glass"}, - {"default:steel_ingot", "basic_materials:motor", "default:steel_ingot"}, + {materials.steel_ingot, "basic_materials:motor", "basic_materials:plastic_sheet"}, + {materials.glass, "basic_materials:heating_element", materials.glass}, + {materials.steel_ingot, "basic_materials:motor", materials.steel_ingot}, }, }) end diff --git a/home_workshop_machines/mod.conf b/home_workshop_machines/mod.conf index 1145336..0985393 100644 --- a/home_workshop_machines/mod.conf +++ b/home_workshop_machines/mod.conf @@ -1,3 +1,3 @@ name = home_workshop_machines -depends = unifieddyes +depends = unifieddyes, xcompat optional_depends = default, screwdriver, dye, basic_materials diff --git a/home_workshop_misc/crafts.lua b/home_workshop_misc/crafts.lua index 46b0826..7f228c9 100644 --- a/home_workshop_misc/crafts.lua +++ b/home_workshop_misc/crafts.lua @@ -1,17 +1,19 @@ +local materials = xcompat.materials + minetest.register_craft({ output = "home_workshop_misc:tool_cabinet", recipe = { { "basic_materials:motor", "default:axe_steel", "default:pick_steel" }, - { "default:steel_ingot", "home_workshop_misc:drawer_small", "default:steel_ingot" }, - { "default:steel_ingot", "home_workshop_misc:drawer_small", "default:steel_ingot" } + { materials.steel_ingot, "home_workshop_misc:drawer_small", materials.steel_ingot }, + { materials.steel_ingot, "home_workshop_misc:drawer_small", materials.steel_ingot } }, }) minetest.register_craft({ output = "home_workshop_misc:beer_tap", recipe = { - { "group:stick", "default:steel_ingot", "group:stick" }, - { "basic_materials:steel_bar", "default:steel_ingot", "basic_materials:steel_bar" }, - { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" } + { "group:stick", materials.steel_ingot, "group:stick" }, + { "basic_materials:steel_bar", materials.steel_ingot, "basic_materials:steel_bar" }, + { materials.steel_ingot, materials.steel_ingot, materials.steel_ingot } }, }) \ No newline at end of file diff --git a/home_workshop_misc/init.lua b/home_workshop_misc/init.lua index 1b472a1..6f2a157 100644 --- a/home_workshop_misc/init.lua +++ b/home_workshop_misc/init.lua @@ -80,7 +80,7 @@ minetest.register_node("home_workshop_misc:beer_mug", { groups = { snappy=3, oddly_breakable_by_hand=3 }, is_ground_content = false, walkable = false, - sounds = default and default.node_sound_glass_defaults() or nil, + sounds = xcompat.sounds.node_sound_glass_defaults(), selection_box = beer_cbox, on_use = function(itemstack, user, pointed_thing) if not minetest.is_creative_enabled(user:get_player_name()) then diff --git a/home_workshop_misc/mod.conf b/home_workshop_misc/mod.conf index b3958bb..f5bccbf 100644 --- a/home_workshop_misc/mod.conf +++ b/home_workshop_misc/mod.conf @@ -1,2 +1,3 @@ name = home_workshop_misc +depends = xcompat optional_depends = currency, screwdriver, homedecor_common, default