Add protocol version for 1.20

This commit is contained in:
Dan Mulloy 2023-06-10 19:00:13 -05:00
parent 1537c7e236
commit fbf6120876
No known key found for this signature in database
GPG Key ID: F379C293F178751F
2 changed files with 9 additions and 1 deletions

View File

@ -87,6 +87,7 @@ public final class MinecraftProtocolVersion {
map.put(new MinecraftVersion(1, 19, 3), 761);
map.put(new MinecraftVersion(1, 19, 4), 762);
map.put(new MinecraftVersion(1, 20, 0), 763);
return map;
}

View File

@ -15,8 +15,9 @@
* 02111-1307 USA
*/
package com.comphenix.protocol;
package com.comphenix.protocol.utility;
import com.comphenix.protocol.BukkitInitialization;
import com.comphenix.protocol.utility.MinecraftVersion;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@ -51,6 +52,12 @@ class MinecraftVersionTest {
assertEquals(MinecraftVersion.TRAILS_AND_TAILS, MinecraftVersion.getCurrentVersion());
}
@Test
void testCurrentProtocol() {
// MIN_VALUE is returned when the current version is not supported
assertNotEquals(MinecraftProtocolVersion.getCurrentVersion(), Integer.MIN_VALUE);
}
@Test
void testParsing() {
assertEquals("1.4.3", MinecraftVersion.extractVersion("CraftBukkit R3.0 (MC: 1.4.3)"));