printers.lua 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. -- Printers of some kind or another
  2. local S = minetest.get_translator("computer")
  3. minetest.register_node("computer:printer", {
  4. description = S("Printer-Scanner Combo"),
  5. inventory_image = "computer_printer_inv.png",
  6. tiles = {"computer_printer_t.png","computer_printer_bt.png","computer_printer_l.png",
  7. "computer_printer_r.png","computer_printer_b.png","computer_printer_f.png"},
  8. paramtype = "light",
  9. paramtype2 = "facedir",
  10. walkable = true,
  11. groups = {snappy=3},
  12. sound = default.node_sound_wood_defaults(),
  13. drawtype = "nodebox",
  14. node_box = {
  15. type = "fixed",
  16. fixed = {
  17. {-0.4375, -0.3125, -0.125, 0.4375, -0.0625, 0.375},
  18. {-0.4375, -0.5, -0.125, 0.4375, -0.4375, 0.375},
  19. {-0.4375, -0.5, -0.125, -0.25, -0.0625, 0.375},
  20. {0.25, -0.5, -0.125, 0.4375, -0.0625, 0.375},
  21. {-0.4375, -0.5, -0.0625, 0.4375, -0.0625, 0.375},
  22. {-0.375, -0.4375, 0.25, 0.375, -0.0625, 0.4375},
  23. {-0.25, -0.25, 0.4375, 0.25, 0.0625, 0.5},
  24. {-0.25, -0.481132, -0.3125, 0.25, -0.4375, 0}
  25. },
  26. },
  27. })
  28. -- "bedflinger" style 3D Printer (Prusa i3 or equivalent)
  29. local cbox = {
  30. type = "fixed",
  31. fixed = {-0.25, -0.25, -0.5, 0.3, 0.3, 0.25 }
  32. }
  33. minetest.register_node("computer:3dprinter_bedflinger", {
  34. description = S('3D Printer ("bedflinger")'),
  35. inventory_image = "computer_3dprinter_bedflinger_inv.png",
  36. tiles = {
  37. { name = "computer_3dprinter_bedflinger.png", color = 0xffffffff },
  38. "computer_3dprinter_filament.png"
  39. },
  40. paramtype = "light",
  41. walkable = true,
  42. groups = {snappy=3, ud_param2_colorable = 1},
  43. sound = default.node_sound_wood_defaults(),
  44. drawtype = "mesh",
  45. mesh = "computer_3dprinter_bedflinger.obj",
  46. paramtype2 = "colorwallmounted",
  47. palette = "unifieddyes_palette_colorwallmounted.png",
  48. selection_box = cbox,
  49. collision_box = cbox,
  50. after_place_node = function(pos, placer, itemstack, pointed_thing)
  51. unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing)
  52. end,
  53. on_dig = unifieddyes.on_dig,
  54. on_rotate = unifieddyes.fix_after_screwdriver_nsew,
  55. })