Added Bamboo Mosaic.

Added Tiki Lamp (extras) - Requires mcl_lanterns to be fixed to allow API to be called from other mods.
Moved Side Scaffolding to bambootoo.lua
This commit is contained in:
Michieal 2022-12-14 23:02:08 -05:00
parent 29bc74dde9
commit 773c760727
7 changed files with 171 additions and 48 deletions

View File

@ -0,0 +1,122 @@
---
--- 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 SIDE_SCAFFOLDING = false
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)
-- crafted by "mcl_stair:slab_bamboo_plank", "mcl_stair:slab_bamboo_block", "mcl_stair:slab_bamboo_stripped"
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 Stair"),
S("Bamboo Slab"),
S("Double Bamboo Slab")
)
end
end
if SIDE_SCAFFOLDING then
--currently, disabled.
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"},
drawtype = "nodebox",
paramtype = "light",
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
})
end
end
local function bambootoo_register_craftings()
minetest.register_craft({
output = bamboo .. "_mosaic",
recipe = {
{"mcl_stair:slab_bamboo_plank"},
{"mcl_stair:slab_bamboo_plank"},
}
})
minetest.register_craft({
output = bamboo .. "_mosaic",
recipe = {
{"mcl_stair:slab_bamboo_block"},
{"mcl_stair:slab_bamboo_block"},
}
})
minetest.register_craft({
output = bamboo .. "_mosaic",
recipe = {
{"mcl_stair:slab_bamboo_stripped"},
{"mcl_stair:slab_bamboo_stripped"},
}
})
-- Fuels...
minetest.register_craft({
type = "fuel",
recipe = bamboo .. "_mosaic",
burntime = 7.5,
})
end
bambootoo_create_nodes()
bambootoo_register_craftings()

View File

@ -0,0 +1,40 @@
---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by michieal.
--- DateTime: 12/14/22 10:14 PM
---
local modname = minetest.get_current_modname()
local S = minetest.get_translator(modname)
local bamboo = "mcl_bamboo:bamboo"
local function tiki_lamp()
if minetest.get_modpath("mcl_lanterns") then
if mcl_lanterns ~= nil then
mcl_lanterns.register_lantern("tikilamp", {
description = S("Tiki Lamp"),
longdesc = S("Tiki Lamps are light sources which can be placed on the top or the bottom of most blocks."),
texture = "mcl_bamboo_extras_tikilamp.png",
texture_inv = "mcl_bamboo_extras_tikilamp_inv.png",
light_level = 14,
})
minetest.register_craft({
output = "mcl_lanterns:tikilamp_floor",
recipe = {
{bamboo, bamboo,bamboo},
{bamboo, "mcl_torches:torch", bamboo},
{bamboo, bamboo,bamboo},
},
})
end
end
end
-- ------------------------------------
tiki_lamp()

View File

@ -8,12 +8,6 @@
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 node_sound = mcl_sounds.node_sound_wood_defaults()
-- CONSTS
@ -558,46 +552,6 @@ local function create_nodes()
})
if SIDE_SCAFFOLDING then
--currently, disabled.
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"},
drawtype = "nodebox",
paramtype = "light",
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
})
end
end
local function register_craftings()
@ -701,6 +655,12 @@ register_craftings()
-- MAPGEN
dofile(minetest.get_modpath(modname) .. "/mapgen.lua")
-- BAMBOO_TOO (Bamboo two)
dofile(minetest.get_modpath(modname) .. "/bambootoo.lua")
-- BAMBOO EXTRAS
dofile(minetest.get_modpath(modname) .. "/extras.lua")
--ABMs
minetest.register_abm({
nodenames = {"mcl_bamboo:bamboo"},
@ -753,6 +713,7 @@ minetest.register_alias("bamboo_block", "mcl_bamboo:bamboo_block")
minetest.register_alias("bamboo_strippedblock", "mcl_bamboo:bamboo_block_stripped")
minetest.register_alias("bamboo", "mcl_bamboo:bamboo")
minetest.register_alias("bamboo_plank", "mcl_bamboo:bamboo_plank")
minetest.register_alias("bamboo_mosaic", "mcl_bamboo:bamboo_mosaic")
minetest.register_alias("mcl_stairs:stair_bamboo", "mcl_stairs:stair_bamboo_block")
minetest.register_alias("bamboo:bamboo", "mcl_bamboo:bamboo")
@ -760,7 +721,7 @@ minetest.register_alias("bamboo:bamboo", "mcl_bamboo:bamboo")
--[[
todo -- make scaffolds do side scaffold blocks, so that they jut out.
todo -- Also, make those blocks collapse (break) when a nearby connected scaffold breaks.
todo -- add in alternative bamboo styles to simulate random placement. (see commented out nde box definitions.
todo -- add in alternative bamboo styles to simulate random placement. (see commented out node box definitions.
todo -- make endcap node for bamboo, so that they can be 12-16 nodes high and stop growing.
todo -- mash all of that together so that it drops as one item, and chooses what version to be, in on_place.
todo -- Raft

View File

@ -1,4 +1,4 @@
name = mcl_bamboo
depends = mcl_core, mcl_sounds, mcl_tools
optional_depends = mcl_flowerpots, mclx_stairs, mcl_doors, mcl_signs, mesecons_pressureplates, mcl_fences, mesecons_button
optional_depends = mcl_flowerpots, mclx_stairs, mcl_doors, mcl_signs, mesecons_pressureplates, mcl_fences, mesecons_button, mcl_lanterns
author = Michieal

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 520 B