InventoryAPI - Create Inventories with Ease!

Discussion in 'Resources' started by FadedMystery, May 14, 2014.

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

    FadedMystery

    Hey fellow Bukkit developers! I don't know about you but I hate making inventories! So much setup and chaos. Well, here is your solution. You can start making inventories with InventoryAPI with ease.

    This is just not a library. It's a plugin, you import it just like how you would with Bukkit. When using the API, insure that you have the plugin on your server as well, other wise you might get some errors :).

    Screen Shots (open)

    The Inventory:
    [​IMG]

    Item Example:
    [​IMG]



    Source Code: https://github.com/FadedMystery/InventoryAPI
    Download: https://www.dropbox.com/s/xpreohpqx5yfevo/InventoryAPI.jar
    (should I put the plugin on BukkitDev?)
     
  2. Offline

    Adriani6

    Nothing here. No usage nothing .-.
     
  3. Offline

    FadedMystery

    Adriani6 likes this.
  4. Offline

    Onlineids

    Don't see the purpose for this unless you're a beginner, imo making inv/guis is very easy.
     
    The Fancy Whale likes this.
  5. Offline

    The Fancy Whale

    I agree with Onlineids this is another API, which for what it is I am sure works just fine, but is completely unnecessary as you still have to figure out how to use your API, when the bukkit API isn't very hard to use for this. You also then have to depend on another plugin and use it on the server. Really not worth it in my opinion. Finally, you should probably put some more time into the documentation as just having the source code isn't the most efficient way to show how to use the API.
     
    Onlineids likes this.
  6. Offline

    xTrollxDudex

    I think that the design of this API features nothing special, just lots of shortcuts. I would've preferred an abstracted inventory container, but your ItemStack builder is pretty cool, though not necessarily a real builder, as a builder pattern appends the settings on the object wrapper when the build method is called and returns.
     
  7. Offline

    Garris0n

    I recommend having some sort of builder-like ItemStack creator in every large plugin you make. I've never had a point where I thought to myself "man, I wish I had to write out like 3 extra lines to apply this lore".
     
  8. To handle the size you could always have used something like this:
    Code:java
    1. int size = someGivenNumber;
    2. if (size % 9 != 0) {
    3. size = Math.round(size / 9) * 9;
    4. }
    5. // Possibly add another check like:
    6. if (size > 45) {
    7. throw new IllegalArgumentException("Oh noes! Invalid size!");
    8. }
     
  9. Offline

    BungeeTheCookie

    Without shortcuts, we would still be hunter-gatherers.
     
    xTrollxDudex likes this.
  10. Offline

    FadedMystery

    Yes, with bukkit it is very easy. Just when you are checking for every item that is clicked it gets a bit tedious. There's my point with the API, you can add an item to inventory AND assign a Runnable. I would not suggest using this API if your just going have to items in it with no listener checking if it had been clicked.

    Yea, the ItemStackBuikder class does help. ItemMeta's are a pain. I like doing it in one method c:

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
  11. Offline

    xTrollxDudex

    I think being a hunter gatherer would be cool!
     
  12. Offline

    Garris0n

    With shortcuts, being hunter-gatherers is easier.

    find code, cmd + c, go to plugin, cmd + v

    See, hunting code and gathering it ;)

    Disclaimer: Don't do that...
     
  13. Offline

    Catchet

    Garris0n Sorry for interrupting, but I think you meant to say "ctrl + c" and "ctrl + v" ;)
     
  14. Offline

    Garris0n


    [​IMG]
     
    MrDplugins and chasechocolate like this.
  15. Offline

    Catchet

    Garris0n Oh... Nevermind then.
    Sorry for any inconvenience.
     
  16. Offline

    darkness1999

  17. Offline

    Onlineids

  18. darkness1999 Thats not what my code snippet does :p.

    Edit: Nevermind, missread your post, sorry :p
     
  19. Offline

    FadedMystery

    you can use pretty much any multiple of 9. Just it gets buggy :p
     
  20. Offline

    BungeeTheCookie

    You should stick to trolling.
    Garris0n
    My computer just exploded.
     
  21. Offline

    FadedMystery

  22. Offline

    xTrollxDudex

    Why?
     
Thread Status:
Not open for further replies.

Share This Page