Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-27 08:30:09 +01:00
4.0.1 Release
Dieser Commit ist enthalten in:
Ursprung
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_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_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 = 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 final ProtocolVersion unknown = register(-1, "UNKNOWN");
|
||||||
|
|
||||||
public static ProtocolVersion register(int version, String name) {
|
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
|
# 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
|
# Gradle properties
|
||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
|
@ -82,6 +82,18 @@ public class VelocityPlugin implements ViaPlatform<Player> {
|
|||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onProxyInit(ProxyInitializeEvent e) {
|
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;
|
PROXY = proxy;
|
||||||
VelocityCommandHandler commandHandler = new VelocityCommandHandler();
|
VelocityCommandHandler commandHandler = new VelocityCommandHandler();
|
||||||
PROXY.getCommandManager().register("viaver", commandHandler, "vvvelocity", "viaversion");
|
PROXY.getCommandManager().register("viaver", commandHandler, "vvvelocity", "viaversion");
|
||||||
@ -231,4 +243,13 @@ public class VelocityPlugin implements ViaPlatform<Player> {
|
|||||||
public java.util.logging.Logger getLogger() {
|
public java.util.logging.Logger getLogger() {
|
||||||
return logger;
|
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
|
@Override
|
||||||
public void inject() throws Exception {
|
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 connectionManager = ReflectionUtil.get(VelocityPlugin.PROXY, "cm", Object.class);
|
||||||
Object channelInitializerHolder = ReflectionUtil.invoke(connectionManager, "getServerChannelInitializer");
|
Object channelInitializerHolder = ReflectionUtil.invoke(connectionManager, "getServerChannelInitializer");
|
||||||
ChannelInitializer originalInitializer = getInitializer();
|
ChannelInitializer originalInitializer = getInitializer();
|
||||||
channelInitializerHolder.getClass().getMethod("set", ChannelInitializer.class)
|
channelInitializerHolder.getClass().getMethod("set", ChannelInitializer.class)
|
||||||
.invoke(channelInitializerHolder, new VelocityChannelInitializer(originalInitializer, false));
|
.invoke(channelInitializerHolder, new VelocityChannelInitializer(originalInitializer, false));
|
||||||
|
|
||||||
|
|
||||||
Object backendInitializerHolder = ReflectionUtil.invoke(connectionManager, "getBackendChannelInitializer");
|
Object backendInitializerHolder = ReflectionUtil.invoke(connectionManager, "getBackendChannelInitializer");
|
||||||
ChannelInitializer backendInitializer = getBackendInitializer();
|
ChannelInitializer backendInitializer = getBackendInitializer();
|
||||||
backendInitializerHolder.getClass().getMethod("set", ChannelInitializer.class)
|
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!");
|
Via.getPlatform().getLogger().severe("ViaVersion cannot remove itself from Velocity without a reboot!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getServerProtocolVersion() throws Exception {
|
public int getServerProtocolVersion() throws Exception {
|
||||||
return getLowestSupportedProtocolVersion();
|
return getLowestSupportedProtocolVersion();
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren