compactor.lua 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. --[[
  2. original compactor from (GPL 3)
  3. https://gitlab.com/alerikaisattera/compactor
  4. ]]
  5. local S = minetest.get_translator("default")
  6. if minetest.get_modpath('compactor') then
  7. technic_farming.register_compactor_recipe = compactor.register_compactor_recipe
  8. technic_farming.register_compactor = compactor.register_compactor
  9. else
  10. technic.register_recipe_type("compacting", {description = "Compacting"})
  11. function technic_farming.register_compactor_recipe(data)
  12. data.time = data.time or 1
  13. technic.register_recipe("compacting", data)
  14. end
  15. function technic_farming.register_compactor(data)
  16. data.typename = "compacting"
  17. data.machine_name = "compactor"
  18. data.machine_desc = "%s "..S("Compactor")
  19. data.description = data.tier.." Compactor"
  20. technic.register_base_machine("compactor:"..string.lower(data.tier).."_compactor",data)
  21. end
  22. compactor.register_compactor({tier = "LV", demand = {100}, speed = 1})
  23. minetest.register_craft({
  24. output = "technic_farming:lv_compactor",
  25. recipe = {
  26. {"technic:marble", "basic_materials:motor", "technic:granite"},
  27. {"pipeworks:autocrafter", "technic:machine_casing", "mesecons:piston"},
  28. {"basic_materials:brass_ingot", "technic:lv_cable", "default:bronze_ingot"},
  29. },
  30. })
  31. compactor.register_compactor({tier = "MV", demand = {300, 250, 200}, speed = 2, upgrade = 1, tube = 1})
  32. minetest.register_craft({
  33. output = "technic_farming:mv_compactor",
  34. recipe = {
  35. {"technic:stainless_steel_ingot", "compactor:lv_compactor", "technic:stainless_steel_ingot"},
  36. {"pipeworks:tube_1", "technic:mv_transformer", "pipeworks:tube_1"},
  37. {"technic:stainless_steel_ingot", "technic:mv_cable", "technic:stainless_steel_ingot"},
  38. },
  39. })
  40. end