From c787c76eca15f02150fcacc8c555fe9d4db8a745 Mon Sep 17 00:00:00 2001 From: mohammed jasem alaajel Date: Wed, 20 Jul 2022 13:25:26 +0400 Subject: [PATCH] fix null being passed into jedis on ServerConnectedEvent --- .../minecraft/redisbungee/RedisBungeeBungeeListener.java | 2 +- .../minecraft/redisbungee/RedisBungeeVelocityListener.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/RedisBungee-Bungee/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeBungeeListener.java b/RedisBungee-Bungee/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeBungeeListener.java index 68e4625..118f670 100644 --- a/RedisBungee-Bungee/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeBungeeListener.java +++ b/RedisBungee-Bungee/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeBungeeListener.java @@ -165,7 +165,7 @@ public class RedisBungeeBungeeListener extends AbstractRedisBungeeListener(plugin) { @Override diff --git a/RedisBungee-Velocity/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeVelocityListener.java b/RedisBungee-Velocity/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeVelocityListener.java index c28f9c6..d71c2e0 100644 --- a/RedisBungee-Velocity/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeVelocityListener.java +++ b/RedisBungee-Velocity/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeVelocityListener.java @@ -157,8 +157,7 @@ public class RedisBungeeVelocityListener extends AbstractRedisBungeeListener optionalServerConnection = event.getPlayer().getCurrentServer(); - final String currentServer = optionalServerConnection.map(serverConnection -> serverConnection.getServerInfo().getName()).orElse(null); + final String currentServer = event.getServer().getServerInfo().getName(); final String oldServer = event.getPreviousServer().map(serverConnection -> serverConnection.getServerInfo().getName()).orElse(null); plugin.executeAsync(new RedisTask(plugin) {