mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 14:38:52 +00:00
fix: redis disconnecting when RTP could not find the world on the target server (#648)
* fix: redis disconnecting when the world is not found
This commit is contained in:
1 parent
6e0e51f4f7
commit
2b9a9ae467
1 file changed
+7
-1
@@ -146,8 +146,14 @@ public abstract class Broker {
|
||||
Optional<World> world = plugin.getWorlds().stream()
|
||||
.filter(w -> w.getName().equals(request.getWorldName())).findFirst();
|
||||
if (world.isEmpty()) {
|
||||
throw new RuntimeException("%s requested a position in a world we don't have! World: %s"
|
||||
plugin.log(Level.SEVERE, "%s requested a position in a world we don't have! World: %s"
|
||||
.formatted(message.getSourceServer(), request.getWorldName()));
|
||||
Message.builder()
|
||||
.type(Message.Type.RTP_LOCATION)
|
||||
.target(request.getUsername())
|
||||
.payload(Payload.empty())
|
||||
.build().send(plugin.getMessenger(), request.getUsername());
|
||||
return;
|
||||
}
|
||||
plugin.getRandomTeleportEngine().getRandomPosition(world.get(), null)
|
||||
.thenAccept((position) -> {
|
||||
|
||||
Reference in new issue
Block a user