Refactor player location and server name fetching, prune unused locales

This commit is contained in:
William committed 2022-08-23 16:19:18 +01:00
1 parent 571f35429d
commit 7e3dab918f
23 files changed
+151 -200

No files matched your search

@@ -26,7 +26,7 @@ public class SpawnCommand extends CommandBase {
CompletableFuture.runAsync(() -> {
final Optional<? extends Position> position = (plugin.getSettings().crossServer && plugin.getSettings().globalSpawn
? plugin.getDatabase().getWarp(plugin.getSettings().globalSpawnName).join()
: plugin.getServerSpawn().flatMap(spawn -> spawn.getLocation(plugin.getServer(onlineUser).join())));
: plugin.getServerSpawn().flatMap(spawn -> spawn.getLocation(plugin.getServer(onlineUser))));
if (position.isEmpty()) {
plugin.getLocales().getLocale("error_spawn_not_set").ifPresent(onlineUser::sendMessage);
return;