Skip to content

Commit

Permalink
Use temp var
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Sep 13, 2024
1 parent 0d61334 commit 1dc95d8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ public void packetReceived(Session session, Packet packet) {
} else if (packet instanceof ClientboundLoginDisconnectPacket loginDisconnectPacket) {
session.disconnect(loginDisconnectPacket.getReason());
} else if (packet instanceof ClientboundLoginCompressionPacket loginCompressionPacket) {
session.setCompression(loginCompressionPacket.getThreshold() >= 0 ?
new CompressionConfig(loginCompressionPacket.getThreshold(), new ZlibCompression(), false) : null);
int threshold = loginCompressionPacket.getThreshold();
session.setCompression(threshold >= 0 ?
new CompressionConfig(threshold, new ZlibCompression(), false) : null);
}
} else if (protocol.getState() == ProtocolState.STATUS) {
if (packet instanceof ClientboundStatusResponsePacket statusResponsePacket) {
Expand Down

0 comments on commit 1dc95d8

Please sign in to comment.