mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 18:15:39 +01:00
4.0.1 Release
This commit is contained in:
parent
9f97a09942
commit
b28f743306
@ -77,7 +77,7 @@ public class ProtocolVersion {
|
||||
public static final ProtocolVersion v1_16_3 = register(753, "1.16.3");
|
||||
public static final ProtocolVersion v1_16_4 = register(754, "1.16.4/5", new VersionRange("1.16", 4, 5));
|
||||
public static final ProtocolVersion v1_17 = register(755, "1.17");
|
||||
public static final ProtocolVersion v1_17_1 = register(756, 40, "1.17.1");
|
||||
public static final ProtocolVersion v1_17_1 = register(756, "1.17.1");
|
||||
public static final ProtocolVersion unknown = register(-1, "UNKNOWN");
|
||||
|
||||
public static ProtocolVersion register(int version, String name) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Project properties - we put these here so they can be modified without causing a recompile of the build scripts
|
||||
projectVersion=4.0.1-1.17.1-rc2-SNAPSHOT
|
||||
projectVersion=4.0.1
|
||||
|
||||
# Gradle properties
|
||||
org.gradle.daemon=true
|
||||
|
@ -82,6 +82,18 @@ public class VelocityPlugin implements ViaPlatform<Player> {
|
||||
|
||||
@Subscribe
|
||||
public void onProxyInit(ProxyInitializeEvent e) {
|
||||
if (!hasConnectionEvent()) {
|
||||
// No way to disable the plugin :(
|
||||
Logger logger = this.loggerslf4j;
|
||||
logger.error(" / \\");
|
||||
logger.error(" / \\");
|
||||
logger.error(" / | \\");
|
||||
logger.error(" / | \\ VELOCITY 3.0.0 IS REQUIRED");
|
||||
logger.error(" / \\ VIAVERSION WILL NOT WORK AS INTENDED");
|
||||
logger.error(" / o \\");
|
||||
logger.error("/_____________\\");
|
||||
}
|
||||
|
||||
PROXY = proxy;
|
||||
VelocityCommandHandler commandHandler = new VelocityCommandHandler();
|
||||
PROXY.getCommandManager().register("viaver", commandHandler, "vvvelocity", "viaversion");
|
||||
@ -231,4 +243,13 @@ public class VelocityPlugin implements ViaPlatform<Player> {
|
||||
public java.util.logging.Logger getLogger() {
|
||||
return logger;
|
||||
}
|
||||
|
||||
private boolean hasConnectionEvent() {
|
||||
try {
|
||||
Class.forName("com.velocitypowered.proxy.protocol.VelocityConnectionEvent");
|
||||
return true;
|
||||
} catch (ClassNotFoundException ignored) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -57,13 +57,14 @@ public class VelocityViaInjector implements ViaInjector {
|
||||
|
||||
@Override
|
||||
public void inject() throws Exception {
|
||||
Via.getPlatform().getLogger().info("Replacing channel initializers; you can safely ignore the following two warnings.");
|
||||
|
||||
Object connectionManager = ReflectionUtil.get(VelocityPlugin.PROXY, "cm", Object.class);
|
||||
Object channelInitializerHolder = ReflectionUtil.invoke(connectionManager, "getServerChannelInitializer");
|
||||
ChannelInitializer originalInitializer = getInitializer();
|
||||
channelInitializerHolder.getClass().getMethod("set", ChannelInitializer.class)
|
||||
.invoke(channelInitializerHolder, new VelocityChannelInitializer(originalInitializer, false));
|
||||
|
||||
|
||||
Object backendInitializerHolder = ReflectionUtil.invoke(connectionManager, "getBackendChannelInitializer");
|
||||
ChannelInitializer backendInitializer = getBackendInitializer();
|
||||
backendInitializerHolder.getClass().getMethod("set", ChannelInitializer.class)
|
||||
@ -75,7 +76,6 @@ public class VelocityViaInjector implements ViaInjector {
|
||||
Via.getPlatform().getLogger().severe("ViaVersion cannot remove itself from Velocity without a reboot!");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getServerProtocolVersion() throws Exception {
|
||||
return getLowestSupportedProtocolVersion();
|
||||
|
Loading…
Reference in New Issue
Block a user