2017-03-11 23:12:31 +03:00
local railuse = " Place them on the ground to build your railway, the rails will automatically connect to each other and will turn into curves, T-junctions, crossings and slopes as needed. "
2017-02-16 22:15:43 +03:00
-- Normal rail
minetest.register_node ( " mcl_minecarts:rail " , {
description = " Rail " ,
2017-03-11 23:12:31 +03:00
_doc_items_longdesc = " Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction. " ,
_doc_items_usagehelp = railuse ,
2017-02-16 22:15:43 +03:00
drawtype = " raillike " ,
tiles = { " default_rail.png " , " default_rail_curved.png " , " default_rail_t_junction.png " , " default_rail_crossing.png " } ,
is_ground_content = false ,
inventory_image = " default_rail.png " ,
wield_image = " default_rail.png " ,
paramtype = " light " ,
walkable = false ,
selection_box = {
type = " fixed " ,
-- 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 } ,
} ,
stack_max = 64 ,
2017-05-20 05:11:14 +03:00
groups = { handy = 1 , pickaxey = 1 , attached_node = 1 , rail = 1 , connect_to_raillike = 1 , dig_by_water = 1 , destroy_by_lava_flow = 1 , transport = 1 } ,
2017-06-06 22:10:24 +03:00
sounds = mcl_sounds.node_sound_metal_defaults ( ) ,
2017-02-22 18:03:59 +03:00
_mcl_blast_resistance = 3.5 ,
2017-02-27 03:33:34 +03:00
_mcl_hardness = 0.7 ,
2017-02-16 22:15:43 +03:00
} )
minetest.register_craft ( {
output = ' mcl_minecarts:rail 16 ' ,
recipe = {
{ ' mcl_core:iron_ingot ' , ' ' , ' mcl_core:iron_ingot ' } ,
{ ' mcl_core:iron_ingot ' , ' mcl_core:stick ' , ' mcl_core:iron_ingot ' } ,
{ ' mcl_core:iron_ingot ' , ' ' , ' mcl_core:iron_ingot ' } ,
}
} )
2017-01-05 17:23:14 +03:00
2017-02-16 22:15:43 +03:00
-- Rail to speed up
2017-01-05 17:23:14 +03:00
minetest.register_node ( " mcl_minecarts:golden_rail " , {
description = " Powered Rail " ,
2017-03-11 23:12:31 +03:00
_doc_items_longdesc = " Rails can be used to build transport tracks for minecarts. Powered rails will accelerate moving minecarts, up to a maximum speed. " ,
_doc_items_usagehelp = railuse ,
2017-01-05 17:23:14 +03:00
drawtype = " raillike " ,
tiles = { " carts_rail_pwr.png " , " carts_rail_curved_pwr.png " , " carts_rail_t_junction_pwr.png " , " carts_rail_crossing_pwr.png " } ,
inventory_image = " carts_rail_pwr.png " ,
wield_image = " carts_rail_pwr.png " ,
paramtype = " light " ,
2017-03-11 18:36:05 +03:00
is_ground_content = false ,
2017-01-05 17:23:14 +03:00
walkable = false ,
selection_box = {
type = " fixed " ,
-- 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 } ,
} ,
2017-05-20 05:11:14 +03:00
groups = { handy = 1 , pickaxey = 1 , attached_node = 1 , rail = 1 , connect_to_raillike = 1 , dig_by_water = 1 , destroy_by_lava_flow = 1 , transport = 1 } ,
2017-01-05 17:23:14 +03:00
after_place_node = function ( pos , placer , itemstack )
if not mesecon then
minetest.get_meta ( pos ) : set_string ( " cart_acceleration " , " 0.5 " )
end
end ,
2017-06-06 22:10:24 +03:00
sounds = mcl_sounds.node_sound_metal_defaults ( ) ,
2017-01-05 17:23:14 +03:00
mesecons = {
effector = {
action_on = function ( pos , node )
mcl_minecarts : boost_rail ( pos , 0.5 )
end ,
action_off = function ( pos , node )
minetest.get_meta ( pos ) : set_string ( " cart_acceleration " , " 0 " )
end ,
} ,
} ,
2017-02-22 18:03:59 +03:00
_mcl_blast_resistance = 3.5 ,
2017-02-27 03:33:34 +03:00
_mcl_hardness = 0.7 ,
2017-01-05 17:23:14 +03:00
} )
minetest.register_craft ( {
output = " mcl_minecarts:golden_rail 6 " ,
recipe = {
2017-02-01 01:32:56 +03:00
{ " mcl_core:gold_ingot " , " " , " mcl_core:gold_ingot " } ,
{ " mcl_core:gold_ingot " , " mcl_core:stick " , " mcl_core:gold_ingot " } ,
{ " mcl_core:gold_ingot " , " mesecons:redstone " , " mcl_core:gold_ingot " } ,
2017-01-05 17:23:14 +03:00
}
} )