VoxeLibre/mods/ITEMS/mcl_hollow_logs/init.lua

145 lines
5.4 KiB
Lua
Raw Normal View History

2024-03-04 16:07:53 +01:00
local modpath = minetest.get_modpath(minetest.get_current_modname())
local S = minetest.get_translator(minetest.get_current_modname())
2024-03-08 23:34:31 +01:00
mcl_hollow_logs.logs = {
2024-03-08 01:08:25 +01:00
{"acaciatree", "Hollow Acacia Log", "Stripped Hollow Acacia Log"},
{"birchtree", "Hollow Birch Log", "Stripped Hollow Birch Log"},
{"darktree", "Hollow Dark Oak Log", "Stripped Hollow Dark Oak Log"},
{"jungletree", "Hollow Jungle Log", "Stripped Hollow Jungle Log"},
{"sprucetree", "Hollow Spruce Log", "Stripped Hollow Spruce Log"},
{"tree", "Hollow Oak Log", "Stripped Hollow Oak Log"}
}
if minetest.get_modpath("mcl_cherry_blossom") then
2024-03-08 23:38:03 +01:00
table.insert(mcl_hollow_logs.logs, {"cherrytree", "Hollow Cherry Log", "Stripped Hollow Cherry Log"})
2024-03-08 01:08:25 +01:00
end
if minetest.get_modpath("mcl_mangrove") then
2024-03-08 23:38:03 +01:00
table.insert(mcl_hollow_logs.logs, {"mangrove_tree", "Hollow Mangrove Log", "Stripped Hollow Mangrove Log"})
2024-03-08 01:08:25 +01:00
end
2024-03-04 16:07:53 +01:00
local collisionbox = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5, -0.375},
{-0.5, -0.5, -0.5, -0.375, 0.5, 0.5},
{0.375, -0.5, -0.5, 0.5, 0.5, 0.5},
{-0.5, -0.5, 0.375, 0.5, 0.5, 0.5},
}
}
2024-03-08 23:38:03 +01:00
for i = 1, #mcl_hollow_logs.logs do
local name = mcl_hollow_logs.logs[i][1]
local normal_desc = mcl_hollow_logs.logs[i][2]
local stripped_desc = mcl_hollow_logs.logs[i][3]
2024-03-04 16:07:53 +01:00
2024-03-08 01:08:25 +01:00
minetest.register_node("mcl_hollow_logs:"..name.."_hollow", {
2024-03-04 16:07:53 +01:00
collision_box = collisionbox,
2024-03-08 01:08:25 +01:00
description = S(normal_desc),
2024-03-04 16:07:53 +01:00
drawtype = "mesh",
groups = {
axey = 1, building_block = 1, fire_encouragement = 5, fire_flammability = 5, flammable = 2,
handy = 1, hollow_log = 1
},
mesh = "mcl_hollow_logs_log.obj",
on_place = mcl_util.rotate_axis,
paramtype = "light",
paramtype2 = "facedir",
sounds = mcl_sounds.node_sound_wood_defaults(),
sunlight_propagates = true,
tiles = {"mcl_hollow_logs_"..name..".png"},
_mcl_blast_resistance = 2,
_mcl_hardness = 2,
2024-03-08 01:08:25 +01:00
_mcl_stripped_variant = "mcl_hollow_logs:stripped_"..name.."_hollow"
2024-03-04 16:07:53 +01:00
})
2024-03-08 01:08:25 +01:00
minetest.register_node("mcl_hollow_logs:stripped_"..name.."_hollow", {
2024-03-04 16:07:53 +01:00
collision_box = collisionbox,
2024-03-08 01:08:25 +01:00
description = S(stripped_desc),
2024-03-04 16:07:53 +01:00
drawtype = "mesh",
groups = {
axey = 1, building_block = 1, fire_encouragement = 5, fire_flammability = 5, flammable = 2,
handy = 1, hollow_log = 1
},
mesh = "mcl_hollow_logs_log.obj",
on_place = mcl_util.rotate_axis,
paramtype = "light",
paramtype2 = "facedir",
sounds = mcl_sounds.node_sound_wood_defaults(),
sunlight_propagates = true,
tiles = {"mcl_hollow_logs_stripped_"..name..".png"},
_mcl_blast_resistance = 2,
_mcl_hardness = 2
})
end
if minetest.get_modpath("mcl_crimson") then
2024-03-08 01:08:25 +01:00
minetest.register_node("mcl_hollow_logs:crimson_hyphae_hollow", {
2024-03-04 16:07:53 +01:00
collision_box = collisionbox,
2024-03-08 01:08:25 +01:00
description = S("Hollow Crimson Stem"),
2024-03-04 16:07:53 +01:00
drawtype = "mesh",
2024-03-08 01:08:25 +01:00
groups = {axey = 1, building_block = 1, handy = 1, hollow_stem = 1},
2024-03-04 16:07:53 +01:00
mesh = "mcl_hollow_logs_log.obj",
on_place = mcl_util.rotate_axis,
paramtype = "light",
paramtype2 = "facedir",
sounds = mcl_sounds.node_sound_wood_defaults(),
sunlight_propagates = true,
tiles = {"mcl_hollow_logs_crimson.png"},
_mcl_blast_resistance = 2,
_mcl_hardness = 2,
2024-03-08 01:08:25 +01:00
_mcl_stripped_variant = "mcl_hollow_logs:stripped_crimson_hyphae_hollow"
2024-03-04 16:07:53 +01:00
})
2024-03-08 01:08:25 +01:00
minetest.register_node("mcl_hollow_logs:stripped_crimson_hyphae_hollow", {
2024-03-04 16:07:53 +01:00
collision_box = collisionbox,
2024-03-08 01:08:25 +01:00
description = S("Stripped Hollow Crimson Stem"),
2024-03-04 16:07:53 +01:00
drawtype = "mesh",
2024-03-08 01:08:25 +01:00
groups = {axey = 1, building_block = 1, handy = 1, hollow_stem = 1},
2024-03-04 16:07:53 +01:00
mesh = "mcl_hollow_logs_log.obj",
on_place = mcl_util.rotate_axis,
paramtype = "light",
paramtype2 = "facedir",
sounds = mcl_sounds.node_sound_wood_defaults(),
sunlight_propagates = true,
tiles = {"mcl_hollow_logs_stripped_crimson.png"},
_mcl_blast_resistance = 2,
_mcl_hardness = 2
})
2024-03-08 01:08:25 +01:00
minetest.register_node("mcl_hollow_logs:warped_hyphae_hollow", {
2024-03-04 16:07:53 +01:00
collision_box = collisionbox,
2024-03-08 01:08:25 +01:00
description = S("Hollow Warped Stem"),
2024-03-04 16:07:53 +01:00
drawtype = "mesh",
2024-03-08 01:08:25 +01:00
groups = {axey = 1, building_block = 1, handy = 1, hollow_stem = 1},
2024-03-04 16:07:53 +01:00
mesh = "mcl_hollow_logs_log.obj",
on_place = mcl_util.rotate_axis,
paramtype = "light",
paramtype2 = "facedir",
sounds = mcl_sounds.node_sound_wood_defaults(),
sunlight_propagates = true,
tiles = {"mcl_hollow_logs_warped.png"},
_mcl_blast_resistance = 2,
_mcl_hardness = 2,
2024-03-08 01:08:25 +01:00
_mcl_stripped_variant = "mcl_hollow_logs:stripped_warped_hyphae_hollow"
2024-03-04 16:07:53 +01:00
})
2024-03-08 01:08:25 +01:00
minetest.register_node("mcl_hollow_logs:stripped_warped_hyphae_hollow", {
2024-03-04 16:07:53 +01:00
collision_box = collisionbox,
2024-03-08 01:08:25 +01:00
description = S("Stripped Hollow Warped Stem"),
2024-03-04 16:07:53 +01:00
drawtype = "mesh",
2024-03-08 01:08:25 +01:00
groups = {axey = 1, building_block = 1, handy = 1, hollow_stem = 1},
2024-03-04 16:07:53 +01:00
mesh = "mcl_hollow_logs_log.obj",
on_place = mcl_util.rotate_axis,
paramtype = "light",
paramtype2 = "facedir",
sounds = mcl_sounds.node_sound_wood_defaults(),
sunlight_propagates = true,
tiles = {"mcl_hollow_logs_stripped_warped.png"},
_mcl_blast_resistance = 2,
_mcl_hardness = 2
})
end
dofile(modpath.."/recipes.lua")