mirror of
https://github.com/mt-mods/coloredwood.git
synced 2024-11-13 06:00:22 +01:00
add optional moreblocks/stairsplus support
defaults to enabled, to disable add: coloredwood_enable_stairsplus = false to minetest.conf.
This commit is contained in:
parent
252d3ee1e8
commit
1a3b387c9a
|
@ -1,2 +1,3 @@
|
|||
default
|
||||
unifieddyes
|
||||
moreblocks?
|
||||
|
|
7
init.lua
7
init.lua
|
@ -1,4 +1,4 @@
|
|||
-- Colored Wood mod by Vanessa Ezekowitz ~~ 2013-03-20
|
||||
-- Colored Wood mod by Vanessa Ezekowitz
|
||||
-- based on my unifieddyes template.
|
||||
--
|
||||
-- License: WTFPL
|
||||
|
@ -16,8 +16,8 @@
|
|||
-- Uncolored sticks cannot be dyed separately, but they can still be used
|
||||
-- to build colored wooden fences. These are crafted either by placing six
|
||||
-- plain, uncolored sticks into the crafting grid in the usual manner, plus
|
||||
-- one portion of dye or paint in the upper-left corner of the grid
|
||||
-- (D = dye or paint, S = uncolored stick):
|
||||
-- one portion of dye in the upper-left corner of the grid
|
||||
-- (D = dye, S = uncolored stick):
|
||||
--
|
||||
-- D - -
|
||||
-- S S S
|
||||
|
@ -43,7 +43,6 @@
|
|||
dofile(minetest.get_modpath("coloredwood").."/wood.lua")
|
||||
dofile(minetest.get_modpath("coloredwood").."/fence.lua")
|
||||
dofile(minetest.get_modpath("coloredwood").."/stick.lua")
|
||||
--dofile(minetest.get_modpath("coloredwood").."/ladder.lua")
|
||||
|
||||
print("[Colored Wood] Loaded!")
|
||||
|
||||
|
|
73
wood.lua
73
wood.lua
|
@ -3,6 +3,14 @@
|
|||
--
|
||||
-- License: WTFPL
|
||||
|
||||
local coloredwood = {}
|
||||
|
||||
coloredwood.enable_stairsplus = true
|
||||
|
||||
if minetest.setting_getbool("coloredwood_enable_stairsplus") == false or not minetest.get_modpath("moreblocks") then
|
||||
coloredwood.enable_stairsplus = false
|
||||
end
|
||||
|
||||
local colored_block_modname = "coloredwood"
|
||||
local colored_block_description = "Wood Planks"
|
||||
local neutral_block = "default:wood"
|
||||
|
@ -106,8 +114,6 @@ for shade = 1, 3 do
|
|||
minetest.register_node(colorname, {
|
||||
description = nodedesc,
|
||||
tiles = { pngname },
|
||||
-- inventory_image = pngname,
|
||||
-- wield_image = pngname,
|
||||
sunlight_propagates = colored_block_sunlight,
|
||||
paramtype = "light",
|
||||
walkable = colored_block_walkable,
|
||||
|
@ -118,8 +124,6 @@ for shade = 1, 3 do
|
|||
minetest.register_node(s50colorname, {
|
||||
description = s50nodedesc,
|
||||
tiles = { s50pngname },
|
||||
-- inventory_image = s50pngname,
|
||||
-- wield_image = s50pngname,
|
||||
sunlight_propagates = colored_block_sunlight,
|
||||
paramtype = "light",
|
||||
walkable = colored_block_walkable,
|
||||
|
@ -127,6 +131,35 @@ for shade = 1, 3 do
|
|||
sounds = colored_block_sound
|
||||
})
|
||||
|
||||
if coloredwood.enable_stairsplus then
|
||||
|
||||
-- stairsplus:register_all(modname, subname, recipeitem, {fields})
|
||||
|
||||
stairsplus:register_all(
|
||||
"coloredwood",
|
||||
"wood_"..shadename..huename,
|
||||
colorname,
|
||||
{
|
||||
groups = colored_block_groups,
|
||||
tiles = { pngname },
|
||||
description = nodedesc,
|
||||
drop = "wood_"..shadename..huename,
|
||||
}
|
||||
)
|
||||
|
||||
stairsplus:register_all(
|
||||
"coloredwood",
|
||||
"wood_"..shadename..huename.."_s50",
|
||||
s50colorname,
|
||||
{
|
||||
groups = colored_block_groups,
|
||||
tiles = { s50pngname },
|
||||
description = s50nodedesc,
|
||||
drop = "wood_"..shadename..huename.."_s50",
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = colorname,
|
||||
|
@ -177,8 +210,6 @@ for hue = 1, 12 do
|
|||
minetest.register_node(colorname, {
|
||||
description = nodedesc,
|
||||
tiles = { pngname },
|
||||
-- inventory_image = pngname,
|
||||
-- wield_image = pngname,
|
||||
sunlight_propagates = colored_block_sunlight,
|
||||
paramtype = "light",
|
||||
walkable = colored_block_walkable,
|
||||
|
@ -186,6 +217,20 @@ for hue = 1, 12 do
|
|||
sounds = colored_block_sound
|
||||
})
|
||||
|
||||
if coloredwood.enable_stairsplus then
|
||||
stairsplus:register_all(
|
||||
"coloredwood",
|
||||
"wood_light_"..huename,
|
||||
colorname,
|
||||
{
|
||||
groups = colored_block_groups,
|
||||
tiles = { pngname },
|
||||
description = nodedesc,
|
||||
drop = "wood_light_"..huename,
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = colorname,
|
||||
|
@ -225,8 +270,6 @@ for grey = 1,5 do
|
|||
minetest.register_node(greyshadename, {
|
||||
description = nodedesc,
|
||||
tiles = { pngname },
|
||||
-- inventory_image = pngname,
|
||||
-- wield_image = pngname,
|
||||
sunlight_propagates = colored_block_sunlight,
|
||||
paramtype = "light",
|
||||
walkable = colored_block_walkable,
|
||||
|
@ -234,6 +277,20 @@ for grey = 1,5 do
|
|||
sounds = colored_block_sound
|
||||
})
|
||||
|
||||
if coloredwood.enable_stairsplus then
|
||||
stairsplus:register_all(
|
||||
"coloredwood",
|
||||
"wood_"..greyname,
|
||||
greyshadename,
|
||||
{
|
||||
groups = colored_block_groups,
|
||||
tiles = { pngname },
|
||||
description = nodedesc,
|
||||
drop = "wood_"..greyname,
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = greyshadename,
|
||||
|
|
Loading…
Reference in New Issue
Block a user