init.lua 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. -- TODO: stakes must degrade if left in place for too much time.
  2. -- they are meant for marking construction ground not to stand forever.
  3. -- TODO: make them usable as fuel, or craft them into simple sticks.
  4. stakemarkers = {}
  5. stakemarkers.colors = {"red", "blue", "orange", "yellow", "green"}
  6. stakemarkers.nodebox = {
  7. type = "fixed",
  8. fixed = {-1/16, -8/16, -1/16, 1/16, 8/16, 1/16}
  9. }
  10. function stakemarkers.register()
  11. for i, v in ipairs(stakemarkers.colors) do
  12. minetest.register_node("stakemarkers:marker_" .. v, {
  13. description = "Marker " .. v ..
  14. "\nUse to mark ground for construction.",
  15. paramtype = "light",
  16. drawtype = "nodebox",
  17. node_box = stakemarkers.nodebox,
  18. tiles = {"default_wood.png"},
  19. overlay_tiles = {"", "", "stakemarkers_" .. v .. ".png"},
  20. groups = {level=1, dig_immediate=2, attached_node=1},
  21. is_ground_content = false
  22. })
  23. minetest.register_craft({
  24. output = "stakemarkers:marker_" .. v .. " 8",
  25. recipe = {
  26. {"dye:" .. v},
  27. {"group:wood"},
  28. {"group:wood"}
  29. }
  30. })
  31. end
  32. end
  33. stakemarkers.register()