diff --git a/pom.xml b/pom.xml index caa00ca..40992ee 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 mineverse.Aust1n46.chat VentureChat - 3.1.0 + 3.1.1 https://bitbucket.org/Aust1n46/venturechat/src/master https://bitbucket.org/Aust1n46/venturechat/src/master diff --git a/src/main/java/mineverse/Aust1n46/chat/proxy/VentureChatVelocity.java b/src/main/java/mineverse/Aust1n46/chat/proxy/VentureChatVelocity.java index 6653bc0..f661ef5 100644 --- a/src/main/java/mineverse/Aust1n46/chat/proxy/VentureChatVelocity.java +++ b/src/main/java/mineverse/Aust1n46/chat/proxy/VentureChatVelocity.java @@ -8,6 +8,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.List; import java.util.Optional; +import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import org.slf4j.Logger; @@ -96,7 +97,12 @@ public class VentureChatVelocity implements VentureChatProxySource { @Subscribe public void onPlayerQuit(DisconnectEvent event) { - updatePlayerNames(); + // Delay sending plugin message to make sure disconnecting player is truly disconnected. + proxyServer.getScheduler().buildTask(this, () -> { + updatePlayerNames(); + }) + .delay(1, TimeUnit.SECONDS) + .schedule(); } private void updatePlayerNames() { @@ -112,7 +118,7 @@ public class VentureChatVelocity implements VentureChatProxySource { if(!send.isEmpty()) { sendPluginMessage(send.getName(), outstream.toByteArray()); } - }); + }); } catch(IllegalStateException e) { sendConsoleMessage("Velocity being finicky with DisconnectEvent.");