2013-07-17 21:34:35 +02:00
|
|
|
-- REGISTER MATERIALS AND PROPERTIES FOR NONCUBIC ELEMENTS:
|
|
|
|
-----------------------------------------------------------
|
2013-10-30 18:45:32 +01:00
|
|
|
|
2018-11-25 14:13:56 +01:00
|
|
|
local S = technic_cnc.getter
|
2013-10-30 18:45:32 +01:00
|
|
|
|
2024-04-28 18:41:52 +02:00
|
|
|
local function register_material(nodename, tiles_override, descr_override)
|
|
|
|
local ndef = minetest.registered_nodes[nodename]
|
|
|
|
if not ndef then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
local groups = {
|
2024-08-03 08:23:29 +02:00
|
|
|
cracky = ndef.groups.cracky,
|
2024-04-28 18:41:52 +02:00
|
|
|
crumbly = ndef.groups.crumbly,
|
|
|
|
choppy = ndef.groups.choppy,
|
|
|
|
flammable = ndef.groups.flammable,
|
|
|
|
level = ndef.groups.level,
|
|
|
|
snappy = ndef.groups.snappy,
|
|
|
|
wood = ndef.groups.wood,
|
|
|
|
oddly_breakable_by_hand = ndef.groups.oddly_breakable_by_hand,
|
|
|
|
not_in_creative_inventory = 1,
|
|
|
|
}
|
2024-08-03 08:23:29 +02:00
|
|
|
local count = 0
|
|
|
|
for _ in pairs(groups) do
|
|
|
|
count = count + 1
|
|
|
|
end
|
|
|
|
assert(count >= 2, "Too few groups. node name=" .. nodename)
|
|
|
|
|
2024-04-28 18:41:52 +02:00
|
|
|
local tiles = tiles_override or { ndef.tiles[#ndef.tiles] }
|
|
|
|
assert(tiles and #tiles == 1, "Unknown tile format in node name=" .. nodename)
|
|
|
|
|
|
|
|
technic_cnc.register_all(nodename,
|
|
|
|
groups,
|
|
|
|
tiles,
|
|
|
|
descr_override or ndef.description or "<unknown>"
|
|
|
|
)
|
|
|
|
end
|
2014-03-29 09:59:41 +01:00
|
|
|
|
2024-04-28 18:41:52 +02:00
|
|
|
register_material("default:dirt")
|
|
|
|
register_material("default:dirt_with_grass", {"default_grass.png"}, S("Grassy dirt"))
|
|
|
|
register_material("default:wood", nil, S("Wooden"))
|
|
|
|
register_material("default:stone")
|
|
|
|
register_material("default:cobble")
|
|
|
|
register_material("default:sandstone")
|
|
|
|
register_material("default:leaves")
|
|
|
|
register_material("default:tree")
|
|
|
|
register_material("default:bronzeblock", nil, S("Bronze"))
|
2014-03-29 09:59:41 +01:00
|
|
|
|
2024-04-28 18:41:52 +02:00
|
|
|
local steelname = S("Steel")
|
2014-03-29 09:59:41 +01:00
|
|
|
|
2018-11-25 14:13:56 +01:00
|
|
|
if technic_cnc.technic_modpath then
|
2024-04-28 18:41:52 +02:00
|
|
|
steelname = S("Wrought Iron")
|
|
|
|
|
|
|
|
register_material("technic:stainless_steel_block", nil, S("Stainless Steel"))
|
|
|
|
register_material("technic:stainless_steel_block")
|
|
|
|
register_material("technic:marble")
|
|
|
|
register_material("technic:granite")
|
|
|
|
register_material("technic:blast_resistant_concrete")
|
|
|
|
register_material("technic:blast_resistant_concrete")
|
2018-11-25 14:13:56 +01:00
|
|
|
end
|
|
|
|
|
2024-04-28 18:41:52 +02:00
|
|
|
register_material("default:steelblock", nil, steelname)
|
|
|
|
|
2018-11-25 15:18:37 +01:00
|
|
|
|
|
|
|
-- CONCRETE AND CEMENT
|
|
|
|
----------------------
|
|
|
|
|
2024-04-28 18:41:52 +02:00
|
|
|
register_material("basic_materials:concrete_block")
|
|
|
|
register_material("basic_materials:cement_block")
|
|
|
|
register_material("basic_materials:brass_block")
|