Add API exposure for platform and platform-specific protocol versions

This commit is contained in:
Andrew Steinborn
2021-05-30 17:43:52 -04:00
parent 3772bc1e0b
commit 80a59f7478
3 changed files with 30 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
package com.velocitypowered.api.network;
import com.velocitypowered.api.network.registry.Platform;
import java.util.List;
public interface PlatformVersion {
Platform platform();
int protocolVersion();
List<String> supportedVersions();
}

View File

@@ -0,0 +1,10 @@
package com.velocitypowered.api.network.registry;
public interface Platform {
Platform JAVA = new Platform() {
@Override
public String toString() {
return "Java Edition";
}
};
}

View File

@@ -0,0 +1,8 @@
package com.velocitypowered.api.network.registry;
import com.velocitypowered.api.network.PlatformVersion;
import org.checkerframework.checker.nullness.qual.Nullable;
public interface ProtocolVersionRegistry {
@Nullable PlatformVersion lookup(Platform platform, int version);
}