mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-02 11:21:15 +01:00
Attempt to prevent exception during first connection
This commit is contained in:
parent
1c65b36087
commit
35973c227e
@ -112,6 +112,13 @@ public class NettyPlayerConnection extends PlayerConnection {
|
||||
*/
|
||||
@Override
|
||||
public void sendPacket(@NotNull ServerPacket serverPacket) {
|
||||
|
||||
// Directly send packet before playing state
|
||||
if (getConnectionState() != ConnectionState.PLAY) {
|
||||
writeAndFlush(serverPacket);
|
||||
return;
|
||||
}
|
||||
|
||||
if (shouldSendPacket(serverPacket)) {
|
||||
if (getPlayer() != null) {
|
||||
// Flush happen during #update()
|
||||
|
Loading…
Reference in New Issue
Block a user