mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2025-02-26 16:42:25 +01:00
fix version, detect velocity implementation, fix npe, fix detectorservice
This commit is contained in:
parent
4c07b6d28d
commit
3ef1ac06df
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>viaversion-parent</artifactId>
|
||||
<groupId>us.myles</groupId>
|
||||
<version>1.6.1-18w43c</version>
|
||||
<version>1.6.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -87,12 +87,14 @@ public class VelocityPlugin implements ViaPlatform<Player> {
|
||||
|
||||
@Override
|
||||
public String getPlatformName() {
|
||||
return "Velocity";
|
||||
String proxyImpl = ProxyServer.class.getPackage().getImplementationTitle();
|
||||
return (proxyImpl != null) ? proxyImpl : "Velocity";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPlatformVersion() {
|
||||
return ProxyServer.class.getPackage().getImplementationVersion();
|
||||
String version = ProxyServer.class.getPackage().getImplementationVersion();
|
||||
return (version != null) ? version : "Unknown";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -27,15 +27,17 @@ public class VelocityViaLoader implements ViaPlatformLoader {
|
||||
Via.getManager().getProviders().use(VersionProvider.class, new VelocityVersionProvider());
|
||||
// We probably don't need a EntityIdProvider because velocity sends a Join packet on server change
|
||||
|
||||
VelocityPlugin.PROXY.getEventManager().register(
|
||||
plugin,
|
||||
new UpdateListener());
|
||||
Via.getPlatform().runRepeatingSync(
|
||||
new ProtocolDetectorService(),
|
||||
((VelocityViaConfig) Via.getPlatform().getConf()).getVelocityPingInterval() * 50L);
|
||||
VelocityPlugin.PROXY.getEventManager().register(plugin, new UpdateListener());
|
||||
VelocityPlugin.PROXY.getEventManager().register(plugin, new VelocityServerHandler());
|
||||
VelocityPlugin.PROXY.getEventManager().register(plugin, new MainHandPatch());
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user