documentation, bugfixes

This commit is contained in:
flux
2022-06-20 14:29:13 -07:00
parent b6d2bc09e2
commit 143778621e
19 changed files with 444 additions and 158 deletions

View File

@ -1,4 +1,9 @@
function moreblocks.api.register_all_faces(itemstring, base, redef)
* `moreblocks.api.register_all_faces(itemstring, base, [redef])`
Register an "All Faces" variant of a tree.
function moreblocks.api.register_trap(itemstring, base, redef)
* `moreblocks.api.register_no_faces(itemstring, base, [redef])`
Register a "No Faces" variant of a tree.
* `moreblocks.api.register_trap(itemstring, base, [redef])`
Register a "Trap" variant of a node. A trap variant is a non-solid node that looks like the original.

View File

@ -18,10 +18,10 @@ function moreblocks.api.register_no_faces(itemstring, base, redef)
minetest.register_node(itemstring, def)
minetest.register_craft({
output = itemstring .. " 8",
output = itemstring .. " 9",
recipe = {
{base, base, base},
{base, "", base},
{base, base, base},
{base, base, base},
}
})

View File

@ -1,6 +1,8 @@
local S = moreblocks.S
local cm = moreblocks.resources.craft_materials
local outline_trap_nodes = moreblocks.settings.outline_trap_nodes
function moreblocks.api.register_trap(itemstring, base, redef)
local def = table.copy(minetest.registered_nodes[base])
@ -10,8 +12,10 @@ function moreblocks.api.register_trap(itemstring, base, redef)
def.short_description = S("Trap @1", def.short_description)
end
for i, tile in ipairs(def.tiles) do
def.tiles[i] = tile .. "^moreblocks_trap_box.png"
if outline_trap_nodes then
for i, tile in ipairs(def.tiles) do
def.tiles[i] = tile .. "^moreblocks_trap_box.png"
end
end
if def.drawtype ~= "glasslike_framed_optional" then

View File

@ -30,6 +30,7 @@ moreblocks = {
end,
}
moreblocks.dofile("settings")
moreblocks.dofile("util")
moreblocks.dofile("resources", "init")
moreblocks.dofile("api", "init")

View File

@ -1,6 +1,40 @@
local table_set_all = moreblocks.util.table_set_all
moreblocks.resources.textures = {}
moreblocks.resources.textures = {
desert_stone = "[combine:16x16^[noalpha^[colorize:#85513e",
glass = ([[
[combine:16x16
:0,0=\[combine\:1x16\^[noalpha\^[colorize\:#FFF
:0,0=\[combine\:16x1\^[noalpha\^[colorize\:#FFF
:0,15=\[combine\:16x1\^[noalpha\^[colorize\:#FFF
:15,0=\[combine\:1x16\^[noalpha\^[colorize\:#FFF
]]):gsub("%s", ""),
glass_detail = ([[
[combine:16x16
:0,0=\[combine\:1x16\^[noalpha\^[colorize\:#FFF
:0,0=\[combine\:16x1\^[noalpha\^[colorize\:#FFF
:0,15=\[combine\:16x1\^[noalpha\^[colorize\:#FFF
:15,0=\[combine\:1x16\^[noalpha\^[colorize\:#FFF
]]):gsub("%s", ""),
obsidian = "default_obsidian.png",
obsidian_glass = ([[
[combine:16x16
:0,0=\[combine\:1x16\^[noalpha\^[colorize\:#000
:0,0=\[combine\:16x1\^[noalpha\^[colorize\:#000
:0,15=\[combine\:16x1\^[noalpha\^[colorize\:#000
:15,0=\[combine\:1x16\^[noalpha\^[colorize\:#000
]]):gsub("%s", ""),
obsidian_glass_detail = ([[
[combine:16x16
:0,0=\[combine\:1x16\^[noalpha\^[colorize\:#000
:0,0=\[combine\:16x1\^[noalpha\^[colorize\:#000
:0,15=\[combine\:16x1\^[noalpha\^[colorize\:#000
:15,0=\[combine\:1x16\^[noalpha\^[colorize\:#000
]]):gsub("%s", ""),
sandstone = "default_sandstone.png",
stone = "[combine:16x16^[noalpha^[colorize:#686463",
wood = "[combine:16x16^[noalpha^[colorize:#654321",
}
if moreblocks.has.default then
table_set_all(moreblocks.resources.textures, {

5
moreblocks/settings.lua Normal file
View File

@ -0,0 +1,5 @@
local s = minetest.settings
moreblocks.settings = {
outline_trap_nodes = s:get_bool("moreblocks.outline_trap_nodes", true),
}