start work on xcompating this

This commit is contained in:
wsor4035 2024-04-05 21:43:37 -04:00
parent 4b5e58331c
commit d3ad69dd23
10 changed files with 58 additions and 51 deletions

View File

@ -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",
}

View File

@ -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",

View File

@ -1,2 +1,3 @@
name = computers
depends = xcompat
optional_depends = screwdriver, default, basic_materials

View File

@ -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

View File

@ -1,2 +1,3 @@
name = home_vending_machines
depends = xcompat
optional_depends = screwdriver, default, dye, vessels, farming

View File

@ -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

View File

@ -1,3 +1,3 @@
name = home_workshop_machines
depends = unifieddyes
depends = unifieddyes, xcompat
optional_depends = default, screwdriver, dye, basic_materials

View File

@ -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 }
},
})

View File

@ -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

View File

@ -1,2 +1,3 @@
name = home_workshop_misc
depends = xcompat
optional_depends = currency, screwdriver, homedecor_common, default