crossing.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. -- CODE NOT ACTIVE
  2. local crossing_get_rules = function(node)
  3. --TODO: calculate the real port states and use rules to link to them only if
  4. end
  5. minetest.register_node("mesecons_extrawires:crossing_on", {
  6. drawtype = "nodebox",
  7. tiles = {"jeija_insulated_wire_sides_on.png"},
  8. paramtype = "light",
  9. walkable = false,
  10. stack_max = 99,
  11. selection_box = {type="fixed", fixed={-16/32-0.0001, -18/32, -16/32-0.001, 16/32+0.001, -5/32, 16/32+0.001}},
  12. node_box = {
  13. type = "fixed",
  14. fixed = {
  15. { -16/32-0.001, -17/32, -3/32, 16/32+0.001, -13/32, 3/32 },
  16. { -3/32, -17/32, -16/32-0.001, 3/32, -13/32, -6/32 },
  17. { -3/32, -13/32, -9/32, 3/32, -6/32, -6/32 },
  18. { -3/32, -9/32, -9/32, 3/32, -6/32, 9/32 },
  19. { -3/32, -13/32, 6/32, 3/32, -6/32, 9/32 },
  20. { -3/32, -17/32, 6/32, 3/32, -13/32, 16/32+0.001 },
  21. },
  22. },
  23. groups = {dig_immediate=3, mesecon=3, mesecon_conductor_craftable=1, not_in_creative_inventory=1},
  24. mesecons = {
  25. receptor = {
  26. state = mesecon.state.on,
  27. rules = crossing_get_rules,
  28. }
  29. },
  30. })
  31. minetest.register_craft({
  32. type = "shapeless",
  33. output = "mesecons_extrawires:crossing",
  34. recipe = {
  35. "mesecons_insulated:insulated_off",
  36. "mesecons_insulated:insulated_off",
  37. },
  38. })
  39. minetest.register_craft({
  40. type = "shapeless",
  41. output = "mesecons_insulated:insulated_off 2",
  42. recipe = {
  43. "mesecons_extrawires:crossing",
  44. },
  45. })