improve game agnostic ism (#18)

* start work on xcompating this

* make items digable in farlands

* remove reduntant if check

* use xcompat for copperblock and remove checks that prevent issues on non mtg before

* computers crafting

* last two crafts
This commit is contained in:
wsor4035 2024-04-14 06:23:58 -04:00 committed by GitHub
parent 4b5e58331c
commit 640bc42ae5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 82 additions and 83 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,10 +1,11 @@
-- Copyright (C) 2012-2013 Diego Martínez <kaeza@users.sf.net>
local materials = xcompat.materials
minetest.register_craft({
output = "computers:shefriendSOO",
recipe = {
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
{ "basic_materials:plastic_sheet", "default:glass", "basic_materials:plastic_sheet" },
{ "basic_materials:plastic_sheet", materials.glass, "basic_materials:plastic_sheet" },
{ "basic_materials:plastic_sheet", "group:wood", "basic_materials:plastic_sheet" }
}
})
@ -21,7 +22,7 @@ minetest.register_craft({
output = "computers:vanio",
recipe = {
{ "basic_materials:plastic_sheet", "", "" },
{ "default:glass", "", "" },
{ materials.glass, "", "" },
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
}
})
@ -39,7 +40,7 @@ minetest.register_craft({
output = "computers:slaystation2",
recipe = {
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
{ "basic_materials:plastic_sheet", "default:steel_ingot", "basic_materials:plastic_sheet" }
{ "basic_materials:plastic_sheet", materials.steel_ingot, "basic_materials:plastic_sheet" }
}
})
@ -55,7 +56,7 @@ minetest.register_craft({
output = "computers:admiral128",
recipe = {
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
{ "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" }
{ materials.steel_ingot, materials.steel_ingot, materials.steel_ingot }
}
})
@ -63,7 +64,7 @@ minetest.register_craft({
output = "computers:wee",
recipe = {
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
{ "basic_materials:plastic_sheet", "default:copper_ingot", "basic_materials:plastic_sheet" }
{ "basic_materials:plastic_sheet", materials.copper_ingot, "basic_materials:plastic_sheet" }
}
})
@ -71,7 +72,7 @@ minetest.register_craft({
output = "computers:piepad",
recipe = {
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
{ "basic_materials:plastic_sheet", "default:glass", "basic_materials:plastic_sheet" }
{ "basic_materials:plastic_sheet", materials.glass, "basic_materials:plastic_sheet" }
}
})
@ -80,45 +81,45 @@ minetest.register_craft({
minetest.register_craft({
output = "computers:monitor",
recipe = {
{ "basic_materials:plastic_sheet", "default:glass","" },
{ "basic_materials:plastic_sheet", "default:glass","" },
{ "basic_materials:plastic_sheet", "default:mese_crystal_fragment", "basic_materials:plastic_sheet" }
{ "basic_materials:plastic_sheet", materials.glass,"" },
{ "basic_materials:plastic_sheet", materials.glass,"" },
{ "basic_materials:plastic_sheet", materials.mese_crystal_fragment, "basic_materials:plastic_sheet" }
}
})
minetest.register_craft({
output = "computers:router",
recipe = {
{ "default:steel_ingot","","" },
{ "default:steel_ingot" ,"basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
{ "default:mese_crystal_fragment","basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
{ materials.steel_ingot,"","" },
{ materials.steel_ingot ,"basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
{ materials.mese_crystal_fragment,"basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
}
})
minetest.register_craft({
output = "computers:tower",
recipe = {
{ "basic_materials:plastic_sheet", "default:steel_ingot", "basic_materials:plastic_sheet" },
{ "basic_materials:plastic_sheet", "default:mese_crystal", "basic_materials:plastic_sheet" },
{ "basic_materials:plastic_sheet", "default:steel_ingot", "basic_materials:plastic_sheet" }
{ "basic_materials:plastic_sheet", materials.steel_ingot, "basic_materials:plastic_sheet" },
{ "basic_materials:plastic_sheet", materials.mese_crystal, "basic_materials:plastic_sheet" },
{ "basic_materials:plastic_sheet", materials.steel_ingot, "basic_materials:plastic_sheet" }
}
})
minetest.register_craft({
output = "computers:printer",
recipe = {
{ "basic_materials:plastic_sheet", "default:steel_ingot","" },
{ "basic_materials:plastic_sheet", "default:mese_crystal", "basic_materials:plastic_sheet" },
{ "basic_materials:plastic_sheet", "default:coal_lump", "basic_materials:plastic_sheet" }
{ "basic_materials:plastic_sheet", materials.steel_ingot,"" },
{ "basic_materials:plastic_sheet", materials.mese_crystal, "basic_materials:plastic_sheet" },
{ "basic_materials:plastic_sheet", materials.coal_lump, "basic_materials:plastic_sheet" }
}
})
minetest.register_craft({
output = "computers:printer",
recipe = {
{ "basic_materials:plastic_sheet", "default:steel_ingot","" },
{ "basic_materials:plastic_sheet", "default:mese_crystal", "basic_materials:plastic_sheet" },
{ "basic_materials:plastic_sheet", "dye:black", "basic_materials:plastic_sheet", }
{ "basic_materials:plastic_sheet", materials.steel_ingot,"" },
{ "basic_materials:plastic_sheet", materials.mese_crystal, "basic_materials:plastic_sheet" },
{ "basic_materials:plastic_sheet", materials.dye_black, "basic_materials:plastic_sheet", }
}
})
@ -135,7 +136,7 @@ minetest.register_craft({
output = "computers:tetris_arcade",
recipe = {
{ "basic_materials:plastic_sheet", "basic_materials:energy_crystal_simple", "basic_materials:plastic_sheet", },
{ "dye:black", "default:glass", "dye:black" },
{ materials.dye_black, materials.glass, materials.dye_black },
{ "basic_materials:plastic_sheet", "basic_materials:energy_crystal_simple", "basic_materials:plastic_sheet" }
}
})

View File

@ -12,7 +12,7 @@ local function reg_simple(name, def)
tiles = def.tiles,
paramtype = "light",
paramtype2 = "facedir",
groups = def.groups or {snappy=3},
groups = def.groups or {snappy=3, dig_tree=2},
is_ground_content = false,
selection_box = {
type = "fixed",

View File

@ -1,32 +1,26 @@
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
end
local materials = xcompat.materials
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, materials.copper_block, materials.steel_ingot},
},
})
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, materials.copper_block, materials.steel_ingot},
},
})
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, materials.copper_block, materials.steel_ingot},
},
})

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)
@ -16,9 +17,9 @@ minetest.register_node("home_workshop_machines:3dprinter_bedflinger", {
},
paramtype = "light",
walkable = true,
groups = {snappy=3, ud_param2_colorable = 1},
groups = {snappy=3, ud_param2_colorable = 1, dig_tree=2},
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",
@ -47,9 +48,9 @@ minetest.register_node("home_workshop_machines:3dprinter_corexy", {
},
paramtype = "light",
walkable = true,
groups = {snappy=3, ud_param2_colorable = 1},
groups = {snappy=3, ud_param2_colorable = 1, dig_tree=2},
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,20 +68,18 @@ 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
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" }
{ "basic_materials:motor", materials.axe_steel, materials.pick_steel },
{ 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

@ -18,7 +18,7 @@ minetest.register_node("home_workshop_misc:tool_cabinet", {
paramtype2="facedir",
inventory_image = "home_workshop_misc_tool_cabinet_inv.png",
on_rotate = minetest.get_modpath("screwdriver") and screwdriver.rotate_simple or nil,
groups = { snappy=3 },
groups = { snappy=3, dig_tree=2 },
is_ground_content = false,
expand = { top="placeholder" },
inventory = {
@ -37,7 +37,7 @@ minetest.register_node("home_workshop_misc:beer_tap", {
inventory_image = "home_workshop_misc_beertap_inv.png",
paramtype = "light",
paramtype2 = "facedir",
groups = { snappy=3 },
groups = { snappy=3, dig_tree=2 },
is_ground_content = false,
walkable = false,
selection_box = {
@ -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