3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-12-24 23:30:26 +01:00

Snapshot 21w44a

Dieser Commit ist enthalten in:
Five (Xer) 2021-11-12 10:53:26 +01:00
Ursprung 9f82af7d31
Commit 315ff265c6
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 37DED8CFF428E1A4
3 geänderte Dateien mit 22 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -56,7 +56,7 @@ public enum ProtocolVersion {
MINECRAFT_1_16_4(754, "1.16.4", "1.16.5"),
MINECRAFT_1_17(755, "1.17"),
MINECRAFT_1_17_1(756, "1.17.1"),
MINECRAFT_1_18(-1, 47, "1.18"); // Snapshot: 21w43a, future protocol: 757
MINECRAFT_1_18(-1, 48, "1.18"); // Snapshot: 21w44a, future protocol: 757
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 {
static final PlayerSettings DEFAULT = new ClientSettingsWrapper(
new ClientSettings("en_US", (byte) 10, 0, true, (short) 127, 1, true));
new ClientSettings("en_US", (byte) 10, 0, true, (short) 127, 1, true, false));
private final ClientSettings settings;
private final SkinParts parts;

Datei anzeigen

@ -34,18 +34,20 @@ public class ClientSettings implements MinecraftPacket {
private short skinParts;
private int mainHand;
private boolean chatFilteringEnabled; // Added in 1.17
private boolean clientListingAllowed; // Added in 1.18, overwrites server-list "anonymous" mode
public ClientSettings() {
}
public ClientSettings(String locale, byte viewDistance, int chatVisibility, boolean chatColors,
short skinParts, int mainHand, boolean chatFilteringEnabled) {
short skinParts, int mainHand, boolean chatFilteringEnabled, boolean clientListingAllowed) {
this.locale = locale;
this.viewDistance = viewDistance;
this.chatVisibility = chatVisibility;
this.chatColors = chatColors;
this.skinParts = skinParts;
this.mainHand = mainHand;
this.clientListingAllowed = clientListingAllowed;
}
public String getLocale() {
@ -107,6 +109,14 @@ public class ClientSettings implements MinecraftPacket {
this.chatFilteringEnabled = chatFilteringEnabled;
}
public boolean isClientListingAllowed() {
return clientListingAllowed;
}
public void setClientListingAllowed(boolean clientListingAllowed) {
this.clientListingAllowed = clientListingAllowed;
}
@Override
public String toString() {
return "ClientSettings{"
@ -117,6 +127,7 @@ public class ClientSettings implements MinecraftPacket {
+ ", skinParts=" + skinParts
+ ", mainHand=" + mainHand
+ ", chatFilteringEnabled=" + chatFilteringEnabled
+ ", clientListingAllowed=" + clientListingAllowed
+ '}';
}
@ -138,6 +149,10 @@ public class ClientSettings implements MinecraftPacket {
if (version.compareTo(ProtocolVersion.MINECRAFT_1_17) >= 0) {
this.chatFilteringEnabled = buf.readBoolean();
if (version.compareTo(ProtocolVersion.MINECRAFT_1_18) >= 0) {
this.clientListingAllowed = buf.readBoolean();
}
}
}
}
@ -163,6 +178,10 @@ public class ClientSettings implements MinecraftPacket {
if (version.compareTo(ProtocolVersion.MINECRAFT_1_17) >= 0) {
buf.writeBoolean(chatFilteringEnabled);
if (version.compareTo(ProtocolVersion.MINECRAFT_1_18) >= 0) {
buf.writeBoolean(clientListingAllowed);
}
}
}
}