From fd6394517595e291e95bca5f60cb1a68bc18c8de Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Thu, 15 Oct 2020 15:57:27 -0400 Subject: [PATCH] Follow historical precedent with the new snapshot protocol release policy. --- .../com/velocitypowered/api/network/ProtocolVersion.java | 5 ++++- 1 file changed, 4 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 9181e9bf8..d5bc745c2 100644 --- a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java +++ b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java @@ -72,7 +72,10 @@ public enum ProtocolVersion { static { Map versions = new HashMap<>(); for (ProtocolVersion version : values()) { - versions.put(version.protocol, version); + // For versions where the snapshot is compatible with the prior release version, Mojang will + // default to that. Follow that behavior since there is precedent (all the Minecraft 1.8 + // minor releases use the same protocol version). + versions.putIfAbsent(version.protocol, version); if (version.snapshotProtocol != -1) { versions.put(version.snapshotProtocol, version); }