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