use of com.velocitypowered.proxy.connection.client.ClientPlaySessionHandler in project LimboAPI by Elytrium.
the class LoginListener method hookPlaySession.
@Subscribe
public void hookPlaySession(ServerConnectedEvent event) {
ConnectedPlayer player = (ConnectedPlayer) event.getPlayer();
MinecraftConnection connection = player.getConnection();
connection.eventLoop().execute(() -> {
if (!(connection.getSessionHandler() instanceof ClientPlaySessionHandler)) {
ClientPlaySessionHandler playHandler = new ClientPlaySessionHandler(this.server, player);
try {
spawned.set(playHandler, this.plugin.isLimboJoined(player));
} catch (IllegalAccessException ex) {
this.plugin.getLogger().error("Exception while hooking into ClientPlaySessionHandler of {}", player, ex);
}
connection.setSessionHandler(playHandler);
}
});
}
Aggregations