Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dividing TabCompleteEvent into TabCompleteRequestEvent and TabCompleteResultEvent #1509

Open
wants to merge 2 commits into
base: dev/3.0.0
Choose a base branch
from

Conversation

Hexsook
Copy link

@Hexsook Hexsook commented Feb 9, 2025

As you can see, TabCompleteEvent is now deprecated and is divided into TabCompleteRequestEvent and TabCompleteResultEvent.

@@ -783,6 +790,20 @@ private void finishRegularTabComplete(TabCompleteRequestPacket request,
request, response, ex);
return null;
});
server.getEventManager().fire(new TabCompleteResultEvent(player, request.getCommand(), offers))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this event for?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used to distinguish from the previous TabCompleteEvent and improve the recognition of the function (that is, triggered when the server produces a result in response to a tab request), although the logic is almost the same as TabCompleteEvent

Copy link

@novitpw novitpw Feb 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least I don't see any use for this event, since TabCompleteEvent allows you to do everything you need. Maybe you just didn't delete the code above? If so, I advise you to reconsider the event names.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do have a point. So I've restored TabCompleteEvent and removed TabCompleteResultEvent in the latest commit, since the two classes do essentially the same thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants