Solved Double click Inventory problems

Discussion in 'Plugin Development' started by Tdarnell, Jul 28, 2013.

Thread Status:
Not open for further replies.
  1. I have recently finished a massive project for the server I'm working with, but have found a flaw in it.

    (some context: The plugin is a shop within an inventory, It will not be made public)
    if you press shift and double click an item it will attempt to buy all of the stacks in the inventory at once, and due to the nature of the plugin, that means there will be a #@*% ton of items on the ground around the user. most likely crashing their client.

    How can I detect a double click event in an inventory so as to cancel it??
    The only theory I have come up with so for to counter my problems is to make a cooldown for buying items, but It seems counterproductive when there should be something in bukkit to handle this!

    So my question to you is, how can I determine the difference between a double shift click on an item that attempts to send all items of that type into your inventory and two normal shift clicks?

    All help is appreciated, as usual :)
     
  2. Offline

    Jade

    Moved to correct section.
     
  3. Sorry, I thought as I was asking if there was a way to do this using a bukkit event not asking for direct plugin help that I had put it in the right place. I guess I was wrong :p
     
  4. Offline

    Jade

  5. Offline

    xTrollxDudex

    Tdarnell
    See if the click type is ClickType.DOUBLE_CLICK and isShiftClick() == true on InventoryClickEvent
     
  6. Thank you, I had no idea ClickType even existed, that will make this a lot easier :)
     
  7. Offline

    xTrollxDudex

Thread Status:
Not open for further replies.

Share This Page