Skip to content

GH-1298 Add tpa event api#1298

Open
vLuckyyy wants to merge 6 commits intomasterfrom
add-tpa-event-api
Open

GH-1298 Add tpa event api#1298
vLuckyyy wants to merge 6 commits intomasterfrom
add-tpa-event-api

Conversation

@vLuckyyy
Copy link
Member

@vLuckyyy vLuckyyy commented Feb 9, 2026

No description provided.

@vLuckyyy vLuckyyy requested a review from a team as a code owner February 9, 2026 21:21
@vLuckyyy vLuckyyy changed the title Add tpa event api GH-1298 Add tpa event api Feb 9, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new API for teleportation request events (PreTeleportRequestEvent and TeleportRequestEvent) and integrates them into the existing tpa and tpahere commands. The changes are logical and the new event API is well-defined.

However, I've found a few issues:

  • There are duplicate registrations of a command and a listener in the example plugin, which could lead to bugs.
  • More critically, there are several instances where a synchronous Bukkit event is being called from an asynchronous thread. This is a significant threading issue that can cause server instability and must be addressed.

My review includes detailed comments on these points with suggestions for how to resolve them.

Comment on lines 13 to 14
final Player sender = event.getSender();
final Player target = event.getTarget();
Copy link
Member

Choose a reason for hiding this comment

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

Why is there a need to explicitly declare final?

Suggested change
final Player sender = event.getSender();
final Player target = event.getTarget();
Player sender = event.getSender();
Player target = event.getTarget();

Copy link
Member

@Rollczi Rollczi left a comment

Choose a reason for hiding this comment

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

trzeba te eventy ogarnąć bo one są wołane async, a deklaracja jest false w konstruktorze - pytanie czy w sumie chcemy async może wolimy to sync dać

@vLuckyyy vLuckyyy requested review from Jakubk15 and Rollczi February 27, 2026 19:16
Comment on lines +22 to +27
/*
if (!countryService.areInSameCountry(sender, target)) {
sender.sendMessage("You are not in the same country!");
event.setCancelled(true);
}
*/
Copy link
Member

Choose a reason for hiding this comment

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

???

Suggested change
/*
if (!countryService.areInSameCountry(sender, target)) {
sender.sendMessage("You are not in the same country!");
event.setCancelled(true);
}
*/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants