Skip to content

Commit

Permalink
fix: misleading error thrown expending free home slots, close #614
Browse files Browse the repository at this point in the history
  • Loading branch information
WiIIiam278 committed May 29, 2024
1 parent c167b8f commit 386ea57
Show file tree
Hide file tree
Showing 16 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,20 @@ public void dispatchHomeError(@NotNull CommandUser viewer, boolean other, @NotNu
case DESCRIPTION_INVALID_LENGTH -> plugin.getLocales()
.getLocale("error_home_description_length", args)
.ifPresent(viewer::sendMessage);
case NOT_ENOUGH_HOME_SLOTS, REACHED_MAX_HOMES -> plugin.getLocales()
case REACHED_MAX_HOMES -> plugin.getLocales()
.getLocale("error_set_home_maximum_homes",
Integer.toString(plugin.getManager().homes()
.getMaxHomes(viewer instanceof OnlineUser user ? user : null)))
.getMaxHomes(viewer instanceof OnlineUser user ? user : null)))
.ifPresent(viewer::sendMessage);
case NOT_ENOUGH_HOME_SLOTS -> plugin.getLocales()
.getLocale("error_set_home_not_enough_slots",
Integer.toString(plugin.getManager().homes()
.getFreeHomes(viewer instanceof OnlineUser user ? user : null)))
.ifPresent(viewer::sendMessage);
case REACHED_MAX_PUBLIC_HOMES -> plugin.getLocales()
.getLocale("error_edit_home_maximum_public_homes",
Integer.toString(plugin.getManager().homes()
.getMaxPublicHomes(viewer instanceof OnlineUser user ? user : null)))
.getMaxPublicHomes(viewer instanceof OnlineUser user ? user : null)))
.ifPresent(viewer::sendMessage);
default -> {
// Do nothing (silently handle validation errors)
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/locales/bg-bg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ locales:
error_unknown_public_home: '[Error:](#ff3300) [Could not find a public home with the name "%1%".](#ff7e5e)'
error_public_home_invalid: '[Грешка:](#ff3300) [Не можахме да открием публичен дом притежаван от %1% наречен %2%.](#ff7e5e)'
error_set_home_maximum_homes: '[Грешка:](#ff3300) [Можете да поставяте максимум до %1% домове!](#ff7e5e)'
error_set_home_not_enough_slots: '[Error:](#ff3300) [You have used all %1% of your free home slots!](#ff7e5e)'
error_spawn_not_set: '[Error:](#ff3300) [The spawn position has not been set.](#ff7e5e)'
error_no_teleport_requests: '[Error:](#ff3300) [You do not have a pending teleport request.](#ff7e5e)'
error_teleport_warmup_stand_still: '[Error:](#ff3300) [You must be standing still before starting a teleport!](#ff7e5e)'
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/locales/de-de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ locales:
error_unknown_public_home: '[Error:](#ff3300) [Could not find a public home with the name "%1%".](#ff7e5e)'
error_public_home_invalid: '[Fehler:](#ff3300) [Es wurde kein öffentliches Home von %1% namens "%2%" gefunden.](#ff7e5e)'
error_set_home_maximum_homes: '[Fehler:](#ff3300) [Du darfst nicht mehr als %1% Home(s) setzen!](#ff7e5e)'
error_set_home_not_enough_slots: '[Error:](#ff3300) [You have used all %1% of your free home slots!](#ff7e5e)'
error_spawn_not_set: '[Fehler:](#ff3300) [Es wurde keine Spawn-Position festgelegt.](#ff7e5e)'
error_no_teleport_requests: '[Fehler:](#ff3300) [Du hast keine ausstehenden Teleportanfragen.](#ff7e5e)'
error_teleport_warmup_stand_still: '[Fehler:](#ff3300) [Du musst stillstehen, bevor du eine Teleportation startest!](#ff7e5e)'
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/locales/en-gb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ locales:
error_unknown_public_home: '[Error:](#ff3300) [Could not find a public home with the name "%1%".](#ff7e5e)'
error_public_home_invalid: '[Error:](#ff3300) [Could not find a public home owned by %1% called %2%.](#ff7e5e)'
error_set_home_maximum_homes: '[Error:](#ff3300) [You can only set a maximum of %1% homes!](#ff7e5e)'
error_set_home_not_enough_slots: '[Error:](#ff3300) [You have used all %1% of your free home slots!](#ff7e5e)'
error_spawn_not_set: '[Error:](#ff3300) [The spawn position has not been set.](#ff7e5e)'
error_no_teleport_requests: '[Error:](#ff3300) [You do not have a pending teleport request.](#ff7e5e)'
error_teleport_warmup_stand_still: '[Error:](#ff3300) [You must be standing still before starting a teleport!](#ff7e5e)'
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/locales/es-es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ locales:
error_unknown_public_home: '[Error:](#ff3300) [Could not find a public home with the name "%1%".](#ff7e5e)'
error_public_home_invalid: '[Error:](#ff3300) [No se ha podido encontrar una casa pública propiedad de %1% llamada %2%.](#ff7e5e)'
error_set_home_maximum_homes: '[Error:](#ff3300) [Sólo se puede establecer un máximo de %1% casas!](#ff7e5e)'
error_set_home_not_enough_slots: '[Error:](#ff3300) [You have used all %1% of your free home slots!](#ff7e5e)'
error_spawn_not_set: '[Error:](#ff3300) [La posición del spawn no ha sido fijada.](#ff7e5e)'
error_no_teleport_requests: '[Error:](#ff3300) [No tienes solicitudes de teletransporte pendientes.](#ff7e5e)'
error_teleport_warmup_stand_still: '[Error:](#ff3300) [Debes estar quieto ¡antes de iniciar un teletransporte!](#ff7e5e)'
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/locales/fr-fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ locales:
error_unknown_public_home: '[Error:](#ff3300) [Could not find a public home with the name "%1%".](#ff7e5e)'
error_public_home_invalid: '[Erreur :](#ff3300) [L''home %2% posseder par %1% est introuvable.](#ff7e5e)'
error_set_home_maximum_homes: '[Erreur :](#ff3300) [Vous ne pouvez avoir qu''un maximum de %1% homes !](#ff7e5e)'
error_set_home_not_enough_slots: '[Error:](#ff3300) [You have used all %1% of your free home slots!](#ff7e5e)'
error_spawn_not_set: '[Erreur :](#ff3300) [La position du spawn n''a pas été définit.](#ff7e5e)'
error_no_teleport_requests: '[Erreur :](#ff3300) [Vous n''avez aucune demande de téléportation actuellement.](#ff7e5e)'
error_teleport_warmup_stand_still: '[Erreur :](#ff3300) [Vous nez devez plus bouger lors d''une téléportation !](#ff7e5e)'
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/locales/it-it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ locales:
error_unknown_public_home: '[Error:](#ff3300) [Could not find a public home with the name "%1%".](#ff7e5e)'
error_public_home_invalid: '[Errore:](#ff3300) [Non trovo la home di %1% chiamata %2%.](#ff7e5e)'
error_set_home_maximum_homes: '[Errore:](#ff3300) [Puoi impostare un massimo di %1% home!](#ff7e5e)'
error_set_home_not_enough_slots: '[Error:](#ff3300) [You have used all %1% of your free home slots!](#ff7e5e)'
error_spawn_not_set: '[Errore:](#ff3300) [Il punto di spawn non è impostato.](#ff7e5e)'
error_no_teleport_requests: '[Errore:](#ff3300) [Non hai richieste di teletrasporto in sospeso.](#ff7e5e)'
error_teleport_warmup_stand_still: '[Errore:](#ff3300) [Devi attendere e non muoverti mentre ti teletrasporti!](#ff7e5e)'
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/locales/ja-jp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ locales:
error_unknown_public_home: '[Error:](#ff3300) [Could not find a public home with the name "%1%".](#ff7e5e)'
error_public_home_invalid: '[エラー:](#ff3300) [%1% が所有するパブリックホーム %2% は見つかりませんでした。](#ff7e5e)'
error_set_home_maximum_homes: '[エラー:](#ff3300) [最大で %1% までしかホームを設定できません!](#ff7e5e)'
error_set_home_not_enough_slots: '[Error:](#ff3300) [You have used all %1% of your free home slots!](#ff7e5e)'
error_spawn_not_set: '[エラー:](#ff3300) [スポーン位置がまだ設定されていません。](#ff7e5e)'
error_no_teleport_requests: '[エラー:](#ff3300) [保留中のテレポートリクエストはありません。](#ff7e5e)'
error_teleport_warmup_stand_still: '[エラー:](#ff3300) [テレポートを開始する前に静止している必要があります!](#ff7e5e)'
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/locales/ko-kr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ locales:
error_unknown_public_home: '[Error:](#ff3300) [Could not find a public home with the name "%1%".](#ff7e5e)'
error_public_home_invalid: '[오류:](#ff3300) [%1%님이 소유한 공용 집 %2%를 찾을 수 없습니다.](#ff7e5e)'
error_set_home_maximum_homes: '[오류:](#ff3300) [%1%개 이상의 집을 생성할 수 없습니다!](#ff7e5e)'
error_set_home_not_enough_slots: '[Error:](#ff3300) [You have used all %1% of your free home slots!](#ff7e5e)'
error_spawn_not_set: '[오류:](#ff3300) [스폰 위치가 아직 지정되지 않았습니다.](#ff7e5e)'
error_no_teleport_requests: '[오류:](#ff3300) [수락할 이동 요청이 없습니다.](#ff7e5e)'
error_teleport_warmup_stand_still: '[오류:](#ff3300) [이동을 요청하려면 서 있어야 합니다!](#ff7e5e)'
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/locales/pl-pl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ locales:
error_unknown_public_home: '[Error:](#ff3300) [Could not find a public home with the name "%1%".](#ff7e5e)'
error_public_home_invalid: '[Błąd:](#ff3300) [Nie można znaleźć domu publicznego należącego do %1% o nazwie %2%.](#ff7e5e)'
error_set_home_maximum_homes: '[Błąd:](#ff3300) [Możesz ustawić maksymalnie %1% domów!](#ff7e5e)'
error_set_home_not_enough_slots: '[Error:](#ff3300) [You have used all %1% of your free home slots!](#ff7e5e)'
error_spawn_not_set: '[Błąd:](#ff3300) [Pozycja spawnu nie została jeszcze ustawiona.](#ff7e5e)'
error_no_teleport_requests: '[Błąd:](#ff3300) [Nie masz oczekujących prośb o teleportację.](#ff7e5e)'
error_teleport_warmup_stand_still: '[Błąd:](#ff3300) [Musisz stać w miejscu przed rozpoczęciem teleportacji!](#ff7e5e)'
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/locales/pt-br.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ locales:
error_unknown_public_home: '[Error:](#ff3300) [Could not find a public home with the name "%1%".](#ff7e5e)'
error_public_home_invalid: '[Erro:](#ff3300) [Não foi possível encontrar uma casa pública de %1% chamada %2%.](#ff7e5e)'
error_set_home_maximum_homes: '[Erro:](#ff3300) [Você só pode definir no máximo %1% casas!](#ff7e5e)'
error_set_home_not_enough_slots: '[Error:](#ff3300) [You have used all %1% of your free home slots!](#ff7e5e)'
error_spawn_not_set: '[Erro:](#ff3300) [A posição de spawn não foi definida.](#ff7e5e)'
error_no_teleport_requests: '[Erro:](#ff3300) [Você não tem um pedido de teleporte pendente.](#ff7e5e)'
error_teleport_warmup_stand_still: '[Erro:](#ff3300) [Você deve ficar parado antes de iniciar um teleporte!](#ff7e5e)'
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/locales/ru-ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ locales:
error_unknown_public_home: '[Error:](#ff3300) [Could not find a public home with the name "%1%".](#ff7e5e)'
error_public_home_invalid: '[Ошибка:](#ff3300) [Невозможно найти публичный дом, принадлежащий %1%, с именем %2%.](#ff7e5e)'
error_set_home_maximum_homes: '[Ошибка:](#ff3300) [Вы можете установить максимум %1% домов!](#ff7e5e)'
error_set_home_not_enough_slots: '[Error:](#ff3300) [You have used all %1% of your free home slots!](#ff7e5e)'
error_spawn_not_set: '[Ошибка:](#ff3300) [Позиция спавна не установлена.](#ff7e5e)'
error_no_teleport_requests: '[Ошибка:](#ff3300) [У вас нет ожидающего запроса на телепортацию.](#ff7e5e)'
error_teleport_warmup_stand_still: '[Ошибка:](#ff3300) [Перед началом телепортации вы должны стоять на месте!](#ff7e5e)'
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/locales/tr-tr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ locales:
error_unknown_public_home: '[Error:](#ff3300) [Could not find a public home with the name "%1%".](#ff7e5e)'
error_public_home_invalid: '[Hata:](#ff3300) [%1% tarafından sahip olunan, %2% adında bir herkese açık ev bulunamadı.](#ff7e5e)'
error_set_home_maximum_homes: '[Hata:](#ff3300) [En fazla %1% ev ayarlayabilirsiniz!](#ff7e5e)'
error_set_home_not_enough_slots: '[Error:](#ff3300) [You have used all %1% of your free home slots!](#ff7e5e)'
error_spawn_not_set: '[Hata:](#ff3300) [Spawn konumu ayarlanmadı.](#ff7e5e)'
error_no_teleport_requests: '[Hata:](#ff3300) [Bekleyen bir ışınlanma isteğiniz yok.](#ff7e5e)'
error_teleport_warmup_stand_still: '[Hata:](#ff3300) [Işınlanmaya başlamadan önce hareketsiz duruyor olmalısınız!](#ff7e5e)'
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/locales/uk-ua.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ locales:
error_unknown_public_home: '[Error:](#ff3300) [Could not find a public home with the name "%1%".](#ff7e5e)'
error_public_home_invalid: '[Помилка:](#ff3300) [Не знайдено домівку гравця %1% з назвою %2%.](#ff7e5e)'
error_set_home_maximum_homes: '[Помилка:](#ff3300) [Максимальна кількість твоїх домівок: %1%](#ff7e5e)'
error_set_home_not_enough_slots: '[Error:](#ff3300) [You have used all %1% of your free home slots!](#ff7e5e)'
error_spawn_not_set: '[Error:](#ff3300) [The spawn position has not been set.](#ff7e5e)'
error_no_teleport_requests: '[Error:](#ff3300) [You do not have a pending teleport request.](#ff7e5e)'
error_teleport_warmup_stand_still: '[Error:](#ff3300) [You must be standing still before starting a teleport!](#ff7e5e)'
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/locales/zh-cn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ locales:
error_unknown_public_home: '[Error:](#ff3300) [找不到名为"%1%"的公共家.](#ff7e5e)'
error_public_home_invalid: '[错误:](#ff3300) [%1% 没有 %2% 公共家.](#ff7e5e)'
error_set_home_maximum_homes: '[错误:](#ff3300) [最多可以设置 %1% 个家!](#ff7e5e)'
error_set_home_not_enough_slots: '[Error:](#ff3300) [You have used all %1% of your free home slots!](#ff7e5e)'
error_spawn_not_set: '[错误:](#ff3300) [重生点尚未设置](#ff7e5e)'
error_no_teleport_requests: '[错误:](#ff3300) [你没有待处理的传送请求](#ff7e5e)'
error_teleport_warmup_stand_still: '[错误:](#ff3300) [在传送时你不能移动!](#ff7e5e)'
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/locales/zh-tw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
error_unknown_public_home: '[Error:](#ff3300) [Could not find a public home with the name "%1%".](#ff7e5e)'
error_public_home_invalid: '[錯誤:](#ff3300) [沒有在 %1% 名下找到名為 %2% 的公開傳點.](#ff7e5e)'
error_set_home_maximum_homes: '[錯誤:](#ff3300) [最多可以設置 %1% 個家!](#ff7e5e)'
error_set_home_not_enough_slots: '[Error:](#ff3300) [You have used all %1% of your free home slots!](#ff7e5e)'
error_spawn_not_set: '[錯誤:](#ff3300) [重生點尚未設置.](#ff7e5e)'
error_no_teleport_requests: '[錯誤:](#ff3300) [您沒有待處理的傳送請求.](#ff7e5e)'
error_teleport_warmup_stand_still: '[錯誤:](#ff3300) [在傳送時您不能移動!](#ff7e5e)'
Expand Down

0 comments on commit 386ea57

Please sign in to comment.