Stack Potions

Discussion in 'Archived: Plugin Requests' started by Techtony96, Oct 8, 2012.

  1. Offline

    Techtony96

    I would like a plugin that when you type /potion, it stacks all potions in your inventory. But if the potion is stacked, then you cannot throw it, you have to unstack it to throw them.

    Thanks!

    O ya, forgot to mention, no permissions are needed.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
  2. Offline

    Woobie

    This is why you should use the format.
     
    MrBluebear3 likes this.
  3. Offline

    Techtony96

    Well since i didnt say i wanted permissions, i really used that to bump this thread
     
  4. Offline

    Woobie

    You need to wait 12 hours before bumping the thread. That was only 3 hours.
     
  5. Offline

    Techtony96

    How was that bumping? I was giving more information... :p
     
  6. Offline

    Woobie

    :)
     
    AndyMcB1, Codex Arcanum and np98765 like this.
  7. Offline

    Techtony96

    Can we just stop and get back to the original question?
     
  8. Offline

    Woobie

    [​IMG]
     
  9. Offline

    chakyl

    Awwww...
     
  10. Offline

    Techtony96

    I like that picture. CAT! PROGRAM FOR ME! what? you dont know how? thats ok...
     
  11. Offline

    Techtony96

  12. Offline

    AndyMcB1

    Just a tip, developers are doing this for free. They'll be more likely to help someone that's patient and follows the rules of the forum.
     
  13. Offline

    Techtony96

    What rule did i break? I followed them all....

    O ya, i bumped 30 minutes early... Sorry, i had to go to school :/

    Just trying to keep this on top so more devs can see it.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
  14. Offline

    AndyMcB1

    :)
    Try tagging some of them?
     
  15. Offline

    Woobie

  16. Offline

    Techtony96

    I dont know how to do this, so i asked someone else to do it for me. I made stacker for my personal server, and decided to upload it. I havent updated it lately, i have many new versions, and i wouldnt mind AT ALL if i dont receive the source for this. It was requested on my server, and i tried to figure out how to do this. I couldnt figure out how, and now i am coming here for help.
     
  17. Offline

    Woobie

    Well could i see the source code of the Stacker plugin, so i see how you did it earlier.. and i can try it with potions
     
  18. Offline

    Pinoyskii

    you can do /more techtony and woobie stop spamming other people's posts
     
  19. Offline

    Woobie

    That's not even close to what he wants. /more just gives 64 of whatever the player is holding.
     
  20. Offline

    wristdirect

    I'm new to the dev scene and trying to do some random projects to get my feet wet. This seems like a pretty good one to try. A majority of the requests are pretty intense :p

    Hopefully I'll be able to get something working pretty soon :)

    So how do you want it to handle if the player has a stack of potions and also some unstacked potions and they do /potion?

    For now I'm going to make it so if they have any unstacked potions, /potion adds them to the stacked set. So only if you have no unstacked potions will /potion unstack your stacked set.

    edit: I'm dumb, you probably just want them to have to unstack then with clicks? I guess I'll act under that assumption.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
  21. Offline

    Techtony96

    Here is the source: http://pastie.org/5047573

    BTW: i requested this to made on the forums, and sort of updated it (There was an error when you typed /stack). I'm learning Java now, so i dont 100% understand how this works.
     
  22. Offline

    Woobie

    Techtony96
    Okay ill do this tomorrow, wristdirect fails.
    No.
     
  23. Offline

    Techtony96

  24. Offline

    Woobie

    You should pay attention on what wristdirect says, i dont want to steal this from him:)
     
  25. Offline

    Techtony96

    What do you mean?
     
  26. Offline

    Woobie

    He is trying to make this for you.
     
  27. Offline

    Techtony96

    o ok
    I have a code that adds up all the mushroomsoup in your inventory, takes it out, and then adds it back, and its stacked. The code is above if you want to take a look at it.
     
  28. Offline

    wristdirect

    [quote uid=90712918 name="Woobie" post=1370965]You should pay attention on what wristdirect says, i dont want to steal this from him:)[/quote]

    No problem, I'm doing this mostly just to learn the basics of the Bukkit API. Steal away if you want :p

    [quote uid=90588064 name="Techtony96" post=1370990]
    I have a code that adds up all the mushroomsoup in your inventory, takes it out, and then adds it back, and its stacked. The code is above if you want to take a look at it.[/quote]

    I actually have that part of it finished already, just working on dealing with all the different potion types, as that presents its own problem. And lastly making sure you can't throw then if they're stacked.

    But again, no worries if someone finishes it before me. I'm in it for the learning experience :)

    Ok I have it all finished. Checks for all types of potions and stacks accordingly. Also doesn't allow stacked potions to be thrown :)

    Oh, I didn't check for potion drinking though...well here's this file, I'll get that last part working asap.

    edit: Here's the version with drinking potion checks too.
    <Edit by Moderator: Redacted mediafire url>

    Also, added to BukkitDev, awaiting approval.

    Double Edit!: Btw tony, I did use your basic idea with Stacker for the checking/replacement algorithm. I just added on checks for potions and potion types, then a couple listeners for projectile launching and player consuming events :) And good job on Stacker, I like the idea

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 9, 2016
  29. Offline

    Techtony96

    [quote uid=16593 name="wristdirect" post=1371101]Ok I have it all finished. Checks for all types of potions and stacks accordingly. Also doesn't allow stacked potions to be thrown :)

    Oh, I didn't check for potion drinking though...well here's this file, I'll get that last part working asap.

    edit: Here's the version with drinking potion checks too.
    <Edit by Moderator: Redacted mediafire url>

    Also, added to BukkitDev, awaiting approval.

    Double Edit!: Btw tony, I did use your basic idea with Stacker for the checking/replacement algorithm. I just added on checks for potions and potion types, then a couple listeners for projectile launching and player consuming events :) And good job on Stacker, I like the idea[/quote]
    Thanks for the quick turn around on this!

    Problem though, when i try to type /potion, it says i have no potions to stack, even though i only have 2 potions in my inventory, of the same kind. Not sure what is wrong with it here?

    Also, can i have the source and/or the permission to decompile it? I can give you credit if i put it into my stacker plugin.

    Thanks again!
     
    Last edited by a moderator: Nov 9, 2016
  30. Offline

    wristdirect

    Oh, I see my problem, I forgot to include the base potions.

    I'll add that in and upload the source.

    Here you go!

    <Edit by Moderator: Redacted mediafire url>

    <Edit by Moderator: Redacted mediafire url>

    edit: lol sorry for the constant small changes. I had to make sure I handled the drinking potion listener better. I made sure it only triggered if you were doing a right click event with the potion. It used an event cancelling method, so if you were breaking a block or opening a door (not for long with the door thing!) with a potion in your hand, it might cancel it. Fixed that! :)

    <Edit by Moderator: Redacted mediafire url>

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 9, 2016

Share This Page