Add warning on startup for 1.8 users

This commit is contained in:
KennyTV 2020-10-12 09:51:33 +02:00
parent 03ba058a9b
commit 0015682fe4
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
4 changed files with 24 additions and 1 deletions

View File

@ -85,6 +85,11 @@ public class BungeePlugin extends Plugin implements ViaPlatform<ProxiedPlayer>,
return getProxy().getVersion();
}
@Override
public boolean isProxy() {
return true;
}
@Override
public String getPluginVersion() {
return getDescription().getVersion();

View File

@ -97,6 +97,9 @@ public class ViaManager {
platform.getLogger().warning("If you need support for older versions you may need to use one or more ViaVersion addons too.");
platform.getLogger().warning("In that case please read the ViaVersion resource page carefully or use https://jo0001.github.io/ViaSetup");
platform.getLogger().warning("and if you're still unsure, feel free to join our Discord-Server for further assistance.");
} else if (ProtocolRegistry.SERVER_PROTOCOL == ProtocolVersion.v1_8.getId() && !platform.isProxy()) {
platform.getLogger().warning("This version of Minecraft is over half a decade old and support for it will be fully dropped eventually. "
+ "Please upgrade to a newer version to avoid encountering bugs and stability issues that have long been fixed.");
}
}
// Load Listeners / Tasks

View File

@ -16,6 +16,7 @@ import java.util.logging.Logger;
* @param <T> - The player type for the platform, used for API related methods
*/
public interface ViaPlatform<T> {
/**
* Get the logger for this platform
*
@ -33,10 +34,19 @@ public interface ViaPlatform<T> {
/**
* Get the platform version
*
* @return Platforn version
* @return Platform version
*/
String getPlatformVersion();
/**
* Returns true if the server Via is running on is a proxy server.
*
* @return true if the platform is a proxy
*/
default boolean isProxy() {
return false;
}
/**
* Get the plugin version
*

View File

@ -102,6 +102,11 @@ public class VelocityPlugin implements ViaPlatform<Player> {
return (version != null) ? version : "Unknown";
}
@Override
public boolean isProxy() {
return true;
}
@Override
public String getPluginVersion() {
return VersionInfo.VERSION;