Misc. Fixes.

Added in burn times for slabs.
This commit is contained in:
Michieal 2022-12-18 21:04:43 -05:00
parent 1861d7d30d
commit 5191326fc7
1 changed files with 59 additions and 35 deletions

View File

@ -348,7 +348,10 @@ local function create_nodes()
slab = 1, slab = 1,
axey = 1, axey = 1,
handy = 1, handy = 1,
stair = 1 stair = 1,
flammable = 1,
fire_encouragement = 5,
fire_flammability = 20
} }
minetest.override_item(bamboo_plank_slab, {groups = node_groups}) minetest.override_item(bamboo_plank_slab, {groups = node_groups})
@ -551,7 +554,6 @@ local function create_nodes()
-- Node destructor; called before removing node. -- Node destructor; called before removing node.
local new_pos = vector.offset(pos, 0, 1, 0) local new_pos = vector.offset(pos, 0, 1, 0)
local node_above = minetest.get_node(new_pos) local node_above = minetest.get_node(new_pos)
if node_above and node_above.name == "mcl_bamboo:scaffolding" then
if node_above and node_above.name == "mcl_bamboo:scaffolding" then if node_above and node_above.name == "mcl_bamboo:scaffolding" then
local sound_params = { local sound_params = {
pos = new_pos, pos = new_pos,
@ -564,7 +566,6 @@ local function create_nodes()
local istack = ItemStack("mcl_bamboo:scaffolding") local istack = ItemStack("mcl_bamboo:scaffolding")
minetest.add_item(new_pos, istack) minetest.add_item(new_pos, istack)
end end
end
end, end,
}) })
@ -645,27 +646,6 @@ local function register_craftings()
} }
}) })
-- Barrel and composter recipes
if minetest.get_modpath("mcl_stairs") and 1 == 2 then
-- currently disabled.
if mcl_stairs ~= nil then
minetest.register_craft({
output = "mcl_barrels:barrel_closed",
recipe = {
{"group:wood", "group:wood_slab", "group:wood"},
{"group:wood", "", "group:wood"},
{"group:wood", "group:wood_slab", "group:wood"},
}
})
minetest.register_craft({
type = "fuel",
recipe = "mcl_barrels:barrel_closed",
burntime = 15,
})
end
end
minetest.register_craft({ minetest.register_craft({
output = "mcl_bamboo:scaffolding 6", output = "mcl_bamboo:scaffolding 6",
recipe = {{bamboo, "mcl_mobitems:string", bamboo}, recipe = {{bamboo, "mcl_mobitems:string", bamboo},
@ -732,6 +712,24 @@ local function register_craftings()
recipe = "mcl_bamboo:scaffolding", recipe = "mcl_bamboo:scaffolding",
burntime = 20 burntime = 20
}) })
"mcl_stairs:slab_bamboo_plank"
minetest.register_craft({
type = "fuel",
recipe = "mcl_stairs:slab_bamboo_plank",
burntime = 7.5,
})
minetest.register_craft({
type = "fuel",
recipe = "mcl_stairs:slab_bamboo_block",
burntime = 7.5,
})
minetest.register_craft({
type = "fuel",
recipe = "mcl_stairs:slab_bamboo_stripped",
burntime = 7.5,
})
end end
create_nodes() create_nodes()
@ -740,6 +738,8 @@ register_craftings()
-- MAPGEN -- MAPGEN
dofile(minetest.get_modpath(modname) .. "/mapgen.lua") dofile(minetest.get_modpath(modname) .. "/mapgen.lua")
local BAMBOO_MAX_HEIGHT_CHECK = -16
--ABMs --ABMs
minetest.register_abm({ minetest.register_abm({
nodenames = {"mcl_bamboo:bamboo"}, nodenames = {"mcl_bamboo:bamboo"},
@ -751,7 +751,7 @@ minetest.register_abm({
return return
end end
local found_soil = false local found_soil = false
for py = -1, -16, -1 do for py = -1, BAMBOO_MAX_HEIGHT_CHECK, -1 do
local chk_pos = vector.offset(pos, 0, py, 0) local chk_pos = vector.offset(pos, 0, py, 0)
local name = minetest.get_node(chk_pos).name local name = minetest.get_node(chk_pos).name
if minetest.get_item_group(name, "soil") ~= 0 then if minetest.get_item_group(name, "soil") ~= 0 then
@ -810,4 +810,28 @@ todo: Added a new "Mosaic" plank variant that is unique to Bamboo called Bamboo
You can craft Stair and Slab variants of Bamboo Mosaic You can craft Stair and Slab variants of Bamboo Mosaic
Bamboo Mosaic blocks cannot be used as a crafting ingredient where other wooden blocks are used, but they can be Bamboo Mosaic blocks cannot be used as a crafting ingredient where other wooden blocks are used, but they can be
used as fuel. used as fuel.
todo -- add in fuel recipes for:
[-] bamboo slab + stripped bamboo slab
[-] bamboo stair + stripped bamboo stair + bamboo plank stair
[-] bamboo button
--]]
--[[
Useful code snippit for dealing with updating groups on already defined objects, such as api created items.
I think that this will be implemented, as time goes on, to deal with adding groups to slabs and the like.
local function addgroups(name, ...)
local def = minetest.registered_items[name] or error(name .. " not found")
local groups = {}
for k, v in pairs(def.groups) do
groups[k] = v
end
local function addall(x, ...)
if not x then return end
groups[x] = 1
return addall(...)
end
addall(...)
return minetest.override_item(name, {groups = groups})
end
--]] --]]