Permalink
Browse files

Stairs: Add field to determine world-aligned textures (#2219)

All stair/slab nodes with parent nodes that are rotatable (wood and bricks)
are reverted to not having world-aligned textures, to fix the breakage of
rotated stair/slab appearence in worlds.

Update, and add missing documentation to, game_api.txt.
  • Loading branch information...
paramat committed Oct 3, 2018
1 parent 24900f7 commit 5b3b60927000706f3613423d30e2ed108e2c38fd
Showing with 144 additions and 68 deletions.
  1. +40 −16 game_api.txt
  2. +2 −1 mods/farming/nodes.lua
  3. +102 −51 mods/stairs/init.lua
@@ -672,31 +672,55 @@ Stairs API
The stairs API lets you register stairs and slabs and ensures that they are registered the same way as those
delivered with Minetest Game, to keep them compatible with other mods.

`stairs.register_stair(subname, recipeitem, groups, images, description, sounds)`
`stairs.register_stair(subname, recipeitem, groups, images, description, sounds, worldaligntex)`

* Registers a stair.
* Registers a stair
* `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_subname"
* `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil`
* `groups`: see [Known damage and digging time defining groups]
* `images`: see [Tile definition]
* `description`: used for the description field in the stair's definition
* `sounds`: see [#Default sounds]
* `groups`: See [Known damage and digging time defining groups]
* `images`: See [Tile definition]
* `description`: Used for the description field in the stair's definition
* `sounds`: See [#Default sounds]
* `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition]

`stairs.register_slab(subname, recipeitem, groups, images, description, sounds)`
`stairs.register_slab(subname, recipeitem, groups, images, description, sounds, worldaligntex)`

* Registers a slabs
* `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_subname"
* Registers a slab
* `subname`: Basically the material name (e.g. cobble) used for the slab name. Nodename pattern: "stairs:slab_subname"
* `recipeitem`: Item used in the craft recipe, e.g. "default:cobble"
* `groups`: see [Known damage and digging time defining groups]
* `images`: see [Tile definition]
* `description`: used for the description field in the stair's definition
* `sounds`: see [#Default sounds]
* `groups`: See [Known damage and digging time defining groups]
* `images`: See [Tile definition]
* `description`: Used for the description field in the slab's definition
* `sounds`: See [#Default sounds]
* `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition]

`stairs.register_stair_inner(subname, recipeitem, groups, images, description, sounds, worldaligntex)`

* Registers an inner corner stair
* `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_inner_subname"
* `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil`
* `groups`: See [Known damage and digging time defining groups]
* `images`: See [Tile definition]
* `description`: Used for the description field in the stair's definition
* `sounds`: See [#Default sounds]
* `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition]

`stairs.register_stair_outer(subname, recipeitem, groups, images, description, sounds, worldaligntex)`

* Registers an outer corner stair
* `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_outer_subname"
* `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil`
* `groups`: See [Known damage and digging time defining groups]
* `images`: See [Tile definition]
* `description`: Used for the description field in the stair's definition
* `sounds`: See [#Default sounds]
* `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition]

`stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds)`
`stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds, worldaligntex)`

* A wrapper for stairs.register_stair and stairs.register_slab
* A wrapper for stairs.register_stair, stairs.register_slab, stairs.register_stair_inner, stairs.register_stair_outer
* Uses almost the same arguments as stairs.register_stair
* `desc_stair`: Description for stair node
* `desc_stair`: Description for stair nodes. For corner stairs 'Inner' or 'Outer' will be prefixed
* `desc_slab`: Description for slab node


@@ -113,7 +113,8 @@ stairs.register_stair_and_slab(
{"farming_straw.png"},
"Straw Stair",
"Straw Slab",
default.node_sound_leaves_defaults()
default.node_sound_leaves_defaults(),
true
)

minetest.register_abm({
Oops, something went wrong.

0 comments on commit 5b3b609

Please sign in to comment.