Giter Site home page Giter Site logo

Graphical Bug about protocolize HOT 6 CLOSED

exceptionflug avatar exceptionflug commented on August 10, 2024
Graphical Bug

from protocolize.

Comments (6)

Exceptionflug avatar Exceptionflug commented on August 10, 2024

Hey,

thank you for your interest. Did you already try to cancel the InventoryClickEvent?

from protocolize.

zadrarion avatar zadrarion commented on August 10, 2024

Hello,

Yes, i've cancel the InventoryClickEvent, so when i click on the Item in the fake GUI, nothing happen but when i click on item in my personal Inventory. my item dissapeared.

It's only graphical but it's annoying :/

Thanks for your help :D

from protocolize.

Exceptionflug avatar Exceptionflug commented on August 10, 2024

Hey,

yeah I know what you mean. I will look forward to fix this in the next releasen. Since this is not a critical bug.

from protocolize.

zadrarion avatar zadrarion commented on August 10, 2024

After some try, it would appear that the fake inventories trigger the opening and click event for each click. I don't know if this could help you. If i find any others informations, i will tell you.

from protocolize.

Exceptionflug avatar Exceptionflug commented on August 10, 2024

This will not be implemented.

from protocolize.

galexrt avatar galexrt commented on August 10, 2024

I was able to "workaround" this bug by having Bungeecord send a "message" (I'm using Proton, though Plugin message should work as well) whenever the player presses a slot that is not "managed" by, e.g, the inventory opened. The "message" for simplicity just contains the UUID of the player.

Proxy side code (inventory creation code):

Inventory inventory = new Inventory(InventoryType.GENERIC_9X4);
# For `InventoryType.GENERIC_9X4` the `maxSlot` is 35
int maxSlot = 35;
# ...
inventory.onClick(click -> {
    if (click.slot() > maxSlot) {
      # Send message to server
      return;
    }
    # ...
};

The code on the server side will then when a messages is received from the proxy run:

Player player = getServer().getPlayer(message.getUuid());
player.updateInventory();

It isn't perfect but making it much better than when the items simply disappear.
It is probably a good idea to add a "debounce" / cooldown / queue logic on the server side to only update the inventory every few ticks / seconds and not on every click.

Would be cool if that graphical bug could be fixed somehow without creating a "system" like that.

from protocolize.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.