forked from minetest-mods/moreblocks
Code cleanup. Add tar and more stone types.
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
API documentation for StairsPlus
|
||||
API documentation for Stairs+
|
||||
================================
|
||||
- - - - - - - - - - - - - - - -
|
||||
|
||||
* `stairsplus:register_all(modname, subname, recipeitem, fields)`
|
||||
Registers a stair, slab, panel, microblock, and any other types of
|
||||
microblocks to be added in the future.
|
||||
Also registers the node with the circular saw.
|
||||
nodes to be added in the future.
|
||||
This also registers the node with the circular saw.
|
||||
Example:
|
||||
```lua
|
||||
stairsplus:register_all("moreblocks", "wood", "defaut:wood", {
|
||||
@ -16,7 +16,7 @@ API documentation for StairsPlus
|
||||
})
|
||||
```
|
||||
The following register only a particular type of microblock.
|
||||
You will probably never want to use them directly.
|
||||
You will probably never want to use them directly:
|
||||
|
||||
* `stairsplus:register_stair(modname, subname, recipeitem, fields)`
|
||||
* `stairsplus:register_slab(modname, subname, recipeitem, fields)`
|
||||
|
@ -60,4 +60,3 @@ register_stairsplus_alias("moreblocks", "splitstonesquare", "split_stone_tile")
|
||||
register_stairsplus_alias("moreblocks", "woodtile", "wood_tile")
|
||||
register_stairsplus_alias("moreblocks", "woodtile_centered", "wood_tile_centered")
|
||||
register_stairsplus_alias("moreblocks", "woodtile_full", "wood_tile_full")
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
-- Nodes will be called <modname>:{stair,slab,panel,micro}_<subname>
|
||||
|
||||
local modpath = minetest.get_modpath("moreblocks").."/stairsplus"
|
||||
@ -6,8 +5,8 @@ local modpath = minetest.get_modpath("moreblocks").."/stairsplus"
|
||||
stairsplus = {}
|
||||
stairsplus.expect_infinite_stacks = false
|
||||
|
||||
if not minetest.get_modpath("unified_inventory") and
|
||||
minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.get_modpath("unified_inventory")
|
||||
and minetest.setting_getbool("creative_mode") then
|
||||
stairsplus.expect_infinite_stacks = true
|
||||
end
|
||||
|
||||
@ -21,7 +20,7 @@ function stairsplus:register_all(modname, subname, recipeitem, fields)
|
||||
self:register_slab (modname, subname, recipeitem, fields)
|
||||
self:register_panel(modname, subname, recipeitem, fields)
|
||||
self:register_micro(modname, subname, recipeitem, fields)
|
||||
-- self:register_6dfacedir_conversion(modname, subname)
|
||||
-- self:register_6dfacedir_conversion(modname, subname) -- Not needed as of Q3 2013, uncomment to fix old maps.
|
||||
circular_saw.known_nodes[recipeitem] = {modname, subname}
|
||||
end
|
||||
|
||||
@ -35,12 +34,10 @@ function register_stair_slab_panel_micro(modname, subname, recipeitem, groups, i
|
||||
})
|
||||
end
|
||||
|
||||
-- dofile(modpath.."/aliases.lua")
|
||||
-- dofile(modpath.."/conversion.lua")
|
||||
|
||||
-- dofile(modpath.."/aliases.lua") -- Not needed as of Q2 2013, uncomment to fix old maps.
|
||||
-- dofile(modpath.."/conversion.lua") -- Not needed as of Q2 2013, uncomment to fix old maps.
|
||||
dofile(modpath.."/stairs.lua")
|
||||
dofile(modpath.."/slabs.lua")
|
||||
dofile(modpath.."/panels.lua")
|
||||
dofile(modpath.."/microblocks.lua")
|
||||
dofile(modpath.."/registrations.lua")
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
-- Load translation library if intllib is installed
|
||||
|
||||
local S
|
||||
local S -- Load translation library if intllib is installed:
|
||||
if intllib then
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
@ -110,4 +108,3 @@ function stairsplus:register_micro(modname, subname, recipeitem, fields)
|
||||
recipe = {"moreblocks:micro_" .. subname, "moreblocks:micro_" .. subname, "moreblocks:micro_" .. subname, "moreblocks:micro_" .. subname, "moreblocks:micro_" .. subname, "moreblocks:micro_" .. subname, "moreblocks:micro_" .. subname, "moreblocks:micro_" .. subname},
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
-- Load translation library if intllib is installed
|
||||
|
||||
local S
|
||||
local S -- Load translation library if intllib is installed:
|
||||
if intllib then
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
@ -111,4 +109,3 @@ function stairsplus:register_panel(modname, subname, recipeitem, fields)
|
||||
recipe = {"moreblocks:panel_" .. subname, "moreblocks:panel_" .. subname, "moreblocks:panel_" .. subname, "moreblocks:panel_" .. subname},
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
-- Default stairs/slabs/panels/microblocks.
|
||||
|
||||
local default_nodes = {
|
||||
local default_nodes = { -- Default stairs/slabs/panels/microblocks:
|
||||
"stone",
|
||||
"cobble",
|
||||
"mossycobble",
|
||||
@ -12,7 +10,7 @@ local default_nodes = {
|
||||
"bronzeblock",
|
||||
"diamondblock",
|
||||
"desert_stone",
|
||||
-- "desert_cobble", -- Does not work in minetest_game.
|
||||
-- "desert_cobble",
|
||||
"glass",
|
||||
"tree",
|
||||
"wood",
|
||||
@ -26,11 +24,11 @@ local default_nodes = {
|
||||
}
|
||||
|
||||
for _, name in pairs(default_nodes) do
|
||||
local nodename = "default:"..name
|
||||
local nodename = "default:" .. name
|
||||
local ndef = minetest.registered_nodes[nodename]
|
||||
local groups = {}
|
||||
for k, v in pairs(ndef.groups)
|
||||
-- Ignore wood and stone groups to not make them usable in crafting.
|
||||
-- Ignore wood and stone groups to not make them usable in crafting:
|
||||
do if k ~= "wood" and k ~= "stone" then
|
||||
groups[k] = v
|
||||
end
|
||||
|
@ -1,6 +1,4 @@
|
||||
-- Load translation library if intllib is installed
|
||||
|
||||
local S
|
||||
local S -- Load translation library if intllib is installed:
|
||||
if intllib then
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
@ -101,4 +99,3 @@ function stairsplus:register_slab(modname, subname, recipeitem, fields)
|
||||
recipe = {"moreblocks:panel_" .. subname, "moreblocks:panel_" .. subname},
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
-- Load translation library if intllib is installed
|
||||
|
||||
local S
|
||||
local S -- Load translation library if intllib is installed:
|
||||
if intllib then
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
@ -192,4 +190,3 @@ function stairsplus:register_stair(modname, subname, recipeitem, fields)
|
||||
recipe = {"moreblocks:panel_" .. subname, "moreblocks:panel_" .. subname, "moreblocks:panel_" .. subname},
|
||||
})
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user