Skip to content

Commit

Permalink
Throw IllegalStateException
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
Kas-tle authored Sep 25, 2023
1 parent 2c52392 commit 55c03e3
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected void setNewIp(Channel channel, InetSocketAddress newIp) {
}

@Override
protected Object setHostname(Object handshakePacket, String hostname) {
protected Object setHostname(Object handshakePacket, String hostname) throws IllegalStateException {
if (ClassNames.IS_PRE_1_20_2) {
// 1.20.1 and below
setValue(handshakePacket, ClassNames.HANDSHAKE_HOST, hostname);
Expand All @@ -76,9 +76,7 @@ protected Object setHostname(Object handshakePacket, String hostname) {

return ClassNames.HANDSHAKE_PACKET_CONSTRUCTOR.newInstance(components);
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
e.printStackTrace();

return handshakePacket;
throw new IllegalStateException("Failed to create new Handshake packet", e);
}
}
}
Expand Down

0 comments on commit 55c03e3

Please sign in to comment.