mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
Refactor player location and server name fetching, prune unused locales
This commit is contained in:
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));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user