mirror of
https://github.com/minetest-mods/moreblocks.git
synced 2025-07-05 17:40:35 +02:00
almost done, mostly documentation left
This commit is contained in:
4
moreblocks/API.md
Normal file
4
moreblocks/API.md
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
function moreblocks.api.register_all_faces(itemstring, base, redef)
|
||||
|
||||
function moreblocks.api.register_trap(itemstring, base, redef)
|
@ -1,9 +1,3 @@
|
||||
--[[
|
||||
More Blocks: alias definitions
|
||||
|
||||
Copyright © 2011-2020 Hugo Locurcio and contributors.
|
||||
Licensed under the zlib license. See LICENSE.md for more information.
|
||||
--]]
|
||||
local cm = moreblocks.resources.craft_materials
|
||||
|
||||
-- More Blocks aliases:
|
||||
|
@ -1,4 +1,5 @@
|
||||
moreblocks.api = {}
|
||||
|
||||
moreblocks.dofile("api", "all_faces")
|
||||
moreblocks.dofile("api", "no_faces")
|
||||
moreblocks.dofile("api", "trap")
|
||||
|
28
moreblocks/api/no_faces.lua
Normal file
28
moreblocks/api/no_faces.lua
Normal file
@ -0,0 +1,28 @@
|
||||
local S = moreblocks.S
|
||||
|
||||
function moreblocks.api.register_no_faces(itemstring, base, redef)
|
||||
local def = table.copy(minetest.registered_nodes[base])
|
||||
|
||||
def.tiles = {def.tiles[3]}
|
||||
def.description = S("No-faces @1", def.description)
|
||||
|
||||
if def.short_description then
|
||||
def.short_description = S("No-faces @1", def.short_description)
|
||||
end
|
||||
|
||||
redef = redef or {}
|
||||
for k, v in pairs(redef) do
|
||||
def[k] = v
|
||||
end
|
||||
|
||||
minetest.register_node(itemstring, def)
|
||||
|
||||
minetest.register_craft({
|
||||
output = itemstring .. " 8",
|
||||
recipe = {
|
||||
{base, base, base},
|
||||
{base, "", base},
|
||||
{base, base, base},
|
||||
}
|
||||
})
|
||||
end
|
@ -1,9 +1,3 @@
|
||||
--[[
|
||||
More Blocks: crafting recipes
|
||||
|
||||
Copyright © 2011-2020 Hugo Locurcio and contributors.
|
||||
Licensed under the zlib license. See LICENSE.md for more information.
|
||||
--]]
|
||||
local cm = moreblocks.resources.craft_materials
|
||||
|
||||
if cm.stick and cm.dry_shrub then
|
||||
|
@ -1,12 +1,3 @@
|
||||
--[[
|
||||
=====================================================================
|
||||
** More Blocks **
|
||||
By Calinou, with the help of ShadowNinja and VanessaE.
|
||||
|
||||
Copyright © 2011-2020 Hugo Locurcio and contributors.
|
||||
Licensed under the zlib license. See LICENSE.md for more information.
|
||||
=====================================================================
|
||||
--]]
|
||||
local modname = minetest.get_current_modname()
|
||||
local modpath = minetest.get_modpath(modname)
|
||||
local S = minetest.get_translator(modname)
|
||||
|
@ -1,4 +1,5 @@
|
||||
name = moreblocks
|
||||
version = 3.0.0
|
||||
title = More Blocks
|
||||
description = Adds various blocks to the game.
|
||||
optional_depends = bucket, default, rhotator, screwdriver, stairs, stairsplus, vessels
|
||||
|
@ -1,10 +1,3 @@
|
||||
--[[
|
||||
More Blocks: node definitions
|
||||
|
||||
Copyright © 2011-2020 Hugo Locurcio and contributors.
|
||||
Licensed under the zlib license. See LICENSE.md for more information.
|
||||
--]]
|
||||
|
||||
local S = moreblocks.S
|
||||
|
||||
local cm = moreblocks.resources.craft_materials
|
||||
@ -84,6 +77,14 @@ local function register_all_faces(name, base)
|
||||
minetest.register_alias(name, itemstring)
|
||||
end
|
||||
|
||||
local function register_no_faces(name, base)
|
||||
name = "no_faces_" .. name
|
||||
local itemstring = ("%s:%s"):format(modname, name)
|
||||
moreblocks.api.register_no_faces(itemstring, base)
|
||||
register_stairs(name, minetest.registered_nodes[itemstring])
|
||||
minetest.register_alias(name, itemstring)
|
||||
end
|
||||
|
||||
local function register_trap(name, base)
|
||||
name = "trap_" .. name
|
||||
local itemstring = ("%s:%s"):format(modname, name)
|
||||
@ -462,20 +463,25 @@ end
|
||||
|
||||
if cm.tree then
|
||||
register_all_faces("tree", cm.tree)
|
||||
register_no_faces("tree", cm.tree)
|
||||
end
|
||||
|
||||
if cm.jungle_tree then
|
||||
register_all_faces("jungle_tree", cm.jungle_tree)
|
||||
register_no_faces("jungle_tree", cm.jungle_tree)
|
||||
end
|
||||
|
||||
if cm.pine_tree then
|
||||
register_all_faces("pine_tree", cm.pine_tree)
|
||||
register_no_faces("pine_tree", cm.pine_tree)
|
||||
end
|
||||
|
||||
if cm.acacia_tree then
|
||||
register_all_faces("acacia_tree", cm.acacia_tree)
|
||||
register_no_faces("acacia_tree", cm.acacia_tree)
|
||||
end
|
||||
|
||||
if cm.aspen_tree then
|
||||
register_all_faces("aspen_tree", cm.aspen_tree)
|
||||
register_no_faces("aspen_tree", cm.aspen_tree)
|
||||
end
|
||||
|
Reference in New Issue
Block a user