mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-06-01 11:30:03 -04:00
Use builtin function for raillike group
This commit is contained in:
parent
e399aaafc9
commit
532e585e92
3 changed files with 6 additions and 14 deletions
14
game_api.txt
14
game_api.txt
|
@ -160,20 +160,16 @@ xpanes.register_pane(subname, def)
|
||||||
Raillike definitions
|
Raillike definitions
|
||||||
--------------------
|
--------------------
|
||||||
The following nodes use the group `connect_to_raillike` and will only connect to
|
The following nodes use the group `connect_to_raillike` and will only connect to
|
||||||
raillike nodes within this group and the same group value:
|
raillike nodes within this group and the same group value.
|
||||||
|
Use `minetest.raillike_group(<Name>)` to get the group value.
|
||||||
|
|
||||||
| Node type | Group value
|
| Node type | Raillike group name
|
||||||
+-----------------------+----------------------------------
|
+-----------------------+----------------------------------
|
||||||
| default:rail | default.connect_to_raillike.rails
|
| default:rail | "rail"
|
||||||
|
|
||||||
This is an overview of currently used groups:
|
|
||||||
| Group value | Description
|
|
||||||
+---------------------------------------+------------
|
|
||||||
| default.connect_to_raillike.rails | Rails
|
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
If you want to add a new rail type and want it to connect with default:rail,
|
If you want to add a new rail type and want it to connect with default:rail,
|
||||||
add `connect_to_raillike=default.connect_to_raillike.rails` into the `groups` table
|
add `connect_to_raillike=minetest.raillike_group("rail")` into the `groups` table
|
||||||
of your node.
|
of your node.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,10 +13,6 @@ default.gui_bg = "bgcolor[#080808BB;true]"
|
||||||
default.gui_bg_img = "background[5,5;1,1;gui_formbg.png;true]"
|
default.gui_bg_img = "background[5,5;1,1;gui_formbg.png;true]"
|
||||||
default.gui_slots = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]"
|
default.gui_slots = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]"
|
||||||
|
|
||||||
-- connect_to_raillike group values
|
|
||||||
default.connect_to_raillike = {}
|
|
||||||
default.connect_to_raillike.rails = 2
|
|
||||||
|
|
||||||
function default.get_hotbar_bg(x,y)
|
function default.get_hotbar_bg(x,y)
|
||||||
local out = ""
|
local out = ""
|
||||||
for i=0,7,1 do
|
for i=0,7,1 do
|
||||||
|
|
|
@ -1433,7 +1433,7 @@ minetest.register_node("default:rail", {
|
||||||
-- but how to specify the dimensions for curved and sideways rails?
|
-- 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},
|
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
|
||||||
},
|
},
|
||||||
groups = {bendy=2,dig_immediate=2,attached_node=1,connect_to_raillike=default.connect_to_raillike.rails},
|
groups = {bendy=2,dig_immediate=2,attached_node=1,connect_to_raillike=minetest.raillike_group("rail")},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue