Coder Social home page Coder Social logo

Comments (4)

Matt-MX avatar Matt-MX commented on June 20, 2024

In the InventoryGui class we can see the event is cancelled ((here))

I'm really not sure what is causing this. Are the items the user moves ghost items when they exit the gui? If so that is even more strange.

from servergui.

Terminal-Access avatar Terminal-Access commented on June 20, 2024

In the InventoryGui class we can see the event is cancelled ((here))

I'm really not sure what is causing this. Are the items the user moves ghost items when they exit the gui? If so that is even more strange.

having looked at the code there i think the cancel click event is being called to early, from my understanding of that code its being called and canceled when the gui is opened.

instead it should be called during the onClick() event of an opened gui.

example: add the cansel event click at the beginning of this then do ur custom click event code after.

public void onClick(InventoryClick click) {
if (clickEvent != null) clickEvent.accept(this, click);
ItemButton button = slot(click.slot());
if (button != null) button.click(click);
}

this might be where this bug is arising from.

from servergui.

Matt-MX avatar Matt-MX commented on June 20, 2024

In the build function we call i.onClick(this::onClickCancel); which registers the click callback to the onClickCancel(InventoryClick e) function.

This is only called when a player clicks it.

from servergui.

Terminal-Access avatar Terminal-Access commented on June 20, 2024

In the build function we call i.onClick(this::onClickCancel); which registers the click callback to the onClickCancel(InventoryClick e) function.

This is only called when a player clicks it.

Checking over your code the only place that I can see where "i.onClick(this::onClickCancel);" is two functions:

public void open(Player player) public void openSync(Player player) {

Both of thease only handle the opening of the GUI Interface, and do not conver any GUI interaction events sutch as (onClick) event.

from servergui.

Related Issues (13)

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.