From 8e8ce18affda786a7c0aaac88e773ba7f7803656 Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Fri, 16 Jul 2021 19:15:05 +0200 Subject: [PATCH 1/5] Add missing API classes in standalone mode --- Minepacks/pom.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Minepacks/pom.xml b/Minepacks/pom.xml index b87237a..1ae5e65 100644 --- a/Minepacks/pom.xml +++ b/Minepacks/pom.xml @@ -198,6 +198,9 @@ at.pcgamingfreaks.Minepacks.Bukkit.API.Callback at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksPlugin at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksCommandManager + at.pcgamingfreaks.Minepacks.Bukkit.API.WorldBlacklistMode + at.pcgamingfreaks.Minepacks.Bukkit.API.ItemFilter + at.pcgamingfreaks.Minepacks.Bukkit.API.Events.* From cbdd6d5ac6c87ea2c1b1342dafc56fda5220d300 Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Sat, 17 Jul 2021 15:07:49 +0200 Subject: [PATCH 2/5] Fix client ui not updating correctly after interacting with the backpack item (#174) --- .../pcgamingfreaks/Minepacks/Bukkit/Listener/ItemShortcut.java | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Listener/ItemShortcut.java b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Listener/ItemShortcut.java index ba3f283..32bd3cf 100644 --- a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Listener/ItemShortcut.java +++ b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Listener/ItemShortcut.java @@ -243,7 +243,7 @@ public void onItemClick(InventoryClickEvent event) } else if(event.getClick() == ClickType.RIGHT || event.getClick() == ClickType.SHIFT_RIGHT) { - player.performCommand(openCommand); + plugin.getServer().getScheduler().runTask(plugin, () -> { player.performCommand(openCommand); }); event.setCancelled(true); } else if(event.getAction() == InventoryAction.MOVE_TO_OTHER_INVENTORY) diff --git a/pom.xml b/pom.xml index d160178..be98df6 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ pom - 2.4.1 + 2.4.2 UTF-8 UTF-8 From d24ca1cc7ba1063c179625397298230a824bd295 Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Fri, 13 Aug 2021 23:04:46 +0200 Subject: [PATCH 3/5] Add traditional Chinese language file (thanks to Special-Base) (Closes #175) --- Minepacks/resources/lang/zh_tw.yml | 117 +++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 Minepacks/resources/lang/zh_tw.yml diff --git a/Minepacks/resources/lang/zh_tw.yml b/Minepacks/resources/lang/zh_tw.yml new file mode 100644 index 0000000..d36b57c --- /dev/null +++ b/Minepacks/resources/lang/zh_tw.yml @@ -0,0 +1,117 @@ +# To simplify the customisation and translation process please check out the editor: https://ptp.pcgamingfreaks.at + +Language: + NotFromConsole: "&c指令不能從控制台使用" + Ingame: + NoPermission: "&c你沒有權限使用" + WorldDisabled: "&c這個世界不允許使用背包" + NaN: "[\"\",{\"text\":\"輸入的值不是數字!\",\"color\":\"red\"}]" + OwnBackpackClose: "背包關閉!" + OwnBackpackClose_SendMethod: "action_bar" + #Parameter: {OwnerName}, {OwnerDisplayName} + PlayerBackpackClose: "{OwnerName} 關閉背包!" + PlayerBackpackClose_SendMethod: "action_bar" + InvalidBackpack: "無效的背包." + NotAllowedInBackpack: "&c{ItemName} 不允許放在背包裡." + NotAllowedInBackpack_SendMethod: "action_bar" + DontRemoveShortcut: "&c您不得從庫存中刪除背包快捷方式!" + DontRemoveShortcut_SendMethod: "action_bar" + Open: + #Parameter: {TimeLeft} time in seconds till the backpack can be reopened, {TimeSpanLeft} time formatted as string till the backpack can be reopened + Cooldown: "[{\"text\":\"請稍等 \",\"color\":\"dark_green\"},{\"text\":\"{TimeSpanLeft}\",\"hoverEvent\":{\"action\":\"show_text\",\"value\":\"{TimeLeft} 秒\"}},{\"text\":\" 直到你重新打開你的背包.\"}]" + #Parameter: {CurrentGameMode}, {AllowedGameModes} + WrongGameMode: "你不能在當前遊戲模式下打開背包." + Clean: + BackpackCleaned: "背包已清空" + BackpackCleanedBy: "您的背包已被清空 {DisplayName}&r." + BackpackCleanedOther: "{DisplayName}'s&r 背包已清空." + Sort: + Sorted: "整理背包." + Help: + Header: "&6### 擴充背包 指令幫助 ###" + Footer: "&6#############################" + Reload: + Reloading: "&3正在重新讀取 Minepacks ..." + Reloaded: "&3Minepacks 重新讀取完畢! 翻譯版本 2.4.2 Specialbase#0428" + Update: + CheckingForUpdates: "&1檢查更新 ..." + Updated: "[\"\",{\"text\":\"插件已經更新,重新啟動伺服器後生效/reload.\",\"color\":\"yellow\"}]" + NoUpdate: "[\"\",{\"text\":\"沒有更新的版本.\",\"color\":\"gold\"}]" + UpdateFail: "[\"\",{\"text\":\"查找更新時出現問題! 請檢查控制台!\",\"color\":\"red\"}]" + # You can change this message if you like to, but don't cry if the link isn't linking to the plugin anymore! + UpdateAvailable: "[{\"text\":\"有更新可用! 請前往 \\\"\",\"color\":\"green\"},{\"text\":\"https://www.spigotmc.org/resources/19286/\",\"color\":\"yellow\",\"underlined\":true,\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://www.spigotmc.org/resources/19286/\"}},{\"text\":\"\\\" to download it!\"}]" + Backup: + Created: "背包回復成功." + NoBackpack: "玩家沒有背包或他的背包是空的" + Restore: + BackupsPerPage: 10 + Headline: "[\"\",{\"text\":\"回復\",\"color\":\"yellow\"},{\"text\":\" - \",\"color\":\"white\"},{\"text\":\"顯示頁面 {CurrentPage}/{MaxPage}\",\"color\":\"gold\"}]" + Footer: "[{\"text\":\"<<< 上一頁 <<<\",\"color\":\"gray\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/{MainCommand} {SubCommand} {CurrentPage}--\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":\"/{MainCommand} {SubCommand} {CurrentPage}--\"}},{\"text\":\" Showing page {CurrentPage}/{MaxPage} \",\"color\":\"gold\"},{\"text\":\">>> 下一頁 >>>\",\"color\":\"gray\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/{MainCommand} {SubCommand} {CurrentPage}++\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":\"/{MainCommand} {SubCommand} {CurrentPage}++\"}}]" + BackupEntry: "[\"\",{\"text\":\"{BackupIdentifier}\",\"clickEvent\":{\"action\":\"suggest_command\",\"value\":\"/{MainCommand} {SubCommand} {BackupIdentifier}\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":\"User: {BackupPlayerName} ({BackupPlayerUUID})\\nCreated: {BackupDate}\"}}]" + NoValidBackup: "無法尋找備份 {BackupIdentifier} " + NoUserToRestoreToFound: "找不到可將備份還原到的有效用戶" + # No Json!!! + ParameterBackupName: "backup_name" + # No Json!!! + DateFormat: "yyyy.MM.dd HH:mm:ss" + Restored: "還原備份成功" + InventoryClear: + UnknownPlayer: "&c找不到玩家 {Name}!" + Cleared: "清空背包." + ClearedOther: "{DisplayName}&r 已清空背包." + ClearedOtherTarget: "你的背包已遭清空 {DisplayName}&r." + Commands: + HelpFormat: "[\"\",{\"text\":\"/{MainCommand} {SubCommand} {Parameters}\",\"clickEvent\":{\"action\":\"suggest_command\",\"value\":\"/{MainCommand} {SubCommand}\"}},{\"text\":\" - \",\"color\":\"white\"},{\"text\":\"{Description}\",\"color\":\"aqua\"}]" + PlayerNameVariable: "player_name" + Description: + Backpack: "開啟你的背包" + Sort: "整理你的背包" + Clean: "清空你的背包" + CleanOthers: "清理其他玩家的背包" + OpenOthers: "看茶另一個玩家的背包" + Reload: "重新整理這個插件" + Update: "檢查更新" + Version: "列出有關插件及其依賴項的版本詳細信息" + Backup: "新增玩家背包的備份." + Restore: "恢復備份." + RestoreList: "列出所有玩家的備份." + Help: "顯示此指令表." + Migrate: "將使用的數據庫從一種類型遷移到另一種類型." + +Command: + Backpack: + - bag + Open: + - open + Sort: + - sort + Clean: + - clean + - clear + - empty + Reload: + - reload + - restart + Update: + - update + Backup: + - backup + Restore: + - restore + ListBackups: + - listbackups + Version: + - version + Help: + - help + InventoryClear: + - clear + - inventoryclear + - clean + +# Will be shown in the console during startup +LanguageName: "繁體中文" +Author: "Specialbase#0428" + +# Language file version. Don't touch it! +Version: 18 \ No newline at end of file From 5f948e15088583cc6eea4520861a8740c1cdb31f Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Sun, 22 Aug 2021 15:49:06 +0200 Subject: [PATCH 4/5] Fix BungeeCord mode warnings --- Minepacks/resources/config.yml | 4 ++-- .../Minepacks/Bukkit/Database/Config.java | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Minepacks/resources/config.yml b/Minepacks/resources/config.yml index a44bf43..eec0207 100644 --- a/Minepacks/resources/config.yml +++ b/Minepacks/resources/config.yml @@ -181,7 +181,7 @@ ItemShortcut: ImproveDeathChestCompatibility: false # Prevents the backpack from being used as a hat BlockAsHat: false - # Opens a container if right clicked while holding the backpack shortcut in the hand. This option will only work on MC 1.13 or newer. + # Opens a container if right-clicked while holding the backpack shortcut in the hand. This option will only work on MC 1.13 or newer. OpenContainerOnRightClick: false # The id of the slot that should be preferred when giving a player the shortcut item PreferredSlotId: -1 @@ -211,7 +211,7 @@ Misc: # When auto update is disabled you still can use the build in update function manually with /backpack update Enabled: true Channel: ${updateChannel} - # Enable this option if you are using a BungeeCord setup! + # Enable this option if you are using a BungeeCord setup and want to share the plugin's database across multiple servers. UseBungeeCord: false # Config file version. Don't touch it! diff --git a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Config.java b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Config.java index 07285f7..6551b92 100644 --- a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Config.java +++ b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Config.java @@ -223,13 +223,19 @@ public boolean isBungeeCordModeEnabled() { boolean useBungee = getConfigE().getBoolean("Misc.UseBungeeCord", false); boolean spigotUsesBungee = Utils.detectBungeeCord(); + boolean shareableDB = getDatabaseType().equals("mysql") || getDatabaseType().equals("global"); if(useBungee && !spigotUsesBungee) { - logger.warning("You have BungeeCord enabled, but it looks like you have not enabled it in your spigot.yml! You probably should check your configuration."); + logger.warning("You have BungeeCord enabled for the plugin, but it looks like you have not enabled it in your spigot.yml! You probably should check your configuration."); } - else if(!useBungee && spigotUsesBungee && getDatabaseType().equals("mysql")) + else if(!useBungee && spigotUsesBungee && shareableDB) { - logger.warning("Your server is running behind a BungeeCord server. If you are using the plugin please make sure to also enable the 'UseBungeeCord' config option."); + logger.warning("Your server is running behind a BungeeCord server. If you are using the plugin on more than one server with a shared database, please make sure to also enable the 'UseBungeeCord' config option."); + } + else if(useBungee && !shareableDB) + { + logger.info("You have enabled BungeeCord mode for the plugin, but are not using a shared MySQL database."); + return false; // No need to enable BungeeCord mode if the database does not support it } return useBungee; } From 272d6740073658c561c4f222dfa0d05c6a62a382 Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Tue, 24 Aug 2021 19:11:26 +0200 Subject: [PATCH 5/5] Make it possible to run debug command twice --- .../at/pcgamingfreaks/Minepacks/Bukkit/Command/DebugCommand.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Command/DebugCommand.java b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Command/DebugCommand.java index e2e73d4..ff48b07 100644 --- a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Command/DebugCommand.java +++ b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Command/DebugCommand.java @@ -120,6 +120,7 @@ public void execute(@NotNull CommandSender commandSender, @NotNull String mainCo { writer.flush(); writer.close(); + writer = null; } catch(Exception e) {e.printStackTrace();} sender.getInventory().setItem(0, slot);