forked from TuxCoding/FastLogin
Extract protocollib method detection
This commit is contained in:
@ -80,7 +80,7 @@ public class ProtocolLibListener extends PacketAdapter {
|
||||
return;
|
||||
}
|
||||
|
||||
if (packetEvent.getPacket().getMeta(SOURCE_META_KEY).map(val -> val.equals(plugin.getName())).orElse(false)) {
|
||||
if (isFastLoginPacket(packetEvent)) {
|
||||
// this is our own packet
|
||||
return;
|
||||
}
|
||||
@ -99,6 +99,12 @@ public class ProtocolLibListener extends PacketAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
private Boolean isFastLoginPacket(PacketEvent packetEvent) {
|
||||
return packetEvent.getPacket().getMeta(SOURCE_META_KEY)
|
||||
.map(val -> val.equals(plugin.getName()))
|
||||
.orElse(false);
|
||||
}
|
||||
|
||||
private void onEncryptionBegin(PacketEvent packetEvent, Player sender) {
|
||||
byte[] sharedSecret = packetEvent.getPacket().getByteArrays().read(0);
|
||||
|
||||
|
Reference in New Issue
Block a user