From 852b3379166c0b290d558a60be30045d0229d39c Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 6 Mar 2015 07:50:27 +0100 Subject: [PATCH] Use connect_to_raillike for rail Used value: 2 --- game_api.txt | 16 ++++++++++++++++ mods/default/nodes.lua | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/game_api.txt b/game_api.txt index 99c34a78..fa9d6fc5 100644 --- a/game_api.txt +++ b/game_api.txt @@ -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()` 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. diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index ac7414b1..1980fa8e 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -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")}, }) -- 2.25.1