mirror of
https://github.com/Nan1t/NanoLimbo.git
synced 2025-07-12 12:40:14 +02:00
Changed updateState method called only once to more suitable
This commit is contained in:
parent
9659b4500a
commit
bcf8e0ebf2
@ -186,7 +186,7 @@ public class ClientConnection extends ChannelInboundHandlerAdapter {
|
||||
}
|
||||
|
||||
writePacket(PACKET_LOGIN_SUCCESS);
|
||||
updateState(State.PLAY);
|
||||
setPlayState();
|
||||
|
||||
server.getConnections().addConnection(this);
|
||||
|
||||
@ -239,10 +239,12 @@ public class ClientConnection extends ChannelInboundHandlerAdapter {
|
||||
return channel.isActive();
|
||||
}
|
||||
|
||||
private void updateState(State state) {
|
||||
this.state = state;
|
||||
channel.pipeline().get(PacketDecoder.class).updateState(state);
|
||||
channel.pipeline().get(PacketEncoder.class).updateState(state);
|
||||
private void setPlayState() {
|
||||
this.state = State.PLAY;
|
||||
channel.pipeline().get(PacketDecoder.class)
|
||||
.updateState(this.state);
|
||||
channel.pipeline().get(PacketEncoder.class)
|
||||
.updateState(this.state);
|
||||
}
|
||||
|
||||
public void updateStateAndVersion(State state, Version version){
|
||||
|
Loading…
x
Reference in New Issue
Block a user