mirror of
https://github.com/minetest-mods/moreblocks.git
synced 2025-06-29 14:41:01 +02:00
Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
16ae14f458 | |||
59c384dca4 | |||
df8c150c9a | |||
7347b05e3e | |||
acd570ba0d | |||
f3005d6367 | |||
fc3c5f4738 | |||
fbfb079f54 | |||
e9c6cef4dd | |||
5f35766ed0 | |||
f4b68fbfd7 | |||
6a1ffa7651 | |||
0569ff9683 | |||
6f033c1695 |
31
CHANGELOG.md
31
CHANGELOG.md
@ -1,10 +1,35 @@
|
|||||||
# Change Log
|
# Changelog
|
||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [1.1.0] - 2017-10-04
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- 3 new node shapes in the circular saw (thin slabs, available in
|
||||||
|
"L-shaped", "corner-shaped" and "U-shaped" variations), all with 1/16
|
||||||
|
thickness.
|
||||||
|
- New Stairs+ nodes:
|
||||||
|
- Coral Skeleton
|
||||||
|
- Desert Sandstone, Silver Sandstone
|
||||||
|
- Desert Sandstone Brick, Silver Sandstone Brick
|
||||||
|
- Desert Sandstone Block, Silver Sandstone Block
|
||||||
|
- Obsidian Block
|
||||||
|
- Sandstone Block
|
||||||
|
- Stone Block, Desert Stone Block
|
||||||
|
- Straw
|
||||||
|
- Tin Block
|
||||||
|
- Wool (all colors)
|
||||||
|
- Other mods can now get a list of all the defined Stairs+ shapes
|
||||||
|
|
||||||
## [1.0.0] - 2017-02-19
|
## [1.0.0] - 2017-02-19
|
||||||
|
|
||||||
- Initial versioned release.
|
- Initial versioned release.
|
||||||
|
|
||||||
|
[1.1.0]: https://github.com/minetest-mods/moreblocks/compare/v1.0.0...v1.1.0
|
||||||
|
[Unreleased]: https://github.com/minetest-mods/moreblocks/compare/v1.0.0...HEAD
|
||||||
|
10
CONTRIBUTING.md
Normal file
10
CONTRIBUTING.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Contributing to More Blocks
|
||||||
|
|
||||||
|
Thank you for your interest in More Blocks! Before contributing,
|
||||||
|
be sure to know about these few guidelines:
|
||||||
|
|
||||||
|
- Contributions have to be licensed under the zlib license (or compatible)
|
||||||
|
for code, and CC BY-SA 3.0 (or compatible) for assets.
|
||||||
|
- Make sure to update the changelog, keeping the
|
||||||
|
[changelog format](http://keepachangelog.com/en/1.0.0/) we use.
|
||||||
|
- Don't bump the version yourself. Maintainers will do this when necessary.
|
74
README.md
74
README.md
@ -1,12 +1,76 @@
|
|||||||
# More Blocks
|
# More Blocks
|
||||||
|
|
||||||
More Blocks for [Minetest](http://minetest.net), a free and open source infinite
|
More Blocks for [Minetest](https://www.minetest.net/), a free and open source infinite
|
||||||
world block sandbox game.
|
world block sandbox game.
|
||||||
|
|
||||||
To install, just clone this repository into your "mods" directory.
|
[**Forum topic**](https://forum.minetest.net/viewtopic.php?f=11&t=509)
|
||||||
|
|
||||||
More Blocks code is licensed under the zlib license, textures are by Calinou and are licensed under CC BY-SA 3.0 Unported.
|
## Installation
|
||||||
|
|
||||||
moreblocks_copperpatina.png is by pithydon licensed under CC0 1.0
|
### Download the mod
|
||||||
|
|
||||||
**Forum topic:** <https://forum.minetest.net/viewtopic.php?f=11&t=509>
|
To install More Blocks, clone this Git repository into your Minetest's `mods/`
|
||||||
|
directory:
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone https://github.com/minetest-mods/moreblocks.git
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also
|
||||||
|
[download a ZIP archive](https://github.com/minetest-mods/moreblocks/archive/master.zip)
|
||||||
|
of More Blocks. If you do so, you will need to extract the archive, then rename
|
||||||
|
the resulting folder from `moreblocks-master` to `moreblocks` – this is
|
||||||
|
**absolutely** necessary to do, else, it won't work!
|
||||||
|
|
||||||
|
### Enable the mod
|
||||||
|
|
||||||
|
Once you have installed More Blocks, you need to enable it in Minetest.
|
||||||
|
The procedure is as follows:
|
||||||
|
|
||||||
|
#### Using the client's main menu
|
||||||
|
|
||||||
|
This is the easiest way to enable More Blocks when playing in singleplayer
|
||||||
|
(or on a server hosted from a client).
|
||||||
|
|
||||||
|
1. Start Minetest and switch to the **Local Game** tab.
|
||||||
|
2. Select the world you want to enable More Blocks in.
|
||||||
|
3. Click **Configure**, then enable `moreblocks` by double-clicking it
|
||||||
|
(or ticking the **Enabled** checkbox).
|
||||||
|
4. Save the changes, then start a game on the world you enabled More Blocks on.
|
||||||
|
5. More Blocks should now be running on your world.
|
||||||
|
|
||||||
|
#### Using a text editor
|
||||||
|
|
||||||
|
This is the recommended way to enable the mod on a server without using a GUI.
|
||||||
|
|
||||||
|
1. Make sure Minetest is not currently running (else, it will overwrite
|
||||||
|
the changes when exiting).
|
||||||
|
2. Open the world's `world.mt` file using a text editor.
|
||||||
|
3. Add the following line at the end of the file:
|
||||||
|
|
||||||
|
```
|
||||||
|
load_mod_moreblocks = true
|
||||||
|
```
|
||||||
|
|
||||||
|
If the line is already present in the file, then replace `false` with `true` on that line.
|
||||||
|
|
||||||
|
4. Save the file, then start a game on the world you enabled More Blocks on.
|
||||||
|
5. More Blocks should now be running on your world.
|
||||||
|
|
||||||
|
## Version compatibility
|
||||||
|
|
||||||
|
More Blocks is currently primarily tested with Minetest 0.4.16.
|
||||||
|
It may or may not work with newer or older versions. Issues arising in older
|
||||||
|
versions than 0.4.16 will generally not be fixed.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Copyright © 2011-2017 Hugo Locurcio and contributors
|
||||||
|
|
||||||
|
- More Blocks code is licensed under the zlib license, see
|
||||||
|
[`LICENSE.md`](LICENSE.md) for details.
|
||||||
|
- Unless otherwise specified, More Blocks textures are licensed under
|
||||||
|
[CC BY-SA 3.0 Unported](https://creativecommons.org/licenses/by-sa/3.0/).
|
||||||
|
|
||||||
|
`moreblocks_copperpatina.png` was created by pithydon, and is licensed under
|
||||||
|
[CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/).
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
--[[
|
--[[
|
||||||
More Blocks: circular saw
|
More Blocks: circular saw
|
||||||
|
|
||||||
Copyright (c) 2011-2017 Hugo Locurcio and contributors.
|
Copyright (c) 2011-2017 Hugo Locurcio, Sokomine and contributors.
|
||||||
Licensed under the zlib license. See LICENSE.md for more information.
|
Licensed under the zlib license. See LICENSE.md for more information.
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
@ -26,9 +26,9 @@ circular_saw.cost_in_microblocks = {
|
|||||||
1, 1, 1, 1, 1, 1, 1, 2,
|
1, 1, 1, 1, 1, 1, 1, 2,
|
||||||
2, 3, 2, 4, 2, 4, 5, 6,
|
2, 3, 2, 4, 2, 4, 5, 6,
|
||||||
7, 1, 1, 2, 4, 6, 7, 8,
|
7, 1, 1, 2, 4, 6, 7, 8,
|
||||||
3, 1, 1, 2, 4, 4, 2, 6,
|
1, 2, 2, 3, 1, 1, 2, 4,
|
||||||
7, 3, 7, 7, 4, 8, 3, 2,
|
4, 2, 6, 7, 3, 7, 7, 4,
|
||||||
6, 2, 1, 3, 4,
|
8, 3, 2, 6, 2, 1, 3, 4
|
||||||
}
|
}
|
||||||
|
|
||||||
circular_saw.names = {
|
circular_saw.names = {
|
||||||
@ -40,6 +40,7 @@ circular_saw.names = {
|
|||||||
{"panel", "_4"},
|
{"panel", "_4"},
|
||||||
{"micro", ""},
|
{"micro", ""},
|
||||||
{"panel", ""},
|
{"panel", ""},
|
||||||
|
|
||||||
{"micro", "_12"},
|
{"micro", "_12"},
|
||||||
{"panel", "_12"},
|
{"panel", "_12"},
|
||||||
{"micro", "_14"},
|
{"micro", "_14"},
|
||||||
@ -48,6 +49,7 @@ circular_saw.names = {
|
|||||||
{"panel", "_15"},
|
{"panel", "_15"},
|
||||||
{"stair", "_outer"},
|
{"stair", "_outer"},
|
||||||
{"stair", ""},
|
{"stair", ""},
|
||||||
|
|
||||||
{"stair", "_inner"},
|
{"stair", "_inner"},
|
||||||
{"slab", "_1"},
|
{"slab", "_1"},
|
||||||
{"slab", "_2"},
|
{"slab", "_2"},
|
||||||
@ -56,11 +58,16 @@ circular_saw.names = {
|
|||||||
{"slab", "_three_quarter"},
|
{"slab", "_three_quarter"},
|
||||||
{"slab", "_14"},
|
{"slab", "_14"},
|
||||||
{"slab", "_15"},
|
{"slab", "_15"},
|
||||||
|
|
||||||
|
{"slab", "_two_sides"},
|
||||||
|
{"slab", "_three_sides"},
|
||||||
|
{"slab", "_three_sides_u"},
|
||||||
{"stair", "_half"},
|
{"stair", "_half"},
|
||||||
{"stair", "_alt_1"},
|
{"stair", "_alt_1"},
|
||||||
{"stair", "_alt_2"},
|
{"stair", "_alt_2"},
|
||||||
{"stair", "_alt_4"},
|
{"stair", "_alt_4"},
|
||||||
{"stair", "_alt"},
|
{"stair", "_alt"},
|
||||||
|
|
||||||
{"slope", ""},
|
{"slope", ""},
|
||||||
{"slope", "_half"},
|
{"slope", "_half"},
|
||||||
{"slope", "_half_raised"},
|
{"slope", "_half_raised"},
|
||||||
@ -69,6 +76,7 @@ circular_saw.names = {
|
|||||||
{"slope", "_inner_half_raised"},
|
{"slope", "_inner_half_raised"},
|
||||||
{"slope", "_inner_cut"},
|
{"slope", "_inner_cut"},
|
||||||
{"slope", "_inner_cut_half"},
|
{"slope", "_inner_cut_half"},
|
||||||
|
|
||||||
{"slope", "_inner_cut_half_raised"},
|
{"slope", "_inner_cut_half_raised"},
|
||||||
{"slope", "_outer"},
|
{"slope", "_outer"},
|
||||||
{"slope", "_outer_half"},
|
{"slope", "_outer_half"},
|
||||||
|
@ -8,7 +8,7 @@ Licensed under the zlib license. See LICENSE.md for more information.
|
|||||||
moreblocks.config = {}
|
moreblocks.config = {}
|
||||||
|
|
||||||
local function getbool_default(setting, default)
|
local function getbool_default(setting, default)
|
||||||
local value = minetest.setting_getbool(setting)
|
local value = minetest.settings:get_bool(setting)
|
||||||
if value == nil then
|
if value == nil then
|
||||||
value = default
|
value = default
|
||||||
end
|
end
|
||||||
@ -21,7 +21,7 @@ local function setting(settingtype, name, default)
|
|||||||
getbool_default("moreblocks." .. name, default)
|
getbool_default("moreblocks." .. name, default)
|
||||||
else
|
else
|
||||||
moreblocks.config[name] =
|
moreblocks.config[name] =
|
||||||
minetest.setting_get("moreblocks." .. name) or default
|
minetest.settings:get("moreblocks." .. name) or default
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -454,7 +454,7 @@ minetest.register_craft({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
if minetest.setting_getbool("moreblocks.circular_saw_crafting") ~= false then -- “If nil or true then”
|
if minetest.settings:get_bool("moreblocks.circular_saw_crafting") ~= false then -- “If nil or true then”
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "moreblocks:circular_saw",
|
output = "moreblocks:circular_saw",
|
||||||
recipe = {
|
recipe = {
|
||||||
|
@ -1,2 +1,4 @@
|
|||||||
default
|
default
|
||||||
intllib?
|
intllib?
|
||||||
|
farming?
|
||||||
|
wool?
|
||||||
|
8
init.lua
8
init.lua
@ -11,8 +11,12 @@ Licensed under the zlib license. See LICENSE.md for more information.
|
|||||||
moreblocks = {}
|
moreblocks = {}
|
||||||
|
|
||||||
local S
|
local S
|
||||||
if minetest.get_modpath("intllib") then
|
if minetest.global_exists("intllib") then
|
||||||
|
if intllib.make_gettext_pair then
|
||||||
|
S = intllib.make_gettext_pair()
|
||||||
|
else
|
||||||
S = intllib.Getter()
|
S = intllib.Getter()
|
||||||
|
end
|
||||||
else
|
else
|
||||||
S = function(s) return s end
|
S = function(s) return s end
|
||||||
end
|
end
|
||||||
@ -28,6 +32,6 @@ dofile(modpath .. "/redefinitions.lua")
|
|||||||
dofile(modpath .. "/crafting.lua")
|
dofile(modpath .. "/crafting.lua")
|
||||||
dofile(modpath .. "/aliases.lua")
|
dofile(modpath .. "/aliases.lua")
|
||||||
|
|
||||||
if minetest.setting_getbool("log_mods") then
|
if minetest.settings:get_bool("log_mods") then
|
||||||
minetest.log("action", S("[moreblocks] loaded."))
|
minetest.log("action", S("[moreblocks] loaded."))
|
||||||
end
|
end
|
||||||
|
@ -12,8 +12,10 @@ local modpath = minetest.get_modpath("moreblocks").. "/stairsplus"
|
|||||||
stairsplus = {}
|
stairsplus = {}
|
||||||
stairsplus.expect_infinite_stacks = false
|
stairsplus.expect_infinite_stacks = false
|
||||||
|
|
||||||
|
stairsplus.shapes_list = {}
|
||||||
|
|
||||||
if not minetest.get_modpath("unified_inventory")
|
if not minetest.get_modpath("unified_inventory")
|
||||||
and minetest.setting_getbool("creative_mode") then
|
and minetest.settings:get_bool("creative_mode") then
|
||||||
stairsplus.expect_infinite_stacks = true
|
stairsplus.expect_infinite_stacks = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -65,6 +65,10 @@ local microblocks_defs = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for k,v in pairs(microblocks_defs) do
|
||||||
|
table.insert(stairsplus.shapes_list, { "micro_", k })
|
||||||
|
end
|
||||||
|
|
||||||
function stairsplus:register_micro_alias(modname_old, subname_old, modname_new, subname_new)
|
function stairsplus:register_micro_alias(modname_old, subname_old, modname_new, subname_new)
|
||||||
local defs = stairsplus.copytable(microblocks_defs)
|
local defs = stairsplus.copytable(microblocks_defs)
|
||||||
for alternate, def in pairs(defs) do
|
for alternate, def in pairs(defs) do
|
||||||
|
@ -65,6 +65,10 @@ local panels_defs = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for k,v in pairs(panels_defs) do
|
||||||
|
table.insert(stairsplus.shapes_list, { "panel_", k })
|
||||||
|
end
|
||||||
|
|
||||||
function stairsplus:register_panel_alias(modname_old, subname_old, modname_new, subname_new)
|
function stairsplus:register_panel_alias(modname_old, subname_old, modname_new, subname_new)
|
||||||
local defs = stairsplus.copytable(panels_defs)
|
local defs = stairsplus.copytable(panels_defs)
|
||||||
for alternate, def in pairs(defs) do
|
for alternate, def in pairs(defs) do
|
||||||
|
@ -7,6 +7,7 @@ Licensed under the zlib license. See LICENSE.md for more information.
|
|||||||
|
|
||||||
local default_nodes = { -- Default stairs/slabs/panels/microblocks:
|
local default_nodes = { -- Default stairs/slabs/panels/microblocks:
|
||||||
"stone",
|
"stone",
|
||||||
|
"stone_block",
|
||||||
"cobble",
|
"cobble",
|
||||||
"mossycobble",
|
"mossycobble",
|
||||||
"brick",
|
"brick",
|
||||||
@ -16,7 +17,9 @@ local default_nodes = { -- Default stairs/slabs/panels/microblocks:
|
|||||||
"copperblock",
|
"copperblock",
|
||||||
"bronzeblock",
|
"bronzeblock",
|
||||||
"diamondblock",
|
"diamondblock",
|
||||||
|
"tinblock",
|
||||||
"desert_stone",
|
"desert_stone",
|
||||||
|
"desert_stone_block",
|
||||||
"desert_cobble",
|
"desert_cobble",
|
||||||
"meselamp",
|
"meselamp",
|
||||||
"glass",
|
"glass",
|
||||||
@ -31,20 +34,35 @@ local default_nodes = { -- Default stairs/slabs/panels/microblocks:
|
|||||||
"aspen_tree",
|
"aspen_tree",
|
||||||
"aspen_wood",
|
"aspen_wood",
|
||||||
"obsidian",
|
"obsidian",
|
||||||
|
"obsidian_block",
|
||||||
|
"obsidianbrick",
|
||||||
"obsidian_glass",
|
"obsidian_glass",
|
||||||
"stonebrick",
|
"stonebrick",
|
||||||
"desert_stonebrick",
|
"desert_stonebrick",
|
||||||
"sandstonebrick",
|
"sandstonebrick",
|
||||||
"obsidianbrick",
|
"silver_sandstone",
|
||||||
|
"silver_sandstone_brick",
|
||||||
|
"silver_sandstone_block",
|
||||||
|
"desert_sandstone",
|
||||||
|
"desert_sandstone_brick",
|
||||||
|
"desert_sandstone_block",
|
||||||
|
"sandstone_block",
|
||||||
|
"coral_skeleton",
|
||||||
|
"farming:straw"
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, name in pairs(default_nodes) do
|
for _, name in pairs(default_nodes) do
|
||||||
local nodename = "default:"..name
|
local nodename = "default:"..name
|
||||||
|
local a,b = string.find(name, ":")
|
||||||
|
if b then
|
||||||
|
nodename = name
|
||||||
|
name = string.sub(name, b+1)
|
||||||
|
end
|
||||||
local ndef = minetest.registered_nodes[nodename]
|
local ndef = minetest.registered_nodes[nodename]
|
||||||
if ndef then
|
if ndef then
|
||||||
local drop
|
local drop
|
||||||
if type(ndef.drop) == "string" then
|
if type(ndef.drop) == "string" then
|
||||||
drop = ndef.drop:sub(9)
|
drop = ndef.drop:sub((b or 8)+1)
|
||||||
end
|
end
|
||||||
|
|
||||||
local tiles = ndef.tiles
|
local tiles = ndef.tiles
|
||||||
@ -63,3 +81,40 @@ for _, name in pairs(default_nodes) do
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- wool registrations
|
||||||
|
|
||||||
|
if minetest.get_modpath("wool") then
|
||||||
|
|
||||||
|
local colorlist = {
|
||||||
|
{"white", "White Wool"},
|
||||||
|
{"grey", "Grey Wool"},
|
||||||
|
{"black", "Black Wool"},
|
||||||
|
{"red", "Red Wool"},
|
||||||
|
{"yellow", "Yellow Wool"},
|
||||||
|
{"green", "Green Wool"},
|
||||||
|
{"cyan", "Cyan Wool"},
|
||||||
|
{"blue", "Blue Wool"},
|
||||||
|
{"magenta", "Magenta Wool"},
|
||||||
|
{"orange", "Orange Wool"},
|
||||||
|
{"violet", "Violet Wool"},
|
||||||
|
{"brown", "Brown Wool"},
|
||||||
|
{"pink", "Pink Wool"},
|
||||||
|
{"dark_grey", "Dark Grey Wool"},
|
||||||
|
{"dark_green", "Dark Green Wool"},
|
||||||
|
}
|
||||||
|
|
||||||
|
for i in ipairs(colorlist) do
|
||||||
|
local color = colorlist[i][1]
|
||||||
|
local colordesc = colorlist[i][2]
|
||||||
|
|
||||||
|
stairsplus:register_all("wool", color, "wool:"..color, {
|
||||||
|
description = colordesc,
|
||||||
|
tiles = {"wool_"..color..".png"},
|
||||||
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,
|
||||||
|
flammable=3,wool=1,not_in_creative_inventory=1},
|
||||||
|
sounds = default.node_sound_defaults(),
|
||||||
|
sunlight_propagates = true,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@ -28,7 +28,25 @@ local slabs_defs = {
|
|||||||
["_2"] = 2,
|
["_2"] = 2,
|
||||||
["_14"] = 14,
|
["_14"] = 14,
|
||||||
["_15"] = 15,
|
["_15"] = 15,
|
||||||
|
["_two_sides"] = {
|
||||||
|
{ -0.5, -0.5, -0.5, 0.5, -7/16, 7/16 },
|
||||||
|
{ -0.5, -0.5, 7/16, 0.5, 0.5, 0.5 }
|
||||||
|
},
|
||||||
|
["_three_sides"] = {
|
||||||
|
{ -7/16, -0.5, -0.5, 0.5, -7/16, 7/16 },
|
||||||
|
{ -7/16, -0.5, 7/16, 0.5, 0.5, 0.5 },
|
||||||
|
{ -0.5, -0.5, -0.5, -7/16, 0.5, 0.5 }
|
||||||
|
},
|
||||||
|
["_three_sides_u"] = {
|
||||||
|
{ -0.5, -0.5, -0.5, 0.5, 0.5, -7/16 },
|
||||||
|
{ -0.5, -0.5, -7/16, 0.5, -7/16, 7/16 },
|
||||||
|
{ -0.5, -0.5, 7/16, 0.5, 0.5, 0.5 }
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for k,v in pairs(slabs_defs) do
|
||||||
|
table.insert(stairsplus.shapes_list, { "slab_", k })
|
||||||
|
end
|
||||||
|
|
||||||
function stairsplus:register_slab_alias(modname_old, subname_old, modname_new, subname_new)
|
function stairsplus:register_slab_alias(modname_old, subname_old, modname_new, subname_new)
|
||||||
local defs = stairsplus.copytable(slabs_defs)
|
local defs = stairsplus.copytable(slabs_defs)
|
||||||
@ -47,21 +65,36 @@ end
|
|||||||
function stairsplus:register_slab(modname, subname, recipeitem, fields)
|
function stairsplus:register_slab(modname, subname, recipeitem, fields)
|
||||||
local defs = stairsplus.copytable(slabs_defs)
|
local defs = stairsplus.copytable(slabs_defs)
|
||||||
local desc_base = S("%s Slab"):format(fields.description)
|
local desc_base = S("%s Slab"):format(fields.description)
|
||||||
for alternate, num in pairs(defs) do
|
for alternate, shape in pairs(defs) do
|
||||||
local def = {
|
|
||||||
|
local def = {}
|
||||||
|
|
||||||
|
if type(shape) ~= "table" then
|
||||||
|
def = {
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-0.5, -0.5, -0.5, 0.5, (num/16)-0.5, 0.5},
|
fixed = {-0.5, -0.5, -0.5, 0.5, (shape/16)-0.5, 0.5},
|
||||||
|
},
|
||||||
|
description = ("%s (%d/16)"):format(desc_base, shape)
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
def = {
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = shape,
|
||||||
|
},
|
||||||
|
description = desc_base
|
||||||
}
|
}
|
||||||
|
end
|
||||||
|
|
||||||
for k, v in pairs(fields) do
|
for k, v in pairs(fields) do
|
||||||
def[k] = v
|
def[k] = v
|
||||||
end
|
end
|
||||||
|
|
||||||
def.drawtype = "nodebox"
|
def.drawtype = "nodebox"
|
||||||
def.paramtype = "light"
|
def.paramtype = "light"
|
||||||
def.paramtype2 = def.paramtype2 or "facedir"
|
def.paramtype2 = def.paramtype2 or "facedir"
|
||||||
def.on_place = minetest.rotate_node
|
def.on_place = minetest.rotate_node
|
||||||
def.description = ("%s (%d/16)"):format(desc_base, num)
|
|
||||||
def.groups = stairsplus:prepare_groups(fields.groups)
|
def.groups = stairsplus:prepare_groups(fields.groups)
|
||||||
if fields.drop and not (type(fields.drop) == "table") then
|
if fields.drop and not (type(fields.drop) == "table") then
|
||||||
def.drop = modname.. ":slab_" .. fields.drop .. alternate
|
def.drop = modname.. ":slab_" .. fields.drop .. alternate
|
||||||
|
@ -219,6 +219,10 @@ local slopes_defs = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for k,v in pairs(slopes_defs) do
|
||||||
|
table.insert(stairsplus.shapes_list, { "slope_", k })
|
||||||
|
end
|
||||||
|
|
||||||
function stairsplus:register_slope_alias(modname_old, subname_old, modname_new, subname_new)
|
function stairsplus:register_slope_alias(modname_old, subname_old, modname_new, subname_new)
|
||||||
local defs = stairsplus.copytable(slopes_defs)
|
local defs = stairsplus.copytable(slopes_defs)
|
||||||
for alternate, def in pairs(defs) do
|
for alternate, def in pairs(defs) do
|
||||||
|
@ -105,6 +105,10 @@ local stairs_defs = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for k,v in pairs(stairs_defs) do
|
||||||
|
table.insert(stairsplus.shapes_list, { "stair_", k })
|
||||||
|
end
|
||||||
|
|
||||||
function stairsplus:register_stair_alias(modname_old, subname_old, modname_new, subname_new)
|
function stairsplus:register_stair_alias(modname_old, subname_old, modname_new, subname_new)
|
||||||
local defs = stairsplus.copytable(stairs_defs)
|
local defs = stairsplus.copytable(stairs_defs)
|
||||||
for alternate, def in pairs(defs) do
|
for alternate, def in pairs(defs) do
|
||||||
|
Reference in New Issue
Block a user