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,8 +26,8 @@ public class SetWarpCommand extends CommandBase {
}
private void setWarp(@NotNull OnlineUser onlineUser, @NotNull String warpName) {
onlineUser.getPosition().thenAccept(position -> plugin.getSavedPositionManager().setWarp(
new PositionMeta(warpName, ""), position).thenAccept(setResult ->
plugin.getSavedPositionManager().setWarp(
new PositionMeta(warpName, ""), onlineUser.getPosition()).thenAccept(setResult ->
(switch (setResult.resultType()) {
case SUCCESS -> {
assert setResult.savedPosition().isPresent();
@@ -38,7 +38,7 @@ public class SetWarpCommand extends CommandBase {
case FAILED_NAME_LENGTH -> plugin.getLocales().getLocale("error_warp_name_length");
case FAILED_NAME_CHARACTERS -> plugin.getLocales().getLocale("error_warp_name_characters");
default -> Optional.of(new MineDown(""));
}).ifPresent(onlineUser::sendMessage)));
}).ifPresent(onlineUser::sendMessage));
}
}