mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-24 20:03:45 +01:00
6f05992c8b
Removed Make_Stairs check. Made unified protection check. Began work on the second half of scaffolding. Removed comments that was no longer needed.
130 lines
3.5 KiB
Lua
130 lines
3.5 KiB
Lua
---
|
|
--- 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")
|
|
minetest.register_node("mcl_bamboo:bamboo_mosaic", bamboo_mosaic)
|
|
|
|
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",
|
|
S("Bamboo Mosaic Stair"),
|
|
S("Bamboo Mosaic Slab"),
|
|
S("Double Bamboo Mosaic Slab")
|
|
)
|
|
end
|
|
end
|
|
|
|
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},
|
|
},
|
|
},
|
|
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"})
|
|
end
|
|
end
|
|
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
|
|
|
|
end
|
|
|
|
|
|
})
|
|
|
|
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,
|
|
})
|
|
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
|
|
end
|
|
|
|
bambootoo_create_nodes()
|
|
bambootoo_register_craftings()
|