diff --git a/plugins/data/itemids.txt b/plugins/data/itemids.txt new file mode 100644 index 0000000..54f4885 --- /dev/null +++ b/plugins/data/itemids.txt @@ -0,0 +1,306 @@ +1 Stone +2 Grass Block +3 Dirt +4 Cobblestone +5 Wooden Planks +6 Sapling +7 Bedrock +8 Water +9 Water +10 Lava +11 Lava +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 Grass +32 Dead Bush +33 Piston +34 Unknown +35 Wool +36 Unknown +37 Flower +38 Rose +39 Mushroom +40 Mushroom +41 Block of Gold +42 Block of Iron +43 Double Slabs +44 Slabs +45 Bricks +46 TNT +47 Bookshelf +48 Moss Stone +49 Obsidian +50 Torch +51 Fire +52 Monster Spawner +53 Wooden Stairs +54 Chest +55 Redstone Dust +56 Diamond Ore +57 Block of Diamond +58 Crafting Table +59 Crops +60 Farmland +61 Furnace +62 Furnace +63 Sign +64 Wooden Door +65 Ladder +66 Rail +67 Stone Stairs +68 Sign +69 Lever +70 Pressure Plate +71 Iron Door +72 Pressure Plate +73 Redstone Ore +74 Redstone Ore +75 Redstone Torch +76 Redstone Torch +77 Button +78 Snow +79 Ice +80 Snow +81 Cactus +82 Clay +83 Sugar cane +84 Jukebox +85 Fence +86 Pumpkin +87 Netherrack +88 Soul Sand +89 Glowstone +90 Portal +91 Jack 'o' Lantern +92 Cake +93 Redstone Repeater (off) +94 Redstone Repeater (on) +95 Locked chest +96 Trapdoor +97 Hidden Silverfish +98 Stone Bricks +99 Mushroom +100 Mushroom +101 Iron Bars +102 Glass Pane +103 Melon +104 Pumpkin Stem +105 Melon Stem +106 Vines +107 Fence Gate +108 Brick Stairs +109 Stone Brick Stairs +110 Mycelium +111 Lily Pad +112 Nether Brick +113 Nether Brick Fence +114 Nether Brick Stairs +115 Nether Wart +116 Enchantment Table +117 Brewing stand +118 Cauldron +119 End Portal +120 End Portal Frame +121 White Stone +256 Iron Shovel +257 Iron Pickaxe +258 Iron Axe +259 Flint and Steel +260 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 Stew +283 Golden Sword +284 Golden Shovel +285 Golden Pickaxe +286 Golden Axe +287 String +288 Feather +289 Gunpowder +290 Wooden Hoe +291 Stone Hoe +292 Iron Hoe +293 Diamond Hoe +294 Golden 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 Golden Helmet +315 Golden Chestplate +316 Golden Leggings +317 Golden boots +318 Flint +319 Raw Porkchop +320 Cooked Porkchop +321 Painting +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 Brick +337 Clay +338 Sugar Canes +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 +360 Melon +361 Pumpkin Seeds +362 Melon Seeds +363 Raw Beef +364 Steak +365 Raw Chicken +366 Cooked Chicken +367 Rotten Flesh +368 Ender Pearl +369 Blaze Rod +370 Ghast Tear +371 Gold Nugget +372 Nether Wart +373 Potion +374 Glass Bottle +375 Spider Eye +376 Fermented Spider Eye +377 Blaze Powder +378 Magma Cream +379 Brewing Stand +380 Cauldron +381 Eye of Ender +382 Glistering Melon +2256 Music Disc 13 +2257 Music Disc Cat +2258 Music Disc Blocks +2259 Music Disc Chirp +2260 Music Disc Far +2261 Music Disc Mall +2262 Music Disc Mellohi +2263 Music Disc Stal +2264 Music Disc Strad +2265 Music Disc Ward +2266 Music Disc 11 +373:16 Awkward Potion +373:32 Thick Potion +373:64 Mundane Potion +373:8193 Regeneration Potion (0:45) +373:8194 Swiftness Potion (3:00) +373:8195 Fire Resistance Potion (3:00) +373:8196 Poison Potion (0:45) +373:8197 Healing Potion +373:8200 Weakness Potion (1:30) +373:8201 Strength Potion (3:00) +373:8202 Slowness Potion (1:30) +373:8204 Harming Potion +373:8225 Regeneration Potion II (0:22) +373:8226 Swiftness Potion II (1:30) +373:8228 Poison Potion II (0:22) +373:8229 Healing Potion II +373:8233 Strength Potion II (1:30) +373:8236 Harming Potion II +373:8257 Regeneration Potion (2:00) +373:8258 Swiftness Potion (8:00) +373:8259 Fire Resistance Potion (8:00) +373:8260 Poison Potion (2:00) +373:8264 Weakness Potion (4:00) +373:8265 Strength Potion (8:00) +373:8266 Slowness Potion (4:00) +373:16378 Fire Resistance Splash (2:15) +373:16385 Regeneration Splash (0:33) +373:16386 Swiftness Splash (2:15) +373:16388 Poison Splash (0:33) +373:16389 Healing Splash +373:16392 Weakness Splash (1:07) +373:16393 Strength Splash (2:15) +373:16394 Slowness Splash (1:07) +373:16396 Harming Splash +373:16418 Swiftness Splash II (1:07) +373:16420 Poison Splash II (0:16) +373:16421 Healing Splash II +373:16425 Strength Splash II (1:07) +373:16428 Harming Splash II +373:16449 Regeneration Splash (1:30) +373:16450 Swiftness Splash (6:00) +373:16451 Fire Resistance Splash (6:00) +373:16452 Poison Splash (1:30) +373:16456 Weakness Splash (3:00) +373:16457 Strength Splash (6:00) +373:16458 Slowness Splash (3:00) +373:16471 Regeneration Splash II (0:16) diff --git a/plugins/data/recipes.txt b/plugins/data/recipes.txt new file mode 100644 index 0000000..e69de29 diff --git a/plugins/mcitems.py b/plugins/mcitems.py new file mode 100644 index 0000000..adf20c8 --- /dev/null +++ b/plugins/mcitems.py @@ -0,0 +1,99 @@ +""" plugin by _303 (?) + pulled from by lukeroge +""" + +from util import hook +import re +import itertools + +pattern = re.compile(r'^(?P\d+)x (?P.+?): (?P.*)$') + +recipelist = [] + +class Recipe(object): + __slots__ = 'output', 'count', 'ingredients', 'line' + + def __init__(self, output, count, ingredients, line): + self.output = output + self.count = count + self.ingredients = ingredients + self.line = line + + def __str__(self): + return self.line + +with open("./plugins/data/recipes.txt") as f: + for line in f.readlines(): + line = line.strip() + match = pattern.match(line) + if not match: + continue + recipelist.append(Recipe(line=line, + output=match.group("name").lower(), + ingredients=match.group("ingredients"), + count=match.group("count"))) + +ids = [] + +with open("./plugins/data/itemids.txt") as f: + for line in f.readlines(): + parts = line.strip().split() + id = parts[0] + name = " ".join(parts[1:]) + ids.append((id,name)) + +@hook.command +def itemid(input, reply=None): + ".itemid -- gets the id from an item or vice versa" + input = input.lower().strip() + + + all = False + limit = 4 + parts = input.split() + + if parts[0] == "-all": + all = True + input = " ".join(parts[1:]) + + if input == "": + reply("no input") + return + + results = [] + + for id, name in ids: + if input == id or input in name.lower(): + results.append("%s %s" % (id, name)) + + if not len(results): + reply("no matches found") + return + + if not all and len(results) > limit: + reply("Displaying %d of %d matches, use -all to get all." % (limit, len(results))) + + for result in results if all else itertools.islice(results, limit): + reply(result) + + + +@hook.command +def recipe(input, reply=None): + ".recipe -- gets the crafting recipe for an item" + input = input.lower().strip() + + results = [] + + for recipe in recipelist: + if input in recipe.output: + results.append(recipe.line) + + if not len(results): + reply("no matches found") + return + + for result in results: + reply(result) + +