Listeners improvements
This commit is contained in:
parent
b04f6e7420
commit
9a67b10ab1
2
pom.xml
2
pom.xml
@ -7,7 +7,7 @@
|
||||
<groupId>com.glyart.authmevelocity</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.5.0</version>
|
||||
<version>2.0.0</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>parent</artifactId>
|
||||
<groupId>com.glyart.authmevelocity</groupId>
|
||||
<version>1.5.0</version>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -2,7 +2,6 @@ package com.glyart.authmevelocity.proxy.listener;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import com.glyart.authmevelocity.proxy.AuthMeVelocityPlugin;
|
||||
import com.glyart.authmevelocity.proxy.AuthmeVelocityAPI;
|
||||
import com.glyart.authmevelocity.proxy.config.AuthMeConfig;
|
||||
import com.glyart.authmevelocity.proxy.config.ConfigUtils;
|
||||
@ -39,8 +38,8 @@ public final class ProxyListener {
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onDisconnect(final DisconnectEvent event) {
|
||||
api.removePlayer(event.getPlayer());
|
||||
public EventTask onDisconnect(final DisconnectEvent event) {
|
||||
return EventTask.async(() -> api.removePlayer(event.getPlayer()));
|
||||
}
|
||||
|
||||
@Subscribe(order = PostOrder.FIRST)
|
||||
@ -94,10 +93,11 @@ public final class ProxyListener {
|
||||
|
||||
@Subscribe(order = PostOrder.FIRST)
|
||||
public EventTask onTabComplete(TabCompleteEvent event){
|
||||
return EventTask.async(() -> {
|
||||
if (!api.isLogged(event.getPlayer())){
|
||||
return EventTask.async(() -> event.getSuggestions().clear());
|
||||
event.getSuggestions().clear();
|
||||
}
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe(order = PostOrder.LATE)
|
||||
@ -111,7 +111,7 @@ public final class ProxyListener {
|
||||
continuation.resume();
|
||||
return;
|
||||
}
|
||||
RegisteredServer server = getAvailableServer();
|
||||
@Nullable RegisteredServer server = getAvailableServer();
|
||||
if(server == null) {
|
||||
continuation.resume();
|
||||
logger.error("Cannot send the player {} to an auth server", event.getPlayer().getUsername());
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>parent</artifactId>
|
||||
<groupId>com.glyart.authmevelocity</groupId>
|
||||
<version>1.5.0</version>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user