Advertisement
demon012

ItemDB

Aug 15th, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.51 KB | None | 0 0
  1. --if not fs.exists("/libs") then--{{{
  2. --    fs.makeDir("/libs")
  3. --end--}}}
  4. --
  5. --function update_lib(pastebin_id, dest_path)--{{{
  6. --    if fs.exists(dest_path) then
  7. --        fs.delete(dest_path)
  8. --    end
  9. --    shell.run("pastebin get " .. pastebin_id  .. " " .. dest_path)
  10. --    os.loadAPI(dest_path)
  11. --end--}}}
  12. --
  13. --update_lib("n1S2GpfD", "libs/sorterAPI")
  14. --
  15. Item = {
  16.     uuid = '',
  17.     name = '',
  18.     aspects = {},
  19. }
  20.  
  21. Item_mt = {__index = Item}
  22.  
  23. function Item:create()
  24.     local new_item = {}
  25.     setmetatable(new_item,  Item_mt)
  26.     return new_item
  27. end
  28.  
  29. ItemDB = {
  30.     itemsByName = {},
  31.     itemsByUUID = {},
  32. }
  33.  
  34. function ItemDB:addNewItem(name, id, meta, aspects)
  35.     local item = Item:create()
  36.     item.name = name
  37.     item.uuid = sorterAPI.getUUID(id, meta)
  38.     item.aspects = aspects
  39.     self:addItem(item)
  40. end
  41.  
  42. function ItemDB:addItem(item)
  43.     self.itemsByUUID[item.uuid] = item
  44.     self.itemsByName[item.name] = item
  45. end
  46.  
  47. db = ItemDB
  48. db:addNewItem('Charcoal', 263, 1, {['ignis'] = 2, ['lignum'] = 1, ['potentia'] = 2})
  49. db:addNewItem('Torch', 50, 0, {['lux'] = 1})
  50. db:addNewItem('Copper Nuggets', 21261, 243, {['metallum'] = 1})
  51. db:addNewItem('Chiseled Sandstone', 24, 1, {['praecantatio'] = 1, ['saxum'] = 2, ['solum'] = 3})
  52. db:addNewItem('Smooth Sandstone', 24, 2, {['carus'] = 1, ['saxum'] = 2, ['solum'] = 3})
  53. db:addNewItem('Bone Meal', 351, 15, {['mortuus'] = 1})
  54. db:addNewItem('Wheat', 296, 0, {['messis'] = 2, ['victus'] = 2})
  55. db:addNewItem('Music Disc - Stal', 2263, 0, {['carus'] = 4, ['malum'] = 4, ['sonus'] = 12})
  56. db:addNewItem('Soul Sand', 88, 0, {['animus'] = 1, ['solum'] = 1, ['vinculum'] = 1})
  57. db:addNewItem('Oak Wood', 17, 0, {['lignum'] = 4})
  58. db:addNewItem('Seeds', 295, 0, {['herba'] = 1, ['permutatio'] = 1})
  59. db:addNewItem('Bowl', 281, 0, {['vacuos'] = 1})
  60. db:addNewItem('Dirt', 3, 0, {['solum'] = 3})
  61. db:addNewItem('Trapdoor', 96, 0, {['motus'] = 1, ['lignum'] = 1})
  62. db:addNewItem('Feather', 288, 0, {['volito'] = 2, ['aura'] = 2})
  63. db:addNewItem('Cobblestone', 4, 0, {['saxum'] = 1, ['fractus'] = 1})
  64. db:addNewItem('Flint', 318, 0, {['instrumentum'] = 1, ['saxum'] = 1})
  65. db:addNewItem('Arrow', 262, 0, {['telum'] = 1, ['aura'] = 1, ['volito'] = 1})
  66. db:addNewItem('Carrot', 391, 0, {['visum'] = 2, ['messis'] = 2})
  67. db:addNewItem('Nether Wart', 372, 0, {['ignis'] = 1, ['mutatio'] = 1, ['fungus'] = 1})
  68. db:addNewItem('Wool', 35, 0, {['pannus'] = 4})
  69. db:addNewItem('Refined Iron', 30249, 0, {['metallum'] = 8})
  70. db:addNewItem('Nether Quartz', 406, 0, {['purus'] = 1, ['saxum'] = 1, ['visum'] = 1, ['vitreus'] = 1})
  71. db:addNewItem('Diamond', 264, 0, {['carus'] = 4, ['purus'] = 4, ['vitreus'] = 12})
  72. db:addNewItem('Glass', 20, 0, {['vitreus'] = 2})
  73. db:addNewItem('Paper', 339, 0, {['aqua'] = 2, ['cognito'] = 2, ['messis'] = 2})
  74. db:addNewItem('Button', 77, 0, {['machina'] = 1, ['saxum'] = 2})
  75. db:addNewItem('Lever', 69, 0, {['imperito'] = 1, ['saxum'] = 1, ['herba'] = 1, ['fractus'] = 1, ['victus'] = 1})
  76. db:addNewItem('String', 287, 0, {['vinculum'] = 1, ['pannus'] = 1, ['bestiola'] = 1})
  77. db:addNewItem('Golden Apple', 322, 0, {['messis'] = 2, ['metallum'] = 6, ['sano'] = 4, ['praecantatio'] = 2, ['victus'] = 2})
  78. db:addNewItem('Ender Pearl', 368, 0, {['alienis'] = 4, ['praecantatio'] = 4, ['vitreus'] = 4})
  79. db:addNewItem('Redstone Repeater', 356, 0, {['tempus'] = 1, ['saxum'] = 5, ['potentia'] = 2, ['machina'] = 2})
  80. db:addNewItem('Obsidian', 49, 0, {['tenebris'] = 1, ['ignis'] = 2, ['saxum'] = 5})
  81. db:addNewItem('Crafting Table', 58, 0, {['fabrico'] = 4, ['lignum'] = 3})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement