Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-16 21:10:30 +01:00
Snapshot 21w07a
Dieser Commit ist enthalten in:
Ursprung
c9e92bcc53
Commit
b19cf16345
@ -54,7 +54,7 @@ public enum ProtocolVersion {
|
||||
MINECRAFT_1_16_2(751, "1.16.2"),
|
||||
MINECRAFT_1_16_3(753, "1.16.3"),
|
||||
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;
|
||||
|
||||
|
@ -26,7 +26,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
public class ClientSettingsWrapper implements PlayerSettings {
|
||||
|
||||
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 SkinParts parts;
|
||||
|
@ -33,12 +33,13 @@ public class ClientSettings implements MinecraftPacket {
|
||||
private byte difficulty; // 1.7 Protocol
|
||||
private short skinParts;
|
||||
private int mainHand;
|
||||
private boolean chatFilteringEnabled; // Added in 1.17
|
||||
|
||||
public ClientSettings() {
|
||||
}
|
||||
|
||||
public ClientSettings(String locale, byte viewDistance, int chatVisibility, boolean chatColors,
|
||||
short skinParts, int mainHand) {
|
||||
short skinParts, int mainHand, boolean chatFilteringEnabled) {
|
||||
this.locale = locale;
|
||||
this.viewDistance = viewDistance;
|
||||
this.chatVisibility = chatVisibility;
|
||||
@ -98,6 +99,14 @@ public class ClientSettings implements MinecraftPacket {
|
||||
this.mainHand = mainHand;
|
||||
}
|
||||
|
||||
public boolean isChatFilteringEnabled() {
|
||||
return chatFilteringEnabled;
|
||||
}
|
||||
|
||||
public void setChatFilteringEnabled(boolean chatFilteringEnabled) {
|
||||
this.chatFilteringEnabled = chatFilteringEnabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ClientSettings{"
|
||||
@ -107,6 +116,7 @@ public class ClientSettings implements MinecraftPacket {
|
||||
+ ", chatColors=" + chatColors
|
||||
+ ", skinParts=" + skinParts
|
||||
+ ", mainHand=" + mainHand
|
||||
+ ", chatFilteringEnabled=" + chatFilteringEnabled
|
||||
+ '}';
|
||||
}
|
||||
|
||||
@ -125,6 +135,10 @@ public class ClientSettings implements MinecraftPacket {
|
||||
|
||||
if (version.compareTo(ProtocolVersion.MINECRAFT_1_9) >= 0) {
|
||||
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) {
|
||||
ProtocolUtils.writeVarInt(buf, mainHand);
|
||||
|
||||
if (version.compareTo(ProtocolVersion.MINECRAFT_1_17) >= 0) {
|
||||
buf.writeBoolean(chatFilteringEnabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren