3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 05:20:14 +01:00

Snapshot 21w07a

Dieser Commit ist enthalten in:
Five (Xer) 2021-02-18 22:02:26 +01:00 committet von FivePB
Ursprung c9e92bcc53
Commit b19cf16345
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 37DED8CFF428E1A4
3 geänderte Dateien mit 21 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -54,7 +54,7 @@ public enum ProtocolVersion {
MINECRAFT_1_16_2(751, "1.16.2"), MINECRAFT_1_16_2(751, "1.16.2"),
MINECRAFT_1_16_3(753, "1.16.3"), MINECRAFT_1_16_3(753, "1.16.3"),
MINECRAFT_1_16_4(754, "1.16.4", "1.16.5"), MINECRAFT_1_16_4(754, "1.16.4", "1.16.5"),
MINECRAFT_1_17(-1, 14, "1.17"); // Snapshot: 21w06a, future protocol: 755 MINECRAFT_1_17(-1, 15, "1.17"); // Snapshot: 21w07a, future protocol: 755
private static final int SNAPSHOT_BIT = 30; private static final int SNAPSHOT_BIT = 30;

Datei anzeigen

@ -26,7 +26,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
public class ClientSettingsWrapper implements PlayerSettings { public class ClientSettingsWrapper implements PlayerSettings {
static final PlayerSettings DEFAULT = new ClientSettingsWrapper( static final PlayerSettings DEFAULT = new ClientSettingsWrapper(
new ClientSettings("en_US", (byte) 10, 0, true, (short) 127, 1)); new ClientSettings("en_US", (byte) 10, 0, true, (short) 127, 1, true));
private final ClientSettings settings; private final ClientSettings settings;
private final SkinParts parts; private final SkinParts parts;

Datei anzeigen

@ -33,12 +33,13 @@ public class ClientSettings implements MinecraftPacket {
private byte difficulty; // 1.7 Protocol private byte difficulty; // 1.7 Protocol
private short skinParts; private short skinParts;
private int mainHand; private int mainHand;
private boolean chatFilteringEnabled; // Added in 1.17
public ClientSettings() { public ClientSettings() {
} }
public ClientSettings(String locale, byte viewDistance, int chatVisibility, boolean chatColors, public ClientSettings(String locale, byte viewDistance, int chatVisibility, boolean chatColors,
short skinParts, int mainHand) { short skinParts, int mainHand, boolean chatFilteringEnabled) {
this.locale = locale; this.locale = locale;
this.viewDistance = viewDistance; this.viewDistance = viewDistance;
this.chatVisibility = chatVisibility; this.chatVisibility = chatVisibility;
@ -98,6 +99,14 @@ public class ClientSettings implements MinecraftPacket {
this.mainHand = mainHand; this.mainHand = mainHand;
} }
public boolean isChatFilteringEnabled() {
return chatFilteringEnabled;
}
public void setChatFilteringEnabled(boolean chatFilteringEnabled) {
this.chatFilteringEnabled = chatFilteringEnabled;
}
@Override @Override
public String toString() { public String toString() {
return "ClientSettings{" return "ClientSettings{"
@ -107,6 +116,7 @@ public class ClientSettings implements MinecraftPacket {
+ ", chatColors=" + chatColors + ", chatColors=" + chatColors
+ ", skinParts=" + skinParts + ", skinParts=" + skinParts
+ ", mainHand=" + mainHand + ", mainHand=" + mainHand
+ ", chatFilteringEnabled=" + chatFilteringEnabled
+ '}'; + '}';
} }
@ -125,6 +135,10 @@ public class ClientSettings implements MinecraftPacket {
if (version.compareTo(ProtocolVersion.MINECRAFT_1_9) >= 0) { if (version.compareTo(ProtocolVersion.MINECRAFT_1_9) >= 0) {
this.mainHand = ProtocolUtils.readVarInt(buf); this.mainHand = ProtocolUtils.readVarInt(buf);
if (version.compareTo(ProtocolVersion.MINECRAFT_1_17) >= 0) {
this.chatFilteringEnabled = buf.readBoolean();
}
} }
} }
@ -146,6 +160,10 @@ public class ClientSettings implements MinecraftPacket {
if (version.compareTo(ProtocolVersion.MINECRAFT_1_9) >= 0) { if (version.compareTo(ProtocolVersion.MINECRAFT_1_9) >= 0) {
ProtocolUtils.writeVarInt(buf, mainHand); ProtocolUtils.writeVarInt(buf, mainHand);
if (version.compareTo(ProtocolVersion.MINECRAFT_1_17) >= 0) {
buf.writeBoolean(chatFilteringEnabled);
}
} }
} }