mirror of
https://github.com/minetest/minetest_game.git
synced 2024-11-18 07:40:22 +01:00
9bbe7f99da
This is partly a workaround for a bug. Climbs with continuous power rails were failing often due to unexplained losses of speed leading to a reversal of direction. The lack of acceleration on climbs meant that lost speed was not regained. Keeping cart speed at maximum on climbs helps reduce the chance of reversals. This also allows players to slowly accelerate up to full speed on a climb without needing a horizontal run-up to reach full speed first. It may not be possible to build the horizontal sections needed, or, if players are replacing a previous carts mod their track constructions, bridges, tunnels etc. will often not have the horizontal sections needed. Players will also sometimes need to place and enter a cart on a slope and be able to climb.
60 lines
1.7 KiB
Lua
60 lines
1.7 KiB
Lua
carts:register_rail("carts:rail", {
|
|
description = "Rail",
|
|
tiles = {
|
|
"carts_rail_straight.png", "carts_rail_curved.png",
|
|
"carts_rail_t_junction.png", "carts_rail_crossing.png"
|
|
},
|
|
inventory_image = "carts_rail_straight.png",
|
|
wield_image = "carts_rail_straight.png",
|
|
groups = carts:get_rail_groups(),
|
|
}, {})
|
|
|
|
minetest.register_craft({
|
|
output = "carts:rail 16",
|
|
recipe = {
|
|
{"default:steel_ingot", "", "default:steel_ingot"},
|
|
{"default:steel_ingot", "group:stick", "default:steel_ingot"},
|
|
{"default:steel_ingot", "", "default:steel_ingot"},
|
|
}
|
|
})
|
|
|
|
minetest.register_alias("default:rail", "carts:rail")
|
|
|
|
|
|
carts:register_rail("carts:powerrail", {
|
|
description = "Powered rail",
|
|
tiles = {
|
|
"carts_rail_straight_pwr.png", "carts_rail_curved_pwr.png",
|
|
"carts_rail_t_junction_pwr.png", "carts_rail_crossing_pwr.png"
|
|
},
|
|
groups = carts:get_rail_groups(),
|
|
}, {acceleration = 5})
|
|
|
|
minetest.register_craft({
|
|
output = "carts:powerrail 8",
|
|
recipe = {
|
|
{"default:steel_ingot", "default:mese_crystal_fragment", "default:steel_ingot"},
|
|
{"default:steel_ingot", "group:stick", "default:steel_ingot"},
|
|
{"default:steel_ingot", "default:mese_crystal_fragment", "default:steel_ingot"},
|
|
}
|
|
})
|
|
|
|
|
|
carts:register_rail("carts:brakerail", {
|
|
description = "Brake rail",
|
|
tiles = {
|
|
"carts_rail_straight_brk.png", "carts_rail_curved_brk.png",
|
|
"carts_rail_t_junction_brk.png", "carts_rail_crossing_brk.png"
|
|
},
|
|
groups = carts:get_rail_groups(),
|
|
}, {acceleration = -3})
|
|
|
|
minetest.register_craft({
|
|
output = "carts:brakerail 8",
|
|
recipe = {
|
|
{"default:steel_ingot", "default:coal_lump", "default:steel_ingot"},
|
|
{"default:steel_ingot", "group:stick", "default:steel_ingot"},
|
|
{"default:steel_ingot", "default:coal_lump", "default:steel_ingot"},
|
|
}
|
|
})
|