Skip to content

Commit

Permalink
Restrict WorldIdHandler to only send the packet on a request
Browse files Browse the repository at this point in the history
  • Loading branch information
turikhay committed Sep 7, 2022
1 parent 4e19b05 commit 29c5b65
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ public void init() {

@Override
public void scheduleLevelIdPacket(Runnable r, EventSource source) {
long delay = source == EventSource.PLUGIN_MESSAGE ? 0L : 20L * WORLD_ID_PACKET_DELAY;
plugin.getServer().getScheduler().runTaskLater(plugin, r, delay);
if (source != EventSource.PLUGIN_MESSAGE) {
// This handler should only send worldId on a request
return;
}
r.run();
}

@Override
Expand Down

0 comments on commit 29c5b65

Please sign in to comment.