1 local raillike_group
= minetest
.raillike_group("rail")
3 local S
= minetest
.get_translator("boost_cart")
5 minetest
.register_node(":carts:rail", {
6 description
= S("Steel Rail"),
7 _tt_help
= S("Track for cart"),
9 tiles
= {"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"},
10 inventory_image
= "default_rail.png",
11 wield_image
= "default_rail.png",
13 sunlight_propagates
= true,
14 is_ground_content
= true,
19 fixed
= {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
21 groups
= {dig_immediate
= 2, attached_node
= 1, rail
= 1, connect_to_raillike
= raillike_group
},
22 sounds
= hades_sounds
.node_sound_metal_defaults(),
25 minetest
.register_craft({
26 output
= 'carts:rail 18',
28 {'hades_core:steel_ingot', '', 'hades_core:steel_ingot'},
29 {'hades_core:steel_ingot', 'group:stick', 'hades_core:steel_ingot'},
30 {'hades_core:steel_ingot', '', 'hades_core:steel_ingot'},
35 minetest
.register_node(":carts:copperrail", {
36 description
= S("Bronze Rail"),
37 _tt_help
= S("Track for cart"),
38 drawtype
= "raillike",
39 tiles
= {"carts_rail_cp.png", "carts_rail_curved_cp.png", "carts_rail_t_junction_cp.png", "carts_rail_crossing_cp.png"},
40 inventory_image
= "carts_rail_cp.png",
41 wield_image
= "carts_rail_cp.png",
43 is_ground_content
= true,
48 -- but how to specify the dimensions for curved and sideways rails?
49 fixed
= {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
51 groups
= {dig_immediate
= 2, attached_node
= 1, rail
= 1, connect_to_raillike
= raillike_group
},
52 sounds
= hades_sounds
.node_sound_metal_defaults(),
55 minetest
.register_craft({
56 output
= "carts:copperrail 12",
58 {"hades_core:bronze_ingot", "group:stick", "hades_core:bronze_ingot"},
59 {"hades_core:bronze_ingot", "group:stick", "hades_core:bronze_ingot"},
60 {"hades_core:bronze_ingot", "group:stick", "hades_core:bronze_ingot"},
66 minetest
.register_node(":carts:powerrail", {
67 description
= S("Powered Rail"),
68 _tt_help
= S("Track for cart, accelerates"),
69 drawtype
= "raillike",
70 tiles
= {"carts_rail_pwr.png", "carts_rail_curved_pwr.png", "carts_rail_t_junction_pwr.png", "carts_rail_crossing_pwr.png"},
71 inventory_image
= "carts_rail_pwr.png",
72 wield_image
= "carts_rail_pwr.png",
74 is_ground_content
= true,
79 -- but how to specify the dimensions for curved and sideways rails?
80 fixed
= {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
82 groups
= {dig_immediate
= 2, attached_node
= 1, rail
= 1, connect_to_raillike
= raillike_group
},
84 after_place_node
= function(pos
, placer
, itemstack
)
86 minetest
.get_meta(pos
):set_string("cart_acceleration", "0.5")
92 action_on
= function(pos
, node
)
93 minetest
.get_meta(pos
):set_string("cart_acceleration", "0.5")
96 action_off
= function(pos
, node
)
97 minetest
.get_meta(pos
):set_string("cart_acceleration", "0")
101 sounds
= hades_sounds
.node_sound_metal_defaults(),
104 minetest
.register_craft({
105 output
= "carts:powerrail 6",
107 {"hades_core:steel_ingot", "hades_core:mese_crystal_fragment", "hades_core:steel_ingot"},
108 {"hades_core:steel_ingot", "group:stick", "hades_core:steel_ingot"},
109 {"hades_core:steel_ingot", "hades_core:mese_crystal_fragment", "hades_core:steel_ingot"},
113 minetest
.register_node(":carts:brakerail", {
114 description
= S("Brake Rail"),
115 _tt_help
= S("Track for cart, slows down"),
116 drawtype
= "raillike",
117 tiles
= {"carts_rail_brk.png", "carts_rail_curved_brk.png", "carts_rail_t_junction_brk.png", "carts_rail_crossing_brk.png"},
118 inventory_image
= "carts_rail_brk.png",
119 wield_image
= "carts_rail_brk.png",
121 is_ground_content
= true,
126 -- but how to specify the dimensions for curved and sideways rails?
127 fixed
= {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
129 groups
= {dig_immediate
= 2, attached_node
= 1, rail
= 1, connect_to_raillike
= raillike_group
},
131 after_place_node
= function(pos
, placer
, itemstack
)
133 minetest
.get_meta(pos
):set_string("cart_acceleration", "-0.2")
139 action_on
= function(pos
, node
)
140 minetest
.get_meta(pos
):set_string("cart_acceleration", "-0.2")
143 action_off
= function(pos
, node
)
144 minetest
.get_meta(pos
):set_string("cart_acceleration", "0")
148 sounds
= hades_sounds
.node_sound_metal_defaults(),
151 minetest
.register_craft({
152 output
= "carts:brakerail 6",
154 {"hades_core:steel_ingot", "hades_core:coal_lump", "hades_core:steel_ingot"},
155 {"hades_core:steel_ingot", "group:stick", "hades_core:steel_ingot"},
156 {"hades_core:steel_ingot", "hades_core:coal_lump", "hades_core:steel_ingot"},