Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MiGoYAm committed Dec 23, 2021
1 parent d49a16b commit e6bcee3
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/main/java/ru/nanit/limbo/connection/ClientConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import ru.nanit.limbo.protocol.registry.State;
import ru.nanit.limbo.protocol.registry.Version;
import ru.nanit.limbo.server.LimboServer;
import ru.nanit.limbo.server.data.InfoForwarding;
import ru.nanit.limbo.server.data.Title;
import ru.nanit.limbo.util.Logger;
import ru.nanit.limbo.util.UuidUtil;
Expand Down Expand Up @@ -224,7 +223,7 @@ private void fireLoginSuccess() {
if (clientVersion.moreOrEqual(Version.V1_13)){
writePacket(PACKET_DECLARE_COMMANDS);

if(PACKET_PLUGIN_MESSAGE != null)
if (PACKET_PLUGIN_MESSAGE != null)
writePacket(PACKET_PLUGIN_MESSAGE);
}

Expand Down Expand Up @@ -406,17 +405,15 @@ public static void initPackets(LimboServer server) {
info.setGameMode(server.getConfig().getGameMode());
info.setUuid(uuid);

PacketDeclareCommands declareCommands = new PacketDeclareCommands();
declareCommands.setCommands(Collections.emptyList());

PACKET_LOGIN_SUCCESS = PreEncodedPacket.of(loginSuccess);
PACKET_JOIN_GAME = PreEncodedPacket.of(joinGame);
PACKET_PLAYER_ABILITIES = PreEncodedPacket.of(playerAbilities);
PACKET_PLAYER_POS = PreEncodedPacket.of(positionAndLook);
PACKET_PLAYER_INFO = PreEncodedPacket.of(info);

if (!server.getConfig().getInfoForwarding().isNone()){// or server.getConfig().getInfoForwarding().getType() != InfoForwarding.Type.NONE
PacketDeclareCommands declareCommands = new PacketDeclareCommands();
declareCommands.setCommands(Collections.emptyList());
PACKET_DECLARE_COMMANDS = PreEncodedPacket.of(declareCommands);
}
PACKET_DECLARE_COMMANDS = PreEncodedPacket.of(declareCommands);

if (server.getConfig().isUseBrandName()){
PacketPluginMessage pluginMessage = new PacketPluginMessage();
Expand Down

0 comments on commit e6bcee3

Please sign in to comment.