diff --git a/proxy/src/main/java/com/velocitypowered/proxy/plugin/VelocityEventManager.java b/proxy/src/main/java/com/velocitypowered/proxy/plugin/VelocityEventManager.java index 7526a50a2..4cfa88de0 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/plugin/VelocityEventManager.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/plugin/VelocityEventManager.java @@ -110,7 +110,8 @@ public class VelocityEventManager implements EventManager { return CompletableFuture.completedFuture(event); } - Runnable runEvent = () -> { + CompletableFuture eventFuture = new CompletableFuture<>(); + service.execute(() -> { PostResult result = bus.post(event); if (!result.exceptions().isEmpty()) { logger.error("Some errors occurred whilst posting event {}.", event); @@ -119,11 +120,6 @@ public class VelocityEventManager implements EventManager { logger.error("#{}: \n", ++i, exception); } } - }; - - CompletableFuture eventFuture = new CompletableFuture<>(); - service.execute(() -> { - runEvent.run(); eventFuture.complete(event); }); return eventFuture;