2022-12-15 04:02:08 +00:00
|
|
|
---
|
|
|
|
--- Generated by EmmyLua(https://github.com/EmmyLua)
|
|
|
|
--- Created by michieal.
|
|
|
|
--- DateTime: 12/14/22 10:11 PM
|
|
|
|
---
|
|
|
|
|
|
|
|
-- LOCALS
|
|
|
|
local modname = minetest.get_current_modname()
|
|
|
|
local S = minetest.get_translator(modname)
|
|
|
|
local bamboo = "mcl_bamboo:bamboo"
|
|
|
|
local adj_nodes = {
|
|
|
|
vector.new(0, 0, 1),
|
|
|
|
vector.new(0, 0, -1),
|
|
|
|
vector.new(1, 0, 0),
|
|
|
|
vector.new(-1, 0, 0),
|
|
|
|
}
|
|
|
|
|
|
|
|
local function bambootoo_create_nodes()
|
|
|
|
local bamboo_mosaic = minetest.registered_nodes[bamboo .. "_plank"]
|
|
|
|
bamboo_mosaic.tiles = {"mcl_bamboo_bamboo_plank.png"}
|
|
|
|
bamboo_mosaic.groups = {handy = 1, axey = 1, flammable = 3, fire_encouragement = 5, fire_flammability = 20}
|
|
|
|
bamboo_mosaic.description = S("Bamboo Mosaic Plank")
|
|
|
|
bamboo_mosaic._doc_items_longdesc = S("Bamboo Mosaic Plank")
|
2022-12-24 05:57:44 +00:00
|
|
|
minetest.register_node("mcl_bamboo:bamboo_mosaic", bamboo_mosaic)
|
2022-12-23 22:27:01 +00:00
|
|
|
|
2022-12-15 04:02:08 +00:00
|
|
|
if minetest.get_modpath("mcl_stairs") then
|
|
|
|
if mcl_stairs ~= nil then
|
|
|
|
mcl_stairs.register_stair_and_slab_simple(
|
|
|
|
"bamboo_mosaic",
|
|
|
|
"mcl_bamboo:bamboo_mosaic",
|
2022-12-23 22:27:01 +00:00
|
|
|
S("Bamboo Mosaic Stair"),
|
|
|
|
S("Bamboo Mosaic Slab"),
|
|
|
|
S("Double Bamboo Mosaic Slab")
|
2022-12-15 04:02:08 +00:00
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2022-12-25 12:30:31 +00:00
|
|
|
minetest.register_node("mcl_bamboo:scaffolding_horizontal", {
|
|
|
|
description = S("Scaffolding (horizontal)"),
|
|
|
|
doc_items_longdesc = S("Scaffolding block used to climb up or out across areas."),
|
|
|
|
doc_items_hidden = false,
|
|
|
|
tiles = {"mcl_bamboo_scaffolding_top.png", "mcl_bamboo_scaffolding_top.png", "mcl_bamboo_scaffolding_bottom.png"},
|
|
|
|
drop = "mcl_bamboo:scaffolding",
|
|
|
|
drawtype = "nodebox",
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "4dir",
|
|
|
|
param2 = 0,
|
|
|
|
use_texture_alpha = "clip",
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, 0.375, -0.5, 0.5, 0.5, 0.5},
|
|
|
|
{-0.5, -0.5, -0.5, -0.375, 0.5, -0.375},
|
|
|
|
{0.375, -0.5, -0.5, 0.5, 0.5, -0.375},
|
|
|
|
{0.375, -0.5, 0.375, 0.5, 0.5, 0.5},
|
|
|
|
{-0.5, -0.5, 0.375, -0.375, 0.5, 0.5},
|
|
|
|
{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
2022-12-15 04:02:08 +00:00
|
|
|
},
|
2022-12-25 12:30:31 +00:00
|
|
|
},
|
|
|
|
groups = {handy = 1, axey = 1, flammable = 3, building_block = 1, material_wood = 1, fire_encouragement = 5, fire_flammability = 20, not_in_creative_inventory = 1, falling_node = 1},
|
|
|
|
_mcl_after_falling = function(pos)
|
|
|
|
if minetest.get_node(pos).name == "mcl_bamboo:scaffolding_horizontal" then
|
|
|
|
if minetest.get_node(vector.offset(pos, 0, 0, 0)).name ~= "mcl_bamboo:scaffolding" then
|
|
|
|
minetest.remove_node(pos)
|
|
|
|
minetest.add_item(pos, "mcl_bamboo:scaffolding")
|
|
|
|
else
|
|
|
|
minetest.set_node(vector.offset(pos, 0, 1, 0), {name = "mcl_bamboo:scaffolding"})
|
2022-12-15 04:02:08 +00:00
|
|
|
end
|
|
|
|
end
|
2022-12-25 12:30:31 +00:00
|
|
|
end,
|
|
|
|
|
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
if pointed_thing.type ~= "node" then
|
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
local node = minetest.get_node(pointed_thing.under)
|
|
|
|
local pos = pointed_thing.under
|
|
|
|
if mcl_bamboo.is_protected(pos, placer) then
|
|
|
|
return
|
|
|
|
end
|
2022-12-15 04:02:08 +00:00
|
|
|
|
2022-12-25 12:30:31 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
})
|
2022-12-15 04:02:08 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
local function bambootoo_register_craftings()
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = bamboo .. "_mosaic",
|
|
|
|
recipe = {
|
|
|
|
{"mcl_stair:slab_bamboo_plank"},
|
|
|
|
{"mcl_stair:slab_bamboo_plank"},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
-- Fuels...
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
|
|
|
recipe = bamboo .. "_mosaic",
|
|
|
|
burntime = 7.5,
|
|
|
|
})
|
2022-12-24 05:57:44 +00:00
|
|
|
if minetest.get_modpath("mcl_stairs") then
|
|
|
|
if mcl_stairs ~= nil then
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
|
|
|
recipe = "mcl_stairs:slab_bamboo_mosaic",
|
|
|
|
burntime = 7.5,
|
|
|
|
})
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
|
|
|
recipe = "mcl_stairs:stair_bamboo_mosaic",
|
|
|
|
burntime = 15,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
2022-12-15 04:02:08 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
bambootoo_create_nodes()
|
2022-12-23 22:27:01 +00:00
|
|
|
bambootoo_register_craftings()
|