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

View File

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