Advertisement
jlnewton87

inventory.lua

Oct 3rd, 2022
1,020
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. local M = {}
  2. -- Inventory Item:
  3. -- name = "minecraft:charcoal"
  4. -- itemGroups = [1 = { displayName = "Miscellaneous", id = "misc"  }]
  5. -- tags = { minecraft:coals: true }
  6. -- count = 64
  7. -- maxCount = 64
  8. -- displayName = "Charcoal"
  9. M.inventory = {}
  10. M.gasTank = {}
  11.  
  12. function M.initInventory()
  13.   for i = 1, 16 do
  14.     local item = turtle.getItemDetail(i, true)
  15.     local validFuel = turtle.refuel(0)
  16.     if(validFuel) then
  17.       M.gasTank[i] = true
  18.     end
  19.        
  20.     if(#M.gasTank > 1) then
  21.       M.hasGas = true
  22.     end
  23.  
  24.     M.inventory[i] = item
  25.   end
  26. end
  27.  
  28. return M
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement