From ac92de8a0e159b4625957d76a831293896529090 Mon Sep 17 00:00:00 2001 From: "Five (Xer)" Date: Sat, 25 Sep 2021 13:43:47 +0200 Subject: [PATCH 01/15] Snapshot 21w37a --- .../java/com/velocitypowered/api/network/ProtocolVersion.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java index bdddd586d..d9cd15c15 100644 --- a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java +++ b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java @@ -55,7 +55,8 @@ public enum ProtocolVersion { MINECRAFT_1_16_3(753, "1.16.3"), 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_17_1(756, "1.17.1"), + MINECRAFT_1_18(-1, 41, "1.18"); // Snapshot: 21w37a, future protocol: 757 private static final int SNAPSHOT_BIT = 30; From 0896d66ac28d77e75d5addac0a069c3ab1f60160 Mon Sep 17 00:00:00 2001 From: "Five (Xer)" Date: Sat, 25 Sep 2021 13:45:46 +0200 Subject: [PATCH 02/15] Snapshot 21w38a --- .../java/com/velocitypowered/api/network/ProtocolVersion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java index d9cd15c15..9207a6bbf 100644 --- a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java +++ b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java @@ -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, 41, "1.18"); // Snapshot: 21w37a, future protocol: 757 + MINECRAFT_1_18(-1, 42, "1.18"); // Snapshot: 21w38a, future protocol: 757 private static final int SNAPSHOT_BIT = 30; From 922a13d9ed1e9573712072521bd8419893ef0cc6 Mon Sep 17 00:00:00 2001 From: "Five (Xer)" Date: Fri, 8 Oct 2021 15:25:48 +0200 Subject: [PATCH 03/15] Snapshot 21w39a --- .../java/com/velocitypowered/api/network/ProtocolVersion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java index 9207a6bbf..5d12f710b 100644 --- a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java +++ b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java @@ -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, 42, "1.18"); // Snapshot: 21w38a, future protocol: 757 + MINECRAFT_1_18(-1, 43, "1.18"); // Snapshot: 21w39a, future protocol: 757 private static final int SNAPSHOT_BIT = 30; From 4ba4054f23cfea3d4de51c042fbf8214d7275df6 Mon Sep 17 00:00:00 2001 From: "Five (Xer)" Date: Sat, 9 Oct 2021 00:08:51 +0200 Subject: [PATCH 04/15] Snapshot 21w40a --- .../api/network/ProtocolVersion.java | 2 +- .../proxy/protocol/StateRegistry.java | 13 +++++++++---- .../proxy/protocol/packet/JoinGame.java | 18 ++++++++++++++++++ 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java index 5d12f710b..b6415af9b 100644 --- a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java +++ b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java @@ -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, 43, "1.18"); // Snapshot: 21w39a, future protocol: 757 + MINECRAFT_1_18(-1, 44, "1.18"); // Snapshot: 21w40a, future protocol: 757 private static final int SNAPSHOT_BIT = 30; diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/StateRegistry.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/StateRegistry.java index a65946e08..bab367e49 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/StateRegistry.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/StateRegistry.java @@ -27,6 +27,7 @@ import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_16; import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_16_2; import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_16_4; import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_17; +import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_18; import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_7_2; import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_8; import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_9; @@ -246,7 +247,8 @@ public enum StateRegistry { map(0x53, MINECRAFT_1_14, true), map(0x54, MINECRAFT_1_15, true), map(0x53, MINECRAFT_1_16, true), - map(0x5E, MINECRAFT_1_17, true)); + map(0x5E, MINECRAFT_1_17, true), + map(0x5F, MINECRAFT_1_18, true)); clientbound.register(LegacyTitlePacket.class, LegacyTitlePacket::new, map(0x45, MINECRAFT_1_8, true), map(0x45, MINECRAFT_1_9, true), @@ -257,13 +259,16 @@ public enum StateRegistry { map(0x50, MINECRAFT_1_15, true), map(0x4F, MINECRAFT_1_16, MINECRAFT_1_16_4, true)); clientbound.register(TitleSubtitlePacket.class, TitleSubtitlePacket::new, - map(0x57, MINECRAFT_1_17, true)); + map(0x57, MINECRAFT_1_17, true), + map(0x58, MINECRAFT_1_18, true)); clientbound.register(TitleTextPacket.class, TitleTextPacket::new, - map(0x59, MINECRAFT_1_17, true)); + map(0x59, MINECRAFT_1_17, true), + map(0x5A, MINECRAFT_1_18, true)); clientbound.register(TitleActionbarPacket.class, TitleActionbarPacket::new, map(0x41, MINECRAFT_1_17, true)); clientbound.register(TitleTimesPacket.class, TitleTimesPacket::new, - map(0x5A, MINECRAFT_1_17, true)); + map(0x5A, MINECRAFT_1_17, true), + map(0x5B, MINECRAFT_1_18, true)); clientbound.register(TitleClearPacket.class, TitleClearPacket::new, map(0x10, MINECRAFT_1_17, true)); clientbound.register(PlayerListItem.class, PlayerListItem::new, diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/JoinGame.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/JoinGame.java index 26a293a1a..74e2956c0 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/JoinGame.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/JoinGame.java @@ -50,6 +50,7 @@ public class JoinGame implements MinecraftPacket { private DimensionData currentDimensionData; // 1.16.2+ private short previousGamemode; // 1.16+ private CompoundBinaryTag biomeRegistry; // 1.16.2+ + private int simulationDistance; // 1.18+ public int getEntityId() { return entityId; @@ -163,6 +164,14 @@ public class JoinGame implements MinecraftPacket { return currentDimensionData; } + public int getSimulationDistance(){ + return simulationDistance; + } + + public void setSimulationDistance(int simulationDistance) { + this.simulationDistance = simulationDistance; + } + @Override public String toString() { return "JoinGame{" @@ -178,6 +187,7 @@ public class JoinGame implements MinecraftPacket { + ", dimensionRegistry='" + dimensionRegistry + '\'' + ", dimensionInfo='" + dimensionInfo + '\'' + ", previousGamemode=" + previousGamemode + + ", simulationDistance=" + simulationDistance + '}'; } @@ -271,6 +281,10 @@ public class JoinGame implements MinecraftPacket { } this.viewDistance = ProtocolUtils.readVarInt(buf); + if (version.compareTo(ProtocolVersion.MINECRAFT_1_18) >= 0) { + this.simulationDistance = ProtocolUtils.readVarInt(buf); + } + this.reducedDebugInfo = buf.readBoolean(); this.showRespawnScreen = buf.readBoolean(); boolean isDebug = buf.readBoolean(); @@ -360,6 +374,10 @@ public class JoinGame implements MinecraftPacket { buf.writeByte(maxPlayers); } ProtocolUtils.writeVarInt(buf, viewDistance); + if (version.compareTo(ProtocolVersion.MINECRAFT_1_18) >= 0) { + ProtocolUtils.writeVarInt(buf, simulationDistance); + } + buf.writeBoolean(reducedDebugInfo); buf.writeBoolean(showRespawnScreen); buf.writeBoolean(dimensionInfo.isDebugType()); From 311133a4d3342e81ac99fafd8955e1641524d33e Mon Sep 17 00:00:00 2001 From: "Five (Xer)" Date: Wed, 13 Oct 2021 20:50:34 +0200 Subject: [PATCH 05/15] Snapshot 21w41a --- .../java/com/velocitypowered/api/network/ProtocolVersion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java index b6415af9b..7997599b8 100644 --- a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java +++ b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java @@ -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, 44, "1.18"); // Snapshot: 21w40a, future protocol: 757 + MINECRAFT_1_18(-1, 45, "1.18"); // Snapshot: 21w41a, future protocol: 757 private static final int SNAPSHOT_BIT = 30; From f4dc9ca70e734ee46e9b0dc5f8b666aeb21a78c0 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Tue, 26 Oct 2021 17:39:14 -0400 Subject: [PATCH 06/15] Minecraft 21w42a --- .../java/com/velocitypowered/api/network/ProtocolVersion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java index 7997599b8..444aa583f 100644 --- a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java +++ b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java @@ -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, 45, "1.18"); // Snapshot: 21w41a, future protocol: 757 + MINECRAFT_1_18(-1, 46, "1.18"); // Snapshot: 21w42a, future protocol: 757 private static final int SNAPSHOT_BIT = 30; From 9f82af7d31d274ab8d2557937567f647e1535f37 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Thu, 28 Oct 2021 08:47:40 -0400 Subject: [PATCH 07/15] Minecraft 21w43a --- .../java/com/velocitypowered/api/network/ProtocolVersion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java index 444aa583f..a7dd0c97d 100644 --- a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java +++ b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java @@ -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, 46, "1.18"); // Snapshot: 21w42a, future protocol: 757 + MINECRAFT_1_18(-1, 47, "1.18"); // Snapshot: 21w43a, future protocol: 757 private static final int SNAPSHOT_BIT = 30; From 315ff265c6de89a970e7c7004957062cdc70a3a9 Mon Sep 17 00:00:00 2001 From: "Five (Xer)" Date: Fri, 12 Nov 2021 10:53:26 +0100 Subject: [PATCH 08/15] Snapshot 21w44a --- .../api/network/ProtocolVersion.java | 2 +- .../client/ClientSettingsWrapper.java | 2 +- .../proxy/protocol/packet/ClientSettings.java | 21 ++++++++++++++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java index a7dd0c97d..8a6ebb722 100644 --- a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java +++ b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java @@ -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; diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientSettingsWrapper.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientSettingsWrapper.java index 38942fa16..b9cbed7a4 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientSettingsWrapper.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientSettingsWrapper.java @@ -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; diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/ClientSettings.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/ClientSettings.java index ef3818c99..f1e7d038a 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/ClientSettings.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/ClientSettings.java @@ -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); + } } } } From 5af53f2d77284557af2db7448114fb1a38286563 Mon Sep 17 00:00:00 2001 From: "Five (Xer)" Date: Fri, 12 Nov 2021 10:56:29 +0100 Subject: [PATCH 09/15] Snapshot 1.18-pre1 --- .../java/com/velocitypowered/api/network/ProtocolVersion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java index 8a6ebb722..7c0175b96 100644 --- a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java +++ b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java @@ -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, 48, "1.18"); // Snapshot: 21w44a, future protocol: 757 + MINECRAFT_1_18(-1, 49, "1.18"); // Snapshot: 1.18-pre1, future protocol: 757 private static final int SNAPSHOT_BIT = 30; From 9bf82c52fd05e95660a75cc153500c225406dc41 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Tue, 16 Nov 2021 22:06:09 -0500 Subject: [PATCH 10/15] Minecraft 1.18-pre2 --- .../java/com/velocitypowered/api/network/ProtocolVersion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java index 7c0175b96..b4daf9efd 100644 --- a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java +++ b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java @@ -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, 49, "1.18"); // Snapshot: 1.18-pre1, future protocol: 757 + MINECRAFT_1_18(-1, 50, "1.18"); // Snapshot: 1.18-pre1, future protocol: 757 private static final int SNAPSHOT_BIT = 30; From 2dfc7ffbf265092f3660261b4344fc662d789305 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Wed, 17 Nov 2021 14:37:08 -0500 Subject: [PATCH 11/15] 1.18-pre4 --- .../java/com/velocitypowered/api/network/ProtocolVersion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java index b4daf9efd..0f4ff936e 100644 --- a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java +++ b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java @@ -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, 50, "1.18"); // Snapshot: 1.18-pre1, future protocol: 757 + MINECRAFT_1_18(-1, 52, "1.18"); // Snapshot: 1.18-pre4, future protocol: 757 private static final int SNAPSHOT_BIT = 30; From 830fb6a56128a47156786b9fcb5cb16380a1dc9f Mon Sep 17 00:00:00 2001 From: "FivePB (Xer)" Date: Mon, 22 Nov 2021 13:44:30 +0100 Subject: [PATCH 12/15] Snapshot 1.18-pre5 --- .../java/com/velocitypowered/api/network/ProtocolVersion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java index 0f4ff936e..be639d2a5 100644 --- a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java +++ b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java @@ -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, 52, "1.18"); // Snapshot: 1.18-pre4, future protocol: 757 + MINECRAFT_1_18(-1, 53, "1.18"); // Snapshot: 1.18-pre5, future protocol: 757 private static final int SNAPSHOT_BIT = 30; From b5cad80cfc8b743d4565ca36c1f4de94019d28a4 Mon Sep 17 00:00:00 2001 From: "FivePB (Xer)" Date: Mon, 22 Nov 2021 19:41:07 +0100 Subject: [PATCH 13/15] Snapshot 1.18-pre6 --- .../java/com/velocitypowered/api/network/ProtocolVersion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java index be639d2a5..d148c5719 100644 --- a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java +++ b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java @@ -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, 53, "1.18"); // Snapshot: 1.18-pre5, future protocol: 757 + MINECRAFT_1_18(-1, 54, "1.18"); // Snapshot: 1.18-pre6, future protocol: 757 private static final int SNAPSHOT_BIT = 30; From 7cc40f8fea4ecc9fb3f739dd5bd95176fb88627b Mon Sep 17 00:00:00 2001 From: "FivePB (Xer)" Date: Tue, 23 Nov 2021 21:59:36 +0100 Subject: [PATCH 14/15] Ready for 1.18 release --- .../java/com/velocitypowered/api/network/ProtocolVersion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java index d148c5719..5afffba45 100644 --- a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java +++ b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java @@ -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, 54, "1.18"); // Snapshot: 1.18-pre6, future protocol: 757 + MINECRAFT_1_18(757, "1.18"); private static final int SNAPSHOT_BIT = 30; From 7ed4f4c03a56caccb7d953d92271b2ed22202264 Mon Sep 17 00:00:00 2001 From: FivePB Date: Thu, 25 Nov 2021 17:04:10 +0100 Subject: [PATCH 15/15] Add new ClientSettings API Add the new API introducted with the ClientSettings packet changes in 1.18 --- .../api/proxy/player/PlayerSettings.java | 10 ++++++++++ .../proxy/connection/client/ClientSettingsWrapper.java | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/api/src/main/java/com/velocitypowered/api/proxy/player/PlayerSettings.java b/api/src/main/java/com/velocitypowered/api/proxy/player/PlayerSettings.java index 61faae34b..0f70e4aac 100644 --- a/api/src/main/java/com/velocitypowered/api/proxy/player/PlayerSettings.java +++ b/api/src/main/java/com/velocitypowered/api/proxy/player/PlayerSettings.java @@ -57,6 +57,16 @@ public interface PlayerSettings { */ MainHand getMainHand(); + /** + * Returns whether the client explicitly allows listing on the + * {@link com.velocitypowered.api.proxy.player.TabList} or not in + * anonymous TabList mode. + * This feature was introduced in 1.18. + * + * @return whether or not the client explicitly allows listing. Always false on older clients. + */ + boolean isClientListingAllowed(); + enum ChatMode { SHOWN, COMMANDS_ONLY, diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientSettingsWrapper.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientSettingsWrapper.java index b9cbed7a4..402ef78d2 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientSettingsWrapper.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientSettingsWrapper.java @@ -74,5 +74,9 @@ public class ClientSettingsWrapper implements PlayerSettings { return settings.getMainHand() == 1 ? MainHand.RIGHT : MainHand.LEFT; } + @Override + public boolean isClientListingAllowed() { + return settings.isClientListingAllowed(); + } }