Spigot & Paperspigot not working both

Discussion in 'Spigot Plugin Development' started by Nighterance, Apr 29, 2017.

  1. Hello! So I have a freeze gui plugin, that opens gui all the time for players, that are in certain group(frozen). I do this with bukkit scheduler. Everything works perfectly on spigot, but my friend uses paperspigot, and there, all the time coursor moves to center of inventory, despite if I close inventory or I do not.
    Anyone has any idea to fix this? So coursor does not stay fixed in one spot ( propobly since I am reopening inventory all the time, but it must be like that)
    Thank you guys :)
     
  2. Your title has nothing to do with your question?
    I´m also not aware if Paperspigot is supported here, but i can tell you that this is not possible if you close the inventory.
     
  3. Only reopen the inventory once someone closes it
     
  4. How to do that? I tryed with InventoryCloseEvent, but 1) It is not ment to work like that 2) It did not work.
     
  5. Just like you do it right now, but without HumanEntity#closeInventory()
     
  6. But the thing is, it does not close inventory at all, all it does it just opens it all time so player can't escape from it. On spigot that works fine, but on paperspigot that doesnt, maybe any different idea?
     
  7. Mas

    Mas

    It will work if you do it correctly. Using a scheduler to constantly open the inventory is way more intensive and will have pretty much no advantage over just re-opening the inventory when someone closes it.
     
  8. Could you lead me maybe in correct direction? Thanks! (Tryed by checking if player ir frozen and if yes (on inv close) open inventory)
     
  9. on close event:
    if player should be frozen:
    make a runnable that will open an inventory to him in 1 tick
     
    • Agree Agree x 1
  10. When i wil be home i will try that again, but i feel that i already tested it. Thanks
     
  11. Check if the player has an open inventory, if they don't, then open the inventory. This way they won't be constantly opening an inventory and it won't effect the mouse.
     
  12. I tryed this with this method

    if(!(p.getInventory().getName()).equals(ChatColor.GREEN + "Frozen GUI")){
    open inventory for player

    but it still did not work, somewhy


    Woops, did wrong thing, now it works fine, thanks ! :)
     
    #12 Nighterance, Apr 29, 2017
    Last edited: Apr 29, 2017
    • Like Like x 1