nodes_mining.lua 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. ---------------------------------------------------------------------------------------
  2. -- a rope that is of use to the mines
  3. ---------------------------------------------------------------------------------------
  4. -- the rope can only be digged if there is no further rope above it;
  5. -- Note: This rope also counts as a rail node; thus, carts can move through it
  6. minetest.register_node("cottages:rope", {
  7. description = "rope for climbing",
  8. tiles = {"cottages_rope.png"},
  9. groups = {snappy=3,choppy=3,oddly_breakable_by_hand=3,rail=1,connect_to_raillike=1},--connect_to_raillike=minetest.raillike_group("rail")},
  10. walkable = false,
  11. climbable = true,
  12. paramtype = "light",
  13. sunlight_propagates = true,
  14. drawtype = "plantlike",
  15. is_ground_content = false,
  16. can_dig = function(pos, player)
  17. local below = minetest.get_node( {x=pos.x, y=pos.y-1, z=pos.z});
  18. if( below and below.name and below.name == "cottages:rope" ) then
  19. if( player ) then
  20. minetest.chat_send_player( player:get_player_name(),
  21. 'The entire rope would be too heavy. Start digging at its lowest end!');
  22. end
  23. return false;
  24. end
  25. return true;
  26. end
  27. })
  28. minetest.register_craft({
  29. output = "cottages:rope",
  30. recipe = {
  31. {"farming:cotton","farming:cotton","farming:cotton"}
  32. }
  33. })
  34. -- Note: This rope also counts as a rail node; thus, carts can move through it
  35. minetest.register_node("cottages:ladder_with_rope_and_rail", {
  36. description = "Ladder with rail support",
  37. drawtype = "signlike",
  38. tiles = {"default_ladder_wood.png^carts_rail_straight.png^cottages_rope.png"},
  39. inventory_image = "default_ladder_wood.png",
  40. wield_image = "default_ladder_wood.png",
  41. paramtype = "light",
  42. paramtype2 = "wallmounted",
  43. sunlight_propagates = true,
  44. walkable = false,
  45. climbable = true,
  46. is_ground_content = false,
  47. selection_box = {
  48. type = "wallmounted",
  49. },
  50. groups = {choppy=2,oddly_breakable_by_hand=3,rail=1,connect_to_raillike=1}, --connect_to_raillike=minetest.raillike_group("rail")},
  51. legacy_wallmounted = true,
  52. sounds = cottages.sounds.wood,
  53. })
  54. minetest.register_craft({
  55. output = "cottages:ladder_with_rope_and_rail 3",
  56. recipe = {
  57. {"default:ladder","cottages:rope", "default:rail"}
  58. }
  59. })