How do I stop the mouse position reset when opening inventories?

Discussion in 'Spigot Plugin Development' started by TheCrystalStar, Sep 15, 2018 at 2:12 AM.

Thread Status:
Not open for further replies.
  1. For Example

    I have this inventory open the red circle being my cursor
    http://prntscr.com/kul4in

    If I have that inventory reopened for that user, the cursor would be reset to :
    http://prntscr.com/kul4oj

    So to the bottom middle of the inventory.

    Possible solutions I've tried w/o success:
    1. Simply reopening the inventory (p.openInventory()) while they have it opened already
    2. Closing then opening, definitely won't work
    You may ask, why not just update the contents of the inventory, well having hundreds of items in a list that is being divided into more list of around 45 to be then organized on the gui for the pagination system, is simply causing too much of a hassle to make it worth the effort.

    Any thoughts / ideas?
     
  2. I think the only way to do that is to update the inventory contents, as far as I know there's no way for the server to set the mouse position and/or keep the mouse position.
     
    • Agree Agree x 1
  3. 2008Choco

    Junior Mod

    Edit the client or write a client mod. That's unfortunately just how the client handles the mouse position. It centers the mouse indefinitely to the middle of your display.
     
  4. I think you have a design flaw if you cannot come up with a way to do this object-orientated rather than some hacky way of moving the cursor. Attack the problem head-on rather than easy shortcuts.
     
  5. Welp, looks like i'm going to have to update the contents instead, I'll see how it goes and post an update whenever I finish it.
    Thanks for all the help!
     
Thread Status:
Not open for further replies.

Share This Page