Use connect_to_raillike for rail
authorWuzzy <almikes@aol.com>
Fri, 6 Mar 2015 06:50:27 +0000 (07:50 +0100)
committerNovatux <nathanael.courant@laposte.net>
Thu, 14 May 2015 08:19:07 +0000 (10:19 +0200)
Used value: 2

game_api.txt
mods/default/nodes.lua

index 99c34a78dd200f0e4cf1ba320ee22f258a48853b..fa9d6fc560009a6dc3a4d044746d67d4fe44a924 100644 (file)
@@ -194,6 +194,22 @@ xpanes.register_pane(subname, def)
        ^ Recipe field only
 }
 
+Raillike definitions
+--------------------
+The following nodes use the group `connect_to_raillike` and will only connect to
+raillike nodes within this group and the same group value.
+Use `minetest.raillike_group(<Name>)` to get the group value.
+
+| Node type            | Raillike group name
++-----------------------+----------------------------------
+| default:rail         | "rail"
+
+Example:
+If you want to add a new rail type and want it to connect with default:rail,
+add `connect_to_raillike=minetest.raillike_group("rail")` into the `groups` table
+of your node.
+
+
 Default sounds
 --------------
 Sounds inside the default table can be used within the sounds field of node definitions.
index ac7414b1212350b191bdae133fcb3b980869b597..1980fa8e36809db5aa5b9d866225ee9828c65610 100644 (file)
@@ -1541,7 +1541,7 @@ minetest.register_node("default:rail", {
                 -- but how to specify the dimensions for curved and sideways rails?
                 fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
        },
-       groups = {bendy=2,dig_immediate=2,attached_node=1},
+       groups = {bendy=2,dig_immediate=2,attached_node=1,connect_to_raillike=minetest.raillike_group("rail")},
 })