diff --git a/pom.xml b/pom.xml index dec45abd..a32e7cd6 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ net.azisaba Kuvel - 2.0.1 + 2.0.2 jar ${project.artifactId} diff --git a/src/main/java/net/azisaba/kuvel/Kuvel.java b/src/main/java/net/azisaba/kuvel/Kuvel.java index 58d9e9f2..3dd7911e 100644 --- a/src/main/java/net/azisaba/kuvel/Kuvel.java +++ b/src/main/java/net/azisaba/kuvel/Kuvel.java @@ -24,7 +24,7 @@ @Plugin( id = "kuvel", name = "Kuvel", - version = "2.0.1", + version = "2.0.2", url = "https://github.com/AzisabaNetwork/Kuvel", description = "Server-discovery Velocity plugin for Minecraft servers running in a Kubernetes cluster.", diff --git a/src/main/java/net/azisaba/kuvel/KuvelServiceHandler.java b/src/main/java/net/azisaba/kuvel/KuvelServiceHandler.java index 6c867980..1c5a07a5 100644 --- a/src/main/java/net/azisaba/kuvel/KuvelServiceHandler.java +++ b/src/main/java/net/azisaba/kuvel/KuvelServiceHandler.java @@ -156,6 +156,7 @@ public void setAndRunServerDiscovery(@Nullable ServerDiscovery newServerDiscover for (Entry entry : servers.entrySet()) { Pod pod = entry.getValue(); InetSocketAddress address = new InetSocketAddress(pod.getStatus().getPodIP(), 25565); + plugin.getProxy().getServer(entry.getKey()).ifPresent(server -> plugin.getProxy().unregisterServer(server.getServerInfo())); plugin.getProxy().registerServer(new ServerInfo(entry.getKey(), address)); String initialServerStr = pod.getMetadata().getLabels()