Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Snapshot 21w44a
Dieser Commit ist enthalten in:
Ursprung
9f82af7d31
Commit
315ff265c6
@ -56,7 +56,7 @@ public enum ProtocolVersion {
|
|||||||
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(755, "1.17"),
|
MINECRAFT_1_17(755, "1.17"),
|
||||||
MINECRAFT_1_17_1(756, "1.17.1"),
|
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;
|
private static final int SNAPSHOT_BIT = 30;
|
||||||
|
|
||||||
|
@ -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, true));
|
new ClientSettings("en_US", (byte) 10, 0, true, (short) 127, 1, true, false));
|
||||||
|
|
||||||
private final ClientSettings settings;
|
private final ClientSettings settings;
|
||||||
private final SkinParts parts;
|
private final SkinParts parts;
|
||||||
|
@ -34,18 +34,20 @@ public class ClientSettings implements MinecraftPacket {
|
|||||||
private short skinParts;
|
private short skinParts;
|
||||||
private int mainHand;
|
private int mainHand;
|
||||||
private boolean chatFilteringEnabled; // Added in 1.17
|
private boolean chatFilteringEnabled; // Added in 1.17
|
||||||
|
private boolean clientListingAllowed; // Added in 1.18, overwrites server-list "anonymous" mode
|
||||||
|
|
||||||
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, boolean chatFilteringEnabled) {
|
short skinParts, int mainHand, boolean chatFilteringEnabled, boolean clientListingAllowed) {
|
||||||
this.locale = locale;
|
this.locale = locale;
|
||||||
this.viewDistance = viewDistance;
|
this.viewDistance = viewDistance;
|
||||||
this.chatVisibility = chatVisibility;
|
this.chatVisibility = chatVisibility;
|
||||||
this.chatColors = chatColors;
|
this.chatColors = chatColors;
|
||||||
this.skinParts = skinParts;
|
this.skinParts = skinParts;
|
||||||
this.mainHand = mainHand;
|
this.mainHand = mainHand;
|
||||||
|
this.clientListingAllowed = clientListingAllowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLocale() {
|
public String getLocale() {
|
||||||
@ -107,6 +109,14 @@ public class ClientSettings implements MinecraftPacket {
|
|||||||
this.chatFilteringEnabled = chatFilteringEnabled;
|
this.chatFilteringEnabled = chatFilteringEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isClientListingAllowed() {
|
||||||
|
return clientListingAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClientListingAllowed(boolean clientListingAllowed) {
|
||||||
|
this.clientListingAllowed = clientListingAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "ClientSettings{"
|
return "ClientSettings{"
|
||||||
@ -117,6 +127,7 @@ public class ClientSettings implements MinecraftPacket {
|
|||||||
+ ", skinParts=" + skinParts
|
+ ", skinParts=" + skinParts
|
||||||
+ ", mainHand=" + mainHand
|
+ ", mainHand=" + mainHand
|
||||||
+ ", chatFilteringEnabled=" + chatFilteringEnabled
|
+ ", chatFilteringEnabled=" + chatFilteringEnabled
|
||||||
|
+ ", clientListingAllowed=" + clientListingAllowed
|
||||||
+ '}';
|
+ '}';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,6 +149,10 @@ public class ClientSettings implements MinecraftPacket {
|
|||||||
|
|
||||||
if (version.compareTo(ProtocolVersion.MINECRAFT_1_17) >= 0) {
|
if (version.compareTo(ProtocolVersion.MINECRAFT_1_17) >= 0) {
|
||||||
this.chatFilteringEnabled = buf.readBoolean();
|
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) {
|
if (version.compareTo(ProtocolVersion.MINECRAFT_1_17) >= 0) {
|
||||||
buf.writeBoolean(chatFilteringEnabled);
|
buf.writeBoolean(chatFilteringEnabled);
|
||||||
|
|
||||||
|
if (version.compareTo(ProtocolVersion.MINECRAFT_1_18) >= 0) {
|
||||||
|
buf.writeBoolean(clientListingAllowed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren