Crafting From ItemStacks

Discussion in 'Plugin Development' started by RingOfStorms, Aug 27, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    RingOfStorms

    Is there an easy way to find out what can be crafted from an itemstack, or even more than one itemstack.
     
  2. Offline

    Musaddict

    What exactly do you mean? Like, if someone has an itemstack of planks, then he can make sticks?
     
  3. Offline

    RingOfStorms

    Musaddict, yes. So if you had lets say 2 planks of wood then you can make 4 sticks.

    And even harder would be to look through more than one stack so like you have 2 sticks and 3 iron, that would result in a bukkit, iron pickaxe, iorn shovel, iron hoe, iron axe, iron sword, etc etc.

    So how would I do that for like an array of itemstacks. You input and get an outputted itemstack array of the craftable items.
     
  4. Offline

    Musaddict

    You're getting into a whole new level of complexity. For every item that can be crafted you'd need to create a list of the items and the quantities. You'd then need to use a for() to check every craftable item, and compare the lists of items with the players inventory.

    I'm still trying to wrap my head around the specifics, but that's essentially what you'd have to do.
     
  5. Offline

    RingOfStorms

    Musaddict
    I was looking at this plugin, QuickBench, and that is was made me want to make a new plugin inspired by that one, since I think many more features could be added, and improved on. The dev on QuickBench has just anounced he would no longer update his plugins and released the source code for them. I tried to understand how he did his crafting but he uses a bunch of things from net.minecratf that seem to not be in the 1.3.1-R2.0 bukkit, and I have no idea how to duplicate the things he has done in just bukkit terms. Maybe from that QuickBench source we could make a better way of doing it.

    As of right now I don't plan on supporting other recipes than the ones in bukkit so none of the forge stuff and what not to start off with.
     
Thread Status:
Not open for further replies.

Share This Page