iron_torch.lua 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. minetest.register_node("torches:iron_torch", {
  2. description = "Wrought Metal Wall Torch",
  3. drawtype = "mesh",
  4. mesh = "torches_iron_torch.obj",
  5. tiles = {
  6. "forniture_coal.png",
  7. {
  8. name="forniture_torch_flame.png",
  9. animation={
  10. type="vertical_frames",
  11. aspect_w=40,
  12. aspect_h=40,
  13. length=1.0,
  14. },
  15. },
  16. "homedecor_generic_metal_black.png^[brighten",
  17. "homedecor_generic_metal_black.png",
  18. },
  19. inventory_image = "forniture_torch_inv.png",
  20. wield_image = "forniture_torch_inv.png",
  21. walkable = false,
  22. light_source = 12,
  23. selection_box = {
  24. type = "wallmounted",
  25. --wall_top = {-0.1, -0.1, -0.1, 0.1, 0.5, 0.1},
  26. --wall_bottom = {-0.1, -0.5, -0.1, 0.1, 0.1, 0.1},
  27. wall_side = {-0.5, -0.3, -0.1, -0.2, 0.3, 0.1},
  28. },
  29. groups = utility.dig_groups("bigitem", {
  30. attached_node=1,
  31. melt_around=2, torch=1,
  32. notify_construct=1, want_notify=1,
  33. }),
  34. paramtype = "light",
  35. paramtype2 = "wallmounted",
  36. sunlight_propagates = true,
  37. floodable = true,
  38. on_rotate = false,
  39. node_placement_prediction = "",
  40. _torches_node_floor = "torches:iron_torch",
  41. _torches_node_wall = "torches:iron_torch",
  42. _torches_node_ceiling = "torches:iron_torch",
  43. on_place = function(itemstack, placer, pt)
  44. return torches.put_torch(itemstack, placer, pt, true)
  45. end,
  46. on_flood = function(pos, oldnode, newnode)
  47. minetest.add_node(pos, {name="air"})
  48. minetest.sound_play("real_torch_extinguish", {pos=pos, max_hear_distance=16, gain=1})
  49. return true
  50. end,
  51. on_construct = function(pos)
  52. breath.ignite_nearby_gas(pos)
  53. flowers.create_lilyspawner_near(pos)
  54. torchmelt.start_melting(pos)
  55. end,
  56. on_notify = function(pos, other)
  57. torchmelt.start_melting(pos)
  58. end,
  59. on_destruct = function(pos)
  60. end,
  61. })
  62. minetest.register_craft({
  63. output = "torches:iron_torch",
  64. recipe = {
  65. {'default:coal_lump'},
  66. {'default:steel_ingot'},
  67. }
  68. })
  69. minetest.register_craft({
  70. output = "torches:iron_torch",
  71. recipe = {
  72. {'default:coal_lump'},
  73. {'moreores:tin_ingot'},
  74. }
  75. })