Guest User

Untitled

a guest
Oct 17th, 2013
90
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. glooptest.tech_module = {}
  2. glooptest.debug("MESSAGE","Loading Tech Module Now!")
  3.  
  4. --dofile(minetest.get_modpath("glooptest").."/tech_module/api.lua")
  5.  
  6. local fixed = {
  7. { -8/16, -8/16, -8/16, 8/16, -4/16, 8/16 }, -- base
  8. { -8/16, 3/16, -8/16, 8/16, 8/16, 8/16 }, -- top
  9. { 3/16, -7/16, 3/16, 7/16, 7/16, 7/16 },
  10. { 3/16, -7/16, -7/16, 7/16, 7/16, -3/16 },
  11. { -7/16, -7/16, 3/16, -3/16, 7/16, 7/16 },
  12. { -7/16, -7/16, -7/16, -3/16, 7/16, -3/16 },
  13. }
  14.  
  15. -- {used item, produced node}
  16. glooptest.tech_module.table_changers = {
  17. {},
  18. }
  19.  
  20. function glooptest.tech_module.register_table(used_item, produced_node)
  21. if minetest.registered_items[used_item] ~= nil and minetest.registered_items[produced_node] ~= nil then
  22. table.insert(glooptest.tech_module.table_changers, {item = used_item, node = produced_node})
  23. end
  24. end
  25.  
  26. minetest.register_alias("glooptest:table", "glooptest:wooden_table")
  27. minetest.register_node("glooptest:wooden_table", {
  28. description = "Wooden Table",
  29. drawtype = "nodebox",
  30. tiles = {"glooptest_table_tb.png","glooptest_table_tb.png","glooptest_table_side.png"},
  31. paramtype = "light",
  32. groups = {choppy=3, snappy=3},
  33. node_box = {
  34. type = "fixed",
  35. fixed = fixed,
  36. },
  37. on_rightclick = function(pos, node, clicker, itemstack)
  38. local clicking_item = itemstack
  39. for ind,content in glooptest.tech_module.table_changers do
  40. if content.item == clicking_item:get_name() then
  41. minetest.place_node(pos, {name=content.node})
  42. return ItemStack(clicking_item:get_name().." "..tostring(clicking_item:get_count()-1))
  43. end
  44. end
  45. end,
  46. })
  47.  
  48. minetest.register_craft({
  49. output = "glooptest:table",
  50. recipe = {
  51. {"group:wood","group:wood","group:wood"},
  52. {"default:stick","","default:stick"},
  53. {"group:wood","","group:wood"},
  54. }
  55. })
  56.  
  57. minetest.register_craftitem("glooptest:upgrade_core", {
  58. description = "Upgrade Core",
  59. inventory_image = "glooptest_upgrade_core.png",
  60. })
  61.  
  62. minetest.register_craft({
  63. output = "glooptest:upgrade_core",
  64. recipe = {
  65. {"glooptest:akalin_ingot", "glooptest:crystal_glass", "glooptest:akalin_ingot"},
  66. {"glooptest:crystal_glass", "default:mese_crystal_fragment", "glooptest:crystal_glass"},
  67. {"glooptest:akalin_ingot", "glooptest:crystal_glass", "glooptest:akalin_ingot"},
  68. },
  69. })
  70.  
  71. if LOAD_ORE_MODULE == true then
  72. minetest.register_craftitem("glooptest:encrusting_upgrade", {
  73. description = "Encrusting Upgrade",
  74. inventory_image = "glooptest_encrusting_upgrade.png",
  75. })
  76.  
  77. minetest.register_craft({
  78. output = "glooptest:encrusting_upgrade",
  79. recipe = {
  80. {"group:glooptest_gem", "group:glooptest_gem", "group:glooptest_gem"},
  81. {"glooptest:hammer_steel", "glooptest:upgrade_core", "glooptest:handsaw_steel"},
  82. {"group:glooptest_gem", "group:glooptest_gem", "group:glooptest_gem"},
  83. },
  84. })
  85.  
  86. minetest.register_node("glooptest:encrusting_table", {
  87. description = "Encrusting Table",
  88. drawtype = "nodebox",
  89. tiles = {"glooptest_table_tb.png^glooptest_encrusting_upgrade.png","glooptest_table_tb.png","glooptest_table_side.png"},
  90. paramtype = "light",
  91. groups = {choppy=3, snappy=3},
  92. node_box = {
  93. type = "fixed",
  94. fixed = fixed,
  95. },
  96. })
  97.  
  98. glooptest.tech_module.register_table("glooptest:encrusting_upgrade", "glooptest:encrusting_table")
  99. end
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×