SpockBotMC / SpockBot

High level Python framework for building Minecraft clients and bots.
MIT License
198 stars 47 forks source link

Crafting #93

Closed Gjum closed 9 years ago

Gjum commented 9 years ago

Yay! It's crafting again! This time using a python 2.7 compatible asynchronous task system, ans also really using minecraft-data now!

TODO:

rom1504 commented 9 years ago

Ah ! that's much better than copy-pasting the recipe file in a python file :d

About the tasking system : as said in irc/gitter : why not. That said, you can see the produced code is not incredibly better than a basic callback system like used in mineflayer (https://github.com/andrewrk/mineflayer/blob/master/lib/plugins/craft.js). (so just use something that works for you ;))

nickelpro commented 9 years ago

Is this confirmed not to blow anything up, cause any infinite loops, or otherwise disrupt the peaceful state of SpockLand? If so I'd rather have it in mainline than sitting in PR, will merge in the morning

Gjum commented 9 years ago

@nickelpro I discovered some bugs and asynchronous infinite loops, so do not merge it as-is. I probably have some time today to make it ready to merge.

Gjum commented 9 years ago

Quick test:

requires = (..., 'craft', ...)

# in an event handler of your choice (e.g. chat):
    self.craft.craft(item_id, metadata, amount)
nickelpro commented 9 years ago

Works for me, if there are any remaining bugs.... We'll Do It Live!