ClickType WINDOW_BORDER

Discussion in 'Plugin Development' started by krisdestruction, Aug 31, 2014.

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

    krisdestruction

    Hi,

    I was wondering what the following click types were during an InventoryClickEvent. I tried clicking the perimeter of the inventory and it doesn't seem to fire.
    ClickType.WINDOW_BORDER_RIGHT - Clicking the right mouse button on the grey area around the inventory.
    ClickType.WINDOW_BORDER_LEFT - Clicking the left mouse button on the grey area around the inventory.

    I'm trying to see if these click types can be used for page navigation or something. Any good description or screenshot would be greatly appreciated!
     
  2. Offline

    TheMintyMate

    Enum ClickType:
    http://jd.bukkit.org/rb/apidocs/org/bukkit/event/inventory/ClickType.html


    Took a look in the JavaDoc's:
    http://jd.bukkit.org/rb/apidocs/src-html/org/bukkit/event/inventory/ClickType.html#line.28

    I also took a look through a few other threads:
    https://forums.bukkit.org/threads/detecting-click-type.163323/

    Are your sure your conditions are correct? (post code?)

    Hope this helped,
    - Minty
     
    hintss likes this.
  3. Offline

    krisdestruction

    TheMintyMate
    Oh do you mean the outside of the inventory? I did try that too and Inventory.getSlotType shows SlotType.OUTSIDE.

    My code simpe and is as follows. I am using Spigot b1518 which should be implementing API 1.7.9 R0.3-SNAPSHOT.
    Code:java
    1.  
    2. @EventHandler( priority = EventPriority.LOWEST )
    3. public void onInventoryClick( InventoryClickEvent event ) {
    4. plugin.getLogger().info( "Event fire" );
    5. if( event.getClick() == ClickType.WINDOW_BORDER_LEFT || event.getClick() ==
    6. ClickType.WINDOW_BORDER_RIGHT )
    7. plugin.getLogger().info( event.getClick().toString() );
    8. }
    9.  


    So "Event fire" fires, and the if statement doesn't fire when I click outside the inv.
     
  4. Offline

    TheMintyMate

    Have you tried clicking the right mouse button on the grey area around the inventory?
    Code:
    WINDOW_BORDER_LEFT,
    /**
    * Clicking the right mouse button on the grey area around the
    * inventory.
    */
    
    +Source

    Hope this helped,
    - Minty
     
    hintss likes this.
  5. Offline

    krisdestruction

    Yes, my previous post says that I did. Unfortunately it doesn't work for me :(
     
  6. Offline

    TheMintyMate

    Interesting...

    Edit: I may test this out my self later.
     
  7. Offline

    krisdestruction

    TheMintyMate

    Please let me know how it goes. If you do manage to get it working, a screenshot of where you clicked would really help XD However I feel that this is depreciated code that was never marked in the API...

    It would really be nice to scroll inventory menus or something if I can get it working!
     
  8. Offline

    TheMintyMate

    Will do!

    - Minty
     
Thread Status:
Not open for further replies.

Share This Page