Set declare commands empty

This commit is contained in:
BoomEaro 2022-01-30 12:17:20 +02:00
parent 188d2de0df
commit 5e1bf15fe1
2 changed files with 6 additions and 23 deletions

View File

@ -33,7 +33,6 @@ import java.net.SocketAddress;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
public final class LimboConfig {
@ -51,13 +50,11 @@ public final class LimboConfig {
private boolean useJoinMessage;
private boolean useBossBar;
private boolean useTitle;
private boolean useDeclareCommands;
private boolean usePlayerList;
private String brandName;
private String joinMessage;
private BossBar bossBar;
private Title title;
private List<String> declareCommands;
private InfoForwarding infoForwarding;
private long readTimeout;
@ -90,7 +87,6 @@ public final class LimboConfig {
useJoinMessage = conf.node("joinMessage", "enable").getBoolean();
useBossBar = conf.node("bossBar", "enable").getBoolean();
useTitle = conf.node("title", "enable").getBoolean();
useDeclareCommands = conf.node("declareCommands", "enable").getBoolean();
usePlayerList = conf.node("playerList").getBoolean();
if (useBrandName)
@ -105,9 +101,6 @@ public final class LimboConfig {
if (useTitle)
title = conf.node("title").get(Title.class);
if (useDeclareCommands)
declareCommands = conf.node("declareCommands", "commands").getList(String.class);
infoForwarding = conf.node("infoForwarding").get(InfoForwarding.class);
readTimeout = conf.node("readTimeout").getLong();
debugLevel = conf.node("debugLevel").getInt();
@ -196,10 +189,6 @@ public final class LimboConfig {
return useTitle;
}
public boolean isUseDeclareCommands() {
return useDeclareCommands;
}
public boolean isUsePlayerList() {
return usePlayerList;
}
@ -220,10 +209,6 @@ public final class LimboConfig {
return title;
}
public List<String> getDeclareCommands() {
return declareCommands;
}
public boolean isUseEpoll() {
return useEpoll;
}

View File

@ -50,6 +50,7 @@ import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.util.Collections;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;
@ -243,8 +244,7 @@ public class ClientConnection extends ChannelInboundHandlerAdapter {
}
if (clientVersion.moreOrEqual(Version.V1_13)){
if (PACKET_DECLARE_COMMANDS != null)
writePacket(PACKET_DECLARE_COMMANDS);
writePacket(PACKET_DECLARE_COMMANDS);
if (PACKET_PLUGIN_MESSAGE != null)
@ -429,6 +429,9 @@ public class ClientConnection extends ChannelInboundHandlerAdapter {
info.setGameMode(server.getConfig().getGameMode());
info.setUuid(uuid);
PacketDeclareCommands declareCommands = new PacketDeclareCommands();
declareCommands.setCommands(Collections.emptyList());
PACKET_LOGIN_SUCCESS = PacketSnapshot.of(loginSuccess);
PACKET_JOIN_GAME = PacketSnapshot.of(joinGame);
PACKET_PLAYER_ABILITIES = PacketSnapshot.of(playerAbilities);
@ -438,12 +441,7 @@ public class ClientConnection extends ChannelInboundHandlerAdapter {
PACKET_PLAYER_INFO = PacketSnapshot.of(info);
}
if (server.getConfig().isUseDeclareCommands()) {
PacketDeclareCommands declareCommands = new PacketDeclareCommands();
declareCommands.setCommands(server.getConfig().getDeclareCommands());
PACKET_DECLARE_COMMANDS = PacketSnapshot.of(declareCommands);
}
PACKET_DECLARE_COMMANDS = PacketSnapshot.of(declareCommands);
if (server.getConfig().isUseBrandName()){
PacketPluginMessage pluginMessage = new PacketPluginMessage();