Advertisement
natie3

recipes

Sep 22nd, 2019
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.15 KB | None | 0 0
  1. list = {}
  2. list["r1"] = { recipe = "i11x2", group = "basic", name = "sticks", yields = 4 }
  3. list["r2"] = { recipe = "r1", group = "gear", name = "wooden", yields = 1 }
  4. list["r3"] = { recipe = "r2 i1x4", group = "gear", name = "stone", yields = 1 }
  5. list["r4"] = { recipe = "r3 i23x4", group = "gear", name = "tin", yields = 1 }
  6. list["r5"] = { recipe = "r3 i3x4", group = "gear", name = "copper", yields = 1 }
  7. list["r15"] = { recipe = "r3 i13x4", group = "gear", name = "iron", yields = 1 }
  8. list["r11"] = { recipe = "i11x4", group = "basic", name = "crafting table", yields = 1 }
  9. list["r12"] = { recipe = "i12x2 i14x1", group = "other", name = "redstone reception coil", yields = 1 }
  10. list["r13"] = { recipe = "r4 i21x4 i13x4", group = "machine", name = "frame", yields = 1 }
  11. list["r14"] = { recipe = "r12 r13 r11 r5 r5 i23x2", group = "machine", name = "fabricator", yields = 1 }
  12.  
  13. function createTree()
  14.   local recipes = {}
  15.  
  16.   for key, value in pairs(list) do
  17.     if(recipes[value.group] == nil) then
  18.       recipes[value.group] = {}
  19.     end
  20.     recipes[value.group][value.name] = value
  21.     recipes[value.group][value.name].iden = key
  22.   end
  23.  
  24.   return recipes
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement