aboutsummaryrefslogtreecommitdiff
path: root/stairsplus
diff options
context:
space:
mode:
authorCalinou <calinou@opmbx.org>2014-06-27 20:14:08 +0200
committerCalinou <calinou@opmbx.org>2014-06-27 20:14:08 +0200
commite2f4cc369b98cdb13791738d4aa70605670223db (patch)
treecc852a6ebc47e5a5e6bb5573a64914047c64ba68 /stairsplus
parent2b6eb1ff842229f202bfa8078a8c55eb8942d3b6 (diff)
downloadmoreblocks-e2f4cc369b98cdb13791738d4aa70605670223db.tar.gz
moreblocks-e2f4cc369b98cdb13791738d4aa70605670223db.tar.bz2
moreblocks-e2f4cc369b98cdb13791738d4aa70605670223db.zip
Code cleanup. Add tar and more stone types.
Diffstat (limited to 'stairsplus')
-rw-r--r--stairsplus/API.md8
-rw-r--r--stairsplus/aliases.lua1
-rw-r--r--stairsplus/init.lua13
-rw-r--r--stairsplus/microblocks.lua5
-rw-r--r--stairsplus/panels.lua5
-rw-r--r--stairsplus/registrations.lua10
-rw-r--r--stairsplus/slabs.lua5
-rw-r--r--stairsplus/stairs.lua5
8 files changed, 17 insertions, 35 deletions
diff --git a/stairsplus/API.md b/stairsplus/API.md
index 480b848..a98ec81 100644
--- a/stairsplus/API.md
+++ b/stairsplus/API.md
@@ -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)`
diff --git a/stairsplus/aliases.lua b/stairsplus/aliases.lua
index e197035..747a1c3 100644
--- a/stairsplus/aliases.lua
+++ b/stairsplus/aliases.lua
@@ -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")
-
diff --git a/stairsplus/init.lua b/stairsplus/init.lua
index 74d7ddb..4ea710f 100644
--- a/stairsplus/init.lua
+++ b/stairsplus/init.lua
@@ -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")
-
diff --git a/stairsplus/microblocks.lua b/stairsplus/microblocks.lua
index 6a19bf1..24eaffb 100644
--- a/stairsplus/microblocks.lua
+++ b/stairsplus/microblocks.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
-
diff --git a/stairsplus/panels.lua b/stairsplus/panels.lua
index 7e4fd8d..a250fc3 100644
--- a/stairsplus/panels.lua
+++ b/stairsplus/panels.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
@@ -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
-
diff --git a/stairsplus/registrations.lua b/stairsplus/registrations.lua
index 491c72f..cc22d33 100644
--- a/stairsplus/registrations.lua
+++ b/stairsplus/registrations.lua
@@ -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
diff --git a/stairsplus/slabs.lua b/stairsplus/slabs.lua
index be5b308..bee4af3 100644
--- a/stairsplus/slabs.lua
+++ b/stairsplus/slabs.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
@@ -101,4 +99,3 @@ function stairsplus:register_slab(modname, subname, recipeitem, fields)
recipe = {"moreblocks:panel_" .. subname, "moreblocks:panel_" .. subname},
})
end
-
diff --git a/stairsplus/stairs.lua b/stairsplus/stairs.lua
index 1830686..d5283c3 100644
--- a/stairsplus/stairs.lua
+++ b/stairsplus/stairs.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
@@ -192,4 +190,3 @@ function stairsplus:register_stair(modname, subname, recipeitem, fields)
recipe = {"moreblocks:panel_" .. subname, "moreblocks:panel_" .. subname, "moreblocks:panel_" .. subname},
})
end
-