diff --git a/src/main/java/me/william278/huskhomes2/commands/HuskHomesCommand.java b/src/main/java/me/william278/huskhomes2/commands/HuskHomesCommand.java index 11ac4fee..d991545e 100644 --- a/src/main/java/me/william278/huskhomes2/commands/HuskHomesCommand.java +++ b/src/main/java/me/william278/huskhomes2/commands/HuskHomesCommand.java @@ -26,7 +26,7 @@ public class HuskHomesCommand extends CommandBase implements TabCompleter { .append("[").append(plugin.getDescription().getDescription()).append("](gray)\n") .append("[• Author:](white) [William278](gray show_text=&7Click to pay a visit open_url=https://youtube.com/William27528)\n") .append("[• Contributors:](white) [imDaniX](gray show_text=&7Code, refactoring), [Log1x](gray show_text=&7Code)\n") - .append("[• Translators:](white) [SnivyJ](gray show_text=&7Simplified Chinese, zh-cn), [Villag3r_](gray show_text=&7Italian, it-it), [ReferTV](gray show_text=&7Polish, pl) \n") + .append("[• Translators:](white) [SnivyJ](gray show_text=&7Simplified Chinese, zh-cn), [TonyPak](gray show_text=&7Traditional Chinese, zh-tw), [Villag3r_](gray show_text=&7Italian, it-it), [ReferTV](gray show_text=&7Polish, pl) \n") .append("[• Help Wiki:](white) [[Link]](#00fb9a show_text=&7Click to open link open_url=https://github.com/WiIIiam278/HuskHomes2/wiki/)\n") .append("[• Report Issues:](white) [[Link]](#00fb9a show_text=&7Click to open link open_url=https://github.com/WiIIiam278/HuskHomes2/issues)\n") .append("[• Support Discord:](white) [[Link]](#00fb9a show_text=&7Click to join open_url=https://discord.gg/tVYhJfyDWG)"); diff --git a/src/main/java/me/william278/huskhomes2/data/SQL/MySQL.java b/src/main/java/me/william278/huskhomes2/data/SQL/MySQL.java index 93e6662c..d93a0717 100644 --- a/src/main/java/me/william278/huskhomes2/data/SQL/MySQL.java +++ b/src/main/java/me/william278/huskhomes2/data/SQL/MySQL.java @@ -101,17 +101,13 @@ public class MySQL extends Database { @Override public void load() { connection = getConnection(); - try { - Statement statement = connection.createStatement(); + try(Statement statement = connection.createStatement()) { for (String tableCreationStatement : SQL_SETUP_STATEMENTS) { statement.execute(tableCreationStatement); } - statement.close(); - } catch (SQLException exception) { - plugin.getLogger().log(Level.SEVERE, "An error occurred creating tables: ", exception); - exception.printStackTrace(); + } catch (SQLException e) { + plugin.getLogger().log(Level.SEVERE, "An error occurred creating tables: ", e); } - initialize(); } diff --git a/src/main/java/me/william278/huskhomes2/data/SQL/SQLite.java b/src/main/java/me/william278/huskhomes2/data/SQL/SQLite.java index 5e01f250..7db0ecba 100644 --- a/src/main/java/me/william278/huskhomes2/data/SQL/SQLite.java +++ b/src/main/java/me/william278/huskhomes2/data/SQL/SQLite.java @@ -112,17 +112,13 @@ public class SQLite extends Database { @Override public void load() { connection = getConnection(); - try { - Statement statement = connection.createStatement(); + try (Statement statement = connection.createStatement()) { for (String tableCreationStatement : SQL_SETUP_STATEMENTS) { statement.execute(tableCreationStatement); } - statement.close(); - } catch (SQLException exception) { - plugin.getLogger().log(Level.SEVERE, "An error occurred creating tables: ", exception); - exception.printStackTrace(); + } catch (SQLException e) { + plugin.getLogger().log(Level.SEVERE, "An error occurred creating tables: ", e); } - initialize(); } diff --git a/src/main/resources/languages/zh-tw.yml b/src/main/resources/languages/zh-tw.yml new file mode 100644 index 00000000..e24faaf7 --- /dev/null +++ b/src/main/resources/languages/zh-tw.yml @@ -0,0 +1,121 @@ +error_no_permission: '[錯誤:](#ff3300) [你沒有權限去完成這個指令](#ff7e5e)' +error_no_last_position: '[錯誤:](#ff3300) [你沒有最後一個可用傳送點來返回](#ff7e5e)' +teleporting_last_position: '[在](#00fb9a) [%1%](#00fb9a bold) [秒內返回你上一個傳送點](#00fb9a)' +teleporting_offline_player: '[傳送你到 %1% 最後離線的位置...](#00fb9a)' +teleporting_countdown_start: '[你將在](#00fb9a) [%1%](#00fb9a bold) [秒後被傳送](#00fb9a)' +teleporting_cancelled_movement: '[傳送失敗; 請不要在傳送過程中移動!](#ff7e5e)' +teleporting_cancelled_damage: '[傳送失敗; 請不要在傳送過程中受到傷害!](#ff7e5e)' +teleporting_complete: '[傳送成功!](#00fb9a)' +teleporting_action_bar_countdown: '[傳送在](#00fb9a) [%1%](#00fb9a bold)[...](#00fb9a)' +teleporting_action_bar_cancelled: '[傳送取消!](#ff7e5e)' +teleporting_please_stand_still: '[請不要在傳送過程中移動或收到傷害.](gray)' +home_deleted: '[成功刪除](#00fb9a) [%1%](#00fb9a bold) [這個家](#00fb9a)' +warp_deleted: '[成功刪除](#00fb9a) [%1%](#00fb9a bold) [這個傳送點](#00fb9a)' +error_home_invalid: '[錯誤:](#ff3300) [你沒有叫 “%1%” 的家](#ff7e5e)' +error_warp_invalid: '[錯誤:](#ff3300) [沒有叫做 “%1%” 的傳送點](#ff7e5e)' +error_invalid_syntax: '[錯誤:](#ff3300) [語法不正確.使用: %1%](#ff7e5e)' +edit_home_title: '\n[編輯家的詳細信息](#00fb9a) [%1%](#00fb9a bold)[:](#00fb9a)' +edit_home_options: '\n[[傳送]](green show_text=&7傳送到你的家 run_command=/huskhomes:home %1%.%2%) [[刪除]](red show_text=&7Delete your home run_command=/huskhomes:delhome %1%) [[更新位置]](blue show_text=&7更新家的坐標到 run_command=/huskhomes:edithome %1% location)\n[[更改名字]](yellow show_text=&7更改家的名字 suggest_command=/huskhomes:edithome %1% rename ) [[編輯描述]](gold show_text=&7更改家的描述 suggest_command=/huskhomes:edithome %1% description )\n' +edit_home_options_make_public: '\n[[傳送]](green show_text=&7傳送到你的家 run_command=/huskhomes:home %1%.%2%) [[刪除]](red show_text=&7Delete your home run_command=/huskhomes:delhome %1%) [[更新位置]](blue show_text=&7更新家的坐標到 run_command=/huskhomes:edithome %1% location)\n[[更改名字]](yellow show_text=&7更改家的名字 suggest_command=/huskhomes:edithome %1% rename ) [[編輯描述]](gold show_text=&7更改家的描述 suggest_command=/huskhomes:edithome %1% description ) [[更改隱私為公共]](dark_green show_text=&7開放家的傳送到全部人 run_command=/huskhomes:edithome %1% public)\n' +edit_home_options_make_private: '\n[[傳送]](green show_text=&7傳送到你的家 run_command=/huskhomes:home %1%.%2%) [[刪除]](red show_text=&7Delete your home run_command=/huskhomes:delhome %1%) [[更新位置]](blue show_text=&7更新家的坐標到 run_command=/huskhomes:edithome %1% location)\n[[更改名字]](yellow show_text=&7更改家的名字 suggest_command=/huskhomes:edithome %1% rename ) [[編輯描述]](gold show_text=&7更改家的描述 suggest_command=/huskhomes:edithome %1% description ) [[更改隱私為私人]](dark_red show_text=&7更改家的傳送為近自己可見 run_command=/huskhomes:edithome %1% private)\n' +edit_home_privacy_private: '• 訪問: &#ff7e5e&私人住宅 &7(只有你可以訪問)' +edit_home_privacy_public: '• 訪問: &a公共 &7(所有人都可以訪問)' +edit_home_privacy_public_success: '[成功更改家 ](#00fb9a) [%1%](#00fb9a bold)[ 的設置為開放到所有人.](#00fb9a)' +edit_home_privacy_public_success_economy: '[成功更改家 ](#00fb9a) [%1%](#00fb9a bold)[ 的設置為付費參觀,價格: %2%.](#00fb9a)' +edit_home_privacy_private_success: '[成功更改家 ](#00fb9a) [%1%](#00fb9a bold)[ 的設置為私人.](#00fb9a)' +error_edit_home_privacy_already_public: '[錯誤:](#ff3300) [你的家已經設置為公共的了.](#ff7e5e)' +error_edit_home_privacy_already_private: '[錯誤:](#ff3300) [你的家已經設置為私人的了.](#ff7e5e)' +error_edit_home_privacy_no_permission: '[錯誤:](#ff3300) [你沒有權限去更改家為公共.](#ff7e5e)' +error_edit_home_description_length: '[錯誤:](#ff3300) [家的描述必須小於255個字符.](#ff7e5e)' +error_edit_home_description_characters: '[錯誤:](#ff3300) [家的字符暫不支持中文](#ff7e5e)' +edit_home_update_location: '[更改位置](#00fb9a) [%1%](#00fb9a bold) [到你現在的位置.](#00fb9a)' +edit_home_update_description: '[更改描述](#00fb9a) [%1%](#00fb9a bold) [到 "%2%"](#00fb9a)' +edit_home_update_name: '[成功更改家的名字: %1% →](#00fb9a) [%2%](#00fb9a bold)' +edit_warp_title: '\n[編輯傳送點的詳細信息](#00fb9a) [%1%](#00fb9a bold)[:](#00fb9a)' +edit_warp_options: '\n[[傳送]](green show_text=&7傳送你到這個傳送點 run_command=/huskhomes:warp %1%) [[刪除]](red show_text=&7刪除這個傳送點 run_command=/huskhomes:delwarp %1%) [[更新位置]](blue show_text=&7更改這個傳送點的位置 run_command=/huskhomes:editwarp %1% location)\n[[更改名字]](yellow show_text=&7更改這個傳送點的名字 suggest_command=/huskhomes:editwarp %1% rename ) [[編輯描述]](gold show_text=&7更改傳送點的描述 suggest_command=/huskhomes:editwarp %1% description )\n' +error_edit_warp_description_length: '[錯誤:](#ff3300) [傳送點的描述必須小於255個字符.](#ff7e5e)' +error_edit_warp_description_characters: '[錯誤:](#ff3300) [傳送點的字符暫不支持中文](#ff7e5e)' +edit_warp_update_location: '[更改傳送點的位置](#00fb9a) [%1%](#00fb9a bold) [到你現在的位置.](#00fb9a)' +edit_warp_update_description: '[更改描述](#00fb9a) [%1%](#00fb9a bold) [to "%2%".](#00fb9a)' +edit_warp_update_name: '[成功更改傳送點的名字. %1% →](#00fb9a) [%2%](#00fb9a bold)' +edit_description: '• 描述: &7%1%' +edit_location: '• 坐標: &7%1%, %2%, %3%' +edit_world: '• 世界: &7%1%' +edit_server: '• 伺服器: &7%1%' +edit_timestamp: '• Created: &7%1%' +error_no_homes_set: '[錯誤:](#ff3300) [你還沒有設置任何一個家!](#ff7e5e)' +error_no_public_homes_set: '[錯誤:](#ff3300) [沒有公共的家被設置!](#ff7e5e)' +error_no_warps_set: '[錯誤:](#ff3300) [沒有地標被設置!](#ff7e5e)' +private_home_list_page_top: '\n[%1%’的家:](#00fb9a) [(](#00fb9a)[%2%-%3%](#00fb9a bold) [在](#00fb9a) [%4%](#00fb9a bold)[)](#00fb9a)\n' +public_home_list_page_top: '\n[公共的家:](#00fb9a) [(](#00fb9a)[%1%-%2%](#00fb9a bold) [在](#00fb9a) [%3%](#00fb9a bold)[)](#00fb9a)\n' +warp_list_page_top: '\n[傳送點:](#00fb9a) [(](#00fb9a)[%1%-%2%](#00fb9a bold) [在](#00fb9a) [%3%](#00fb9a bold)[)](#00fb9a)\n' +error_public_home_invalid: '[錯誤:](#ff3300) [沒有找到 %1% 的名為 %2% 的公共房屋.](#ff7e5e)' +error_set_home_invalid_characters: '[錯誤:](#ff3300) [家的字符暫不支持中文](#ff7e5e)' +error_set_home_invalid_length: '[錯誤:](#ff3300) [家的名字最多支持16個字符](#ff7e5e)' +error_set_warp_invalid_characters: '[錯誤:](#ff3300) [傳送點的字符暫不支持中文](#ff7e5e)' +error_set_warp_invalid_length: '[錯誤:](#ff3300) [傳送點的名字最多支持16個字符](#ff7e5e)' +error_set_home_maximum_homes: '[錯誤:](#ff3300) [你最多可以設置 %1% 個家!](#ff7e5e)' +error_insufficient_funds: '[錯誤:](#ff3300) [你沒有足夠的錢! (需要花費: %1%)](#ff7e5e)' +set_home_spent_money: '[成功花費 %1% 去設置了一個額外的家!](gray)' +set_home_used_free_slots: '[你已經耗盡了所有可設置的家 (%1%); 設置額外的家需要花費 %2% .](gray)' +set_home_success: '[成功地設置了一個名](#00fb9a) [%1%](#00fb9a bold) [的家](#00fb9a)' +set_warp_success: '[成功地設置了一個名](#00fb9a) [%1%](#00fb9a bold) [的傳送點](#00fb9a)' +error_set_home_name_taken: '[錯誤:](#ff3300) [這個名字已經被你用過了.](#ff7e5e)' +error_set_warp_name_taken: '[錯誤:](#ff3300) [這個傳送點的名字已經被用過了.](#ff7e5e)' +set_spawn_success: '[成功設置該伺服器的出生點為你現在的位置.](#00fb9a)' +error_spawn_undefined: '[錯誤:](#ff3300) [這個伺服器沒有設置出生點.](#ff7e5e)' +error_tpa_no_pending_request: '[錯誤:](#ff3300) [你沒有需要處理的傳送請求.](#ff7e5e)' +error_tpa_request_expired: '[錯誤:](#ff3300) [你的傳送請求已經過期.](#ff7e5e)' +error_player_not_found: '[錯誤:](#ff3300) [沒有找到玩家 %1%.](#ff7e5e)' +return_by_death: '[回到上一個死亡點?](gray) [/back](#00fb9a show_text=�fb9a&點擊來回到上一次死亡的地點 run_command=/back)' +teleport_request_options: '[傳送請求:](gray) [[同意傳送]](#00fb9a show_text=�fb9a&同意這次傳送 request; /tpaccept run_command=/tpaccept) [•](gray) [[殘忍拒絕]](#ff7e5e show_text=&#ff7e5e&拒絕本次傳送 request; /tpdeny run_command=/tpdeny)' +tpa_you_accepted: '[你接受了 %1% 的傳送請求](#00fb9a)' +tpa_you_declined: '[你拒絕了 %1% 的傳送請求](#ff7e5e)' +tpa_has_accepted: '[%1% 接受了你的傳送請求](#00fb9a)' +tpa_has_declined: '[%1% 拒絕了你的傳送請求](#ff7e5e)' +tpa_request_sent: '[你發送傳送請求給](#00fb9a) [%1%](#00fb9a bold)' +tpa_request_ask: '[%1%](#00fb9a bold) [請求傳送到你](#00fb9a)' +tpahere_request_sent: '[你發送了一個傳送請求給](#00fb9a) [%1%](#00fb9a bold) [來傳送到你](#00fb9a)' +tpahere_request_ask: '[%1%](#00fb9a bold) [請求你傳送到他們那里](#00fb9a)' +error_tp_self: '[錯誤:](#ff3300) [你不能自己傳送自己!](#ff7e5e)' +error_rtp_invalid_dimension: '[錯誤:](#ff3300) [你不能在這個維度使用隨機傳送!](#ff7e5e)' +error_rtp_cooldown: '[錯誤:](#ff3300) [你必須等待 %1% 分鐘才能再次隨機傳送.](#ff7e5e)' +rtp_spent_money: '[花費 %1% 隨機傳送.](gray)' +back_spent_money: '[花費 %1% 回到你的上一個地點.](gray)' +error_command_disabled: '[錯誤:](#ff3300) [該命令已禁用!](#ff7e5e)' +error_console_only: '[錯誤:](#ff3300) [該命令只能從伺服器控制台運行.](#ff7e5e)' +error_tp_invalid_world: '[錯誤:](#ff3300) [請指定有效的伺服器世界.](#ff7e5e)' +error_rtp_randomization_timeout: '[錯誤:](#ff3300) [找不到安全的隨機位置傳送你.](#ff7e5e)' +list_item_divider: ' [•](gray) ' +home_list_item: '[[%1%]](show_text=&7%2% run_command=/huskhomes:edithome %2%.%1%)' +public_home_list_item: '[[%1%]](show_text=�fb9a&%2%: &7%3% run_command=/huskhomes:phome %2%.%1%)' +warp_list_item: '[[%1%]](show_text=&7%2% run_command=/huskhomes:warp %1%)' +home_default_description: '%1% 的家' +warp_default_description: '可公開訪問的地標' +delete_all_homes_confirm: '[警告:](#ff3300) [你確定要刪除這個家麽?](#ff7e5e)\n[一旦你確認,就無法恢覆它們.](gray)\n[→](gray) [[確認]](#ff3300 show_text=&#ff3300&點擊來確認本次刪除操作.這個操作是不可逆的. run_command=/delhome all confirm)' +delete_all_warps_confirm: '[Warning:](#ff3300) [你確定要刪除這個傳送點麽?](#ff7e5e)\n[一旦你確認,就無法恢覆它們.](gray)\n[→](gray) [[確認]](#ff3300 show_text=&#ff3300&點擊來確認本次刪除操作.這個操作是不可逆的. run_command=/delwarp all confirm)' +delete_all_homes_success: '[成功刪除](#00fb9a) [%1%](#00fb9a bold) [家.](#00fb9a)' +delete_all_warps_success: '[成功刪除所有](#00fb9a) [%1%](#00fb9a bold) [伺服器傳送點](#00fb9a)' +error_permission_restricted_warp: '[錯誤:](#ff3300) [You do not have permission to warp to %1%!](#ff7e5e)' +teleporting_complete_console: '[控制台傳送你到 %1%.](gray)' +spawn_warp_default_description: '這個伺服器的 /spawn 位置' +error_invalid_page_number: '[錯誤:](#ff3300) [請指定有效的頁碼.](#ff7e5e)' +page_options: '\n[←](gray show_text=&7View previous page run_command=%1%) [查看頁面 %2%/%3%](#00fb9a) [→](gray show_text=&7查看下一頁 page run_command=%4%)' +page_options_min: '\n[查看頁面 %1%/%2%](#00fb9a) [→](gray show_text=&7查看下一頁 page run_command=%3%)' +page_options_min_max: '\n[查看頁面 %1%/%2%](#00fb9a)' +page_options_max: '\n[←](gray show_text=&7查看上一頁 run_command=%1%) [Viewing Page %2%/%3%](#00fb9a)' +page_no_items: '[(此頁上沒有要顯示的項目)](gray show_text=&7請嘗試其他頁碼)' +command_list_header: '\n[HuskHomes](#00fb9a bold) [| 指令列表](#00fb9a)' +error_invalid_on_arrival: '[錯誤:](#ff3300) [無法完成你的標簽傳送,因為找不到目標世界。](#ff7e5e)' +tpignore_toggle_on: '[你現在是](#00fb9a) [勿擾模式](#00fb9a bold) [拒絕所有的傳送請求.](#00fb9a) [(點擊來切換)](gray show_text=&7單擊以開啟接受傳送請求 run_command=/huskhomes:tpignore)' +tpignore_toggle_off: '[你現在是](#00fb9a) [正常模式](#00fb9a bold) [接受所有的傳送請求.](#00fb9a) [(點擊來切換)](gray show_text=&7單擊以關閉接受傳送請求 run_command=/huskhomes:tpignore)' +tpignore_on_reminder: '[您當前正在忽略接受傳送請求!](gray) [(點擊來切換)](gray show_text=&7單擊以開啟接受傳送請求 run_command=/huskhomes:tpignore)' +error_ignoring_teleport_requests: '[錯誤:](#ff3300) [你當前正在忽略傳送請求!](#ff7e5e) [(點擊來切換)](#ff7e5e show_text=&#ff7e5e&單擊以開啟接受傳送請求 run_command=/huskhomes:tpignore)' +error_no_offline_position: '[錯誤:](#ff3300) [找不到 %1% 上次離線的位置.](#ff7e5e)' +error_invalid_player: '[Error:](#ff3300) [Please specify the name of a valid player!](#ff7e5e)' +error_no_homes_set_other: '[Error:](#ff3300) [%1% hasn''t set any homes!](#ff7e5e)' +error_home_invalid_other: '[Error:](#ff3300) [%1% doesn''t have a home set named "%2%"](#ff7e5e)' +home_deleted_other: '[Successfully deleted %1%''s home,](#00fb9a) [%2%](#00fb9a bold)' +edit_home_privacy_private_other: '• Access: &#ff7e5e&Private &7(Only %1% can use it)' +edit_home_title_other: '\n[Edit home details for %1%''s home,](#00fb9a) [%2%](#00fb9a bold)[:](#00fb9a)' +command_list_item: '[/%1%](#00fb9a show_text=�fb9a&%2% suggest_command=/%1%) [•](white) [%3%](gray)' \ No newline at end of file