mesewire.lua 755 B

12345678910111213141516171819202122232425262728293031
  1. local mesewire_rules =
  2. {
  3. {x = 1, y = 0, z = 0},
  4. {x =-1, y = 0, z = 0},
  5. {x = 0, y = 1, z = 0},
  6. {x = 0, y =-1, z = 0},
  7. {x = 0, y = 0, z = 1},
  8. {x = 0, y = 0, z =-1},
  9. }
  10. minetest.override_item("default:mese", {
  11. mesecons = {conductor = {
  12. state = mesecon.state.off,
  13. onstate = "mesecons_extrawires:mese_powered",
  14. rules = mesewire_rules
  15. }}
  16. })
  17. minetest.register_node("mesecons_extrawires:mese_powered", {
  18. tiles = {minetest.registered_nodes["default:mese"].tiles[1].."^[brighten"},
  19. is_ground_content = true,
  20. groups = {cracky=1, not_in_creative_inventory = 1},
  21. sounds = default.node_sound_stone_defaults(),
  22. mesecons = {conductor = {
  23. state = mesecon.state.on,
  24. offstate = "default:mese",
  25. rules = mesewire_rules
  26. }},
  27. drop = "default:mese"
  28. })