Skip to content

Commit 8638ae3

Browse files
committed
Add Floodgate prefix for internal FastLogin checks
1 parent 849c359 commit 8638ae3

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/ProtocolLibListener.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,17 @@ private void onLoginStart(PacketEvent packetEvent, Player player, String usernam
231231
plugin.removeSession(player.getAddress());
232232

233233
PacketContainer packet = packetEvent.getPacket();
234+
235+
//floodgate event listeners may run after our event listener
236+
if (plugin.getFloodgateService() != null) {
237+
FloodgatePlayer floodgatePlayer = getFloodgatePlayer(packetEvent.getPlayer());
238+
if (floodgatePlayer != null) {
239+
//add the floodgate prefix for our internal checks
240+
//the correct username will be written to the packet by Floodgate
241+
username = floodgatePlayer.getCorrectUsername();
242+
}
243+
}
244+
234245
Optional<ClientPublicKey> clientKey;
235246
if (new MinecraftVersion(1, 19, 3).atOrAbove()) {
236247
// public key is sent separate

0 commit comments

Comments
 (0)