Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-07-11 17:58:03 +02:00
fix version, detect velocity implementation, fix npe, fix detectorservice
Dieser Commit ist enthalten in:
Ursprung
4c07b6d28d
Commit
3ef1ac06df
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>viaversion-parent</artifactId>
|
<artifactId>viaversion-parent</artifactId>
|
||||||
<groupId>us.myles</groupId>
|
<groupId>us.myles</groupId>
|
||||||
<version>1.6.1-18w43c</version>
|
<version>1.6.1-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|
|
@ -87,12 +87,14 @@ public class VelocityPlugin implements ViaPlatform<Player> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPlatformName() {
|
public String getPlatformName() {
|
||||||
return "Velocity";
|
String proxyImpl = ProxyServer.class.getPackage().getImplementationTitle();
|
||||||
|
return (proxyImpl != null) ? proxyImpl : "Velocity";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPlatformVersion() {
|
public String getPlatformVersion() {
|
||||||
return ProxyServer.class.getPackage().getImplementationVersion();
|
String version = ProxyServer.class.getPackage().getImplementationVersion();
|
||||||
|
return (version != null) ? version : "Unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -27,15 +27,17 @@ public class VelocityViaLoader implements ViaPlatformLoader {
|
||||||
Via.getManager().getProviders().use(VersionProvider.class, new VelocityVersionProvider());
|
Via.getManager().getProviders().use(VersionProvider.class, new VelocityVersionProvider());
|
||||||
// We probably don't need a EntityIdProvider because velocity sends a Join packet on server change
|
// We probably don't need a EntityIdProvider because velocity sends a Join packet on server change
|
||||||
|
|
||||||
VelocityPlugin.PROXY.getEventManager().register(
|
VelocityPlugin.PROXY.getEventManager().register(plugin, new UpdateListener());
|
||||||
plugin,
|
|
||||||
new UpdateListener());
|
|
||||||
Via.getPlatform().runRepeatingSync(
|
|
||||||
new ProtocolDetectorService(),
|
|
||||||
((VelocityViaConfig) Via.getPlatform().getConf()).getVelocityPingInterval() * 50L);
|
|
||||||
VelocityPlugin.PROXY.getEventManager().register(plugin, new VelocityServerHandler());
|
VelocityPlugin.PROXY.getEventManager().register(plugin, new VelocityServerHandler());
|
||||||
VelocityPlugin.PROXY.getEventManager().register(plugin, new MainHandPatch());
|
VelocityPlugin.PROXY.getEventManager().register(plugin, new MainHandPatch());
|
||||||
VelocityPlugin.PROXY.getEventManager().register(plugin, new ElytraPatch());
|
VelocityPlugin.PROXY.getEventManager().register(plugin, new ElytraPatch());
|
||||||
|
|
||||||
|
int pingInterval = ((VelocityViaConfig) Via.getPlatform().getConf()).getVelocityPingInterval();
|
||||||
|
if (pingInterval > 0) {
|
||||||
|
Via.getPlatform().runRepeatingSync(
|
||||||
|
new ProtocolDetectorService(),
|
||||||
|
pingInterval * 20L);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren