mirror of
https://github.com/minetest-mods/moreores.git
synced 2024-12-28 19:20:20 +01:00
Use carts
mod functions to register copper rails
This makes them behave similarly to default rails.
This commit is contained in:
parent
564cb11ba6
commit
d0a1798b0b
@ -14,6 +14,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- The minimum supported Minetest version is now 5.0.0.
|
- The minimum supported Minetest version is now 5.0.0.
|
||||||
|
- Copper rails are now registered using functions from the `carts` mod,
|
||||||
|
making them interoperate seamlessly with default rails.
|
||||||
|
- Copper rails can no longer be placed in the air.
|
||||||
|
|
||||||
## [1.1.0] - 2019-03-23
|
## [1.1.0] - 2019-03-23
|
||||||
|
|
||||||
|
35
init.lua
35
init.lua
@ -329,9 +329,9 @@ else
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Copper rail (unique node)
|
-- Copper rail (unique node)
|
||||||
minetest.register_node("moreores:copper_rail", {
|
if minetest.get_modpath("carts") then
|
||||||
|
carts:register_rail("moreores:copper_rail", {
|
||||||
description = S("Copper Rail"),
|
description = S("Copper Rail"),
|
||||||
drawtype = "raillike",
|
|
||||||
tiles = {
|
tiles = {
|
||||||
"moreores_copper_rail.png",
|
"moreores_copper_rail.png",
|
||||||
"moreores_copper_rail_curved.png",
|
"moreores_copper_rail_curved.png",
|
||||||
@ -340,34 +340,9 @@ minetest.register_node("moreores:copper_rail", {
|
|||||||
},
|
},
|
||||||
inventory_image = "moreores_copper_rail.png",
|
inventory_image = "moreores_copper_rail.png",
|
||||||
wield_image = "moreores_copper_rail.png",
|
wield_image = "moreores_copper_rail.png",
|
||||||
paramtype = "light",
|
groups = carts:get_rail_groups(),
|
||||||
sunlight_propagates = true,
|
}, {})
|
||||||
walkable = false,
|
end
|
||||||
selection_box = {
|
|
||||||
type = "fixed",
|
|
||||||
fixed = {
|
|
||||||
-1/2,
|
|
||||||
-1/2,
|
|
||||||
-1/2,
|
|
||||||
1/2,
|
|
||||||
-1/2 + 1/16,
|
|
||||||
1/2,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
sounds = default_metal_sounds,
|
|
||||||
groups = {bendy = 2, snappy = 1, dig_immediate = 2, rail = 1, connect_to_raillike = 1},
|
|
||||||
mesecons = {
|
|
||||||
effector = {
|
|
||||||
action_on = function(pos, node)
|
|
||||||
minetest.get_meta(pos):set_string("cart_acceleration", "0.5")
|
|
||||||
end,
|
|
||||||
|
|
||||||
action_off = function(pos, node)
|
|
||||||
minetest.get_meta(pos):set_string("cart_acceleration", "0")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "moreores:copper_rail 24",
|
output = "moreores:copper_rail 24",
|
||||||
|
Loading…
Reference in New Issue
Block a user