diff --git a/contrib/playerInspect.py b/contrib/playerInspect.py index 0c3ff86..c520788 100644 --- a/contrib/playerInspect.py +++ b/contrib/playerInspect.py @@ -3,6 +3,7 @@ import sys sys.path.append(".") from overviewer_core.nbt import load +from overviewer_core import items print "Inspecting %s" % sys.argv[1] @@ -13,4 +14,5 @@ print "Position: %r" % data['Pos'] print "Health: %s" % data['Health'] print "Inventory: %d items" % len(data['Inventory']) for item in data['Inventory']: - print " %r" % item + print " %-3d %s" % (item['Count'], items.id2item(item['id'])) + diff --git a/overviewer_core/items.py b/overviewer_core/items.py new file mode 100644 index 0000000..9b01aed --- /dev/null +++ b/overviewer_core/items.py @@ -0,0 +1,211 @@ +items = { + 0: 'Air', + 1: 'Stone', + 2: 'Grass', + 3: 'Dirt', + 4: 'Cobblestone', + 5: 'Wooden plank', + 6: 'Sapling', + 7: 'Bedrock', + 8: 'Water', + 9: 'Stationary', + 10: 'Lava', + 11: 'Stationary', + 12: 'Sand', + 13: 'Gravel', + 14: 'Gold ore', + 15: 'Iron ore', + 16: 'Coal ore', + 17: 'Wood', + 18: 'Leaves', + 19: 'Sponge', + 20: 'Glass', + 21: 'Lapis lazuli ore', + 22: 'Lapis lazuli block', + 23: 'Dispenser', + 24: 'Sandstone', + 25: 'Note block', + 26: 'Bed', + 27: 'Powered rail', + 28: 'Detector rail', + 29: 'Sticky piston', + 30: 'Cobweb', + 31: 'Tall grass', + 32: 'Dead shrubs', + 33: 'Piston', + 34: 'Piston extension', + 35: 'Wool', + 36: 'Block moved by piston', + 37: 'Dandelion', + 38: 'Rose', + 39: 'Brown mushroom', + 40: 'Red mushroom', + 41: 'Block of gold', + 42: 'Block of iron', + 43: 'Double slabs', + 44: 'Slabs', + 45: 'Brick block', + 46: 'TNT', + 47: 'Bookshelf', + 48: 'Moss stone', + 49: 'Obsidian', + 50: 'Torch', + 51: 'Fire', + 52: 'Monster spawner', + 53: 'Wooden stairs', + 54: 'Chest', + 55: 'Redstone wire', + 56: 'Diamond ore', + 57: 'Block of diamond', + 58: 'Crafting table', + 59: 'Seeds', + 60: 'Farmland', + 61: 'Furnace', + 62: 'Burning furnace', + 63: 'Sign', + 64: 'Wooden door', + 65: 'Ladders', + 66: 'Rails', + 67: 'Cobblestone stairs', + 68: 'Wall sign', + 69: 'Lever', + 70: 'Stone pressure plate', + 71: 'Iron door', + 72: 'Wooden pressure plate', + 73: 'Redstone ore', + 74: 'Glowing redstone ore', + 75: 'Redstone torch (off)', + 76: 'Redstone torch (on)', + 77: 'Stone button', + 78: 'Snow', + 79: 'Ice', + 80: 'Snow block', + 81: 'Cactus', + 82: 'Clay block', + 83: 'Sugar cane', + 84: 'Jukebox', + 85: 'Fence', + 86: 'Pumpkin', + 87: 'Netherrack', + 88: 'Soul sand', + 89: 'Glowstone block', + 90: 'Portal', + 91: 'Jack-O-Lantern', + 92: 'Cake', + 93: 'Redstone repeater (off)', + 94: 'Redstone repeater (on)', + 95: 'Locked', + 96: 'Trapdoor', + 256: 'Iron shovel', + 257: 'Iron pickaxe', + 258: 'Iron axe', + 259: 'Flint and steel', + 260: 'Red apple', + 261: 'Bow', + 262: 'Arrow', + 263: 'Coal', + 264: 'Diamond', + 265: 'Iron ingot', + 266: 'Gold ingot', + 267: 'Iron sword', + 268: 'Wooden sword', + 269: 'Wooden shovel', + 270: 'Wooden pickaxe', + 271: 'Wooden axe', + 272: 'Stone sword', + 273: 'Stone shovel', + 274: 'Stone pickaxe', + 275: 'Stone axe', + 276: 'Diamond sword', + 277: 'Diamond shovel', + 278: 'Diamond pickaxe', + 279: 'Diamond axe', + 280: 'Stick', + 281: 'Bowl', + 282: 'Mushroom soup', + 283: 'Gold sword', + 284: 'Gold shovel', + 285: 'Gold pickaxe', + 286: 'Gold axe', + 287: 'String', + 288: 'Feather', + 289: 'Gunpowder', + 290: 'Wooden hoe', + 291: 'Stone hoe', + 292: 'Iron hoe', + 293: 'Diamond hoe', + 294: 'Gold hoe', + 295: 'Seeds', + 296: 'Wheat', + 297: 'Bread', + 298: 'Leather cap', + 299: 'Leather tunic', + 300: 'Leather pants', + 301: 'Leather boots', + 302: 'Chain helmet', + 303: 'Chain chestplate', + 304: 'Chain leggings', + 305: 'Chain boots', + 306: 'Iron helmet', + 307: 'Iron chestplate', + 308: 'Iron leggings', + 309: 'Iron boots', + 310: 'Diamond helmet', + 311: 'Diamond chestplate', + 312: 'Diamond leggings', + 313: 'Diamond boots', + 314: 'Gold helmet', + 315: 'Gold chestplate', + 316: 'Gold leggings', + 317: 'Gold boots', + 318: 'Flint', + 319: 'Raw porkchop', + 320: 'Cooked porkchop', + 321: 'Paintings', + 322: 'Golden apple', + 323: 'Sign', + 324: 'Wooden door', + 325: 'Bucket', + 326: 'Water bucket', + 327: 'Lava bucket', + 328: 'Minecart', + 329: 'Saddle', + 330: 'Iron door', + 331: 'Redstone', + 332: 'Snowball', + 333: 'Boat', + 334: 'Leather', + 335: 'Milk', + 336: 'Clay brick', + 337: 'Clay', + 338: 'Sugar cane', + 339: 'Paper', + 340: 'Book', + 341: 'Slimeball', + 342: 'Minecart with chest', + 343: 'Minecart with furnace', + 344: 'Egg', + 345: 'Compass', + 346: 'Fishing rod', + 347: 'Clock', + 348: 'Glowstone dust', + 349: 'Raw fish', + 350: 'Cooked fish', + 351: 'Dye', + 352: 'Bone', + 353: 'Sugar', + 354: 'Cake', + 355: 'Bed', + 356: 'Redstone repeater', + 357: 'Cookie', + 358: 'Map', + 359: 'Shears', + 2256: 'Gold music disc', + 2257: 'Green music disc' +} + +def id2item(item_id): + if item_id in items: + return items[item_id] + else: + return item_id