From 5408a17fccff0f37badae78d96ff53b8eae07f0d Mon Sep 17 00:00:00 2001 From: Francisco Solis Date: Sun, 11 Jul 2021 13:33:58 -0400 Subject: [PATCH] Translations and Improvements * Fixed some translations * Implemented PlaceholderAPI into Spigot Utils * Added VSCode to .gitignore * Added static instance accessor to the SkinTextureManager * Updated dependencies according to vulnerability report --- .gitignore | 3 +++ pom.xml | 4 ++-- .../supercoreapi/global/translations/Base.java | 4 ++-- .../supercoreapi/spigot/utils/SpigotUtils.java | 12 +++++++++++- .../spigot/utils/skintexture/SkinTextureManager.java | 2 ++ 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 2060a4bd..3b6f0c54 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,6 @@ Icon Network Trash Folder Temporary Items .apdisk +.classpath +.project +.settings/ \ No newline at end of file diff --git a/pom.xml b/pom.xml index 2066cfe4..ac468b8c 100644 --- a/pom.xml +++ b/pom.xml @@ -182,7 +182,7 @@ com.github.cryptomorin XSeries - 8.0.0 + 8.2.0 compile @@ -202,7 +202,7 @@ commons-codec commons-codec - 1.11 + 1.15 compile diff --git a/src/main/java/xyz/theprogramsrc/supercoreapi/global/translations/Base.java b/src/main/java/xyz/theprogramsrc/supercoreapi/global/translations/Base.java index 3fa10594..850bd448 100644 --- a/src/main/java/xyz/theprogramsrc/supercoreapi/global/translations/Base.java +++ b/src/main/java/xyz/theprogramsrc/supercoreapi/global/translations/Base.java @@ -89,10 +89,10 @@ public enum Base implements TranslationPack{ ITEM_PREVIOUS_DESCRIPTION("Items.Previous.Lore","&7Click to go to the previous page."), ITEM_SEARCH_NAME("Items.Search.Name","&aSearch"), - ITEM_SEARCH_DESCRIPTION("Items.Search.Name","&7Click to search between objects."), + ITEM_SEARCH_DESCRIPTION("Items.Search.Lore","&7Click to search between objects."), ITEM_END_SEARCH_NAME("Items.EndSearch.Name","&aEnd Search"), - ITEM_END_SEARCH_DESCRIPTION("Items.EndSearch.Name","&7Click to end with the search"), + ITEM_END_SEARCH_DESCRIPTION("Items.EndSearch.Lore","&7Click to end with the search"), ; private final String path; diff --git a/src/main/java/xyz/theprogramsrc/supercoreapi/spigot/utils/SpigotUtils.java b/src/main/java/xyz/theprogramsrc/supercoreapi/spigot/utils/SpigotUtils.java index b592b38a..c18bbc97 100644 --- a/src/main/java/xyz/theprogramsrc/supercoreapi/spigot/utils/SpigotUtils.java +++ b/src/main/java/xyz/theprogramsrc/supercoreapi/spigot/utils/SpigotUtils.java @@ -6,6 +6,7 @@ import org.bukkit.command.CommandMap; import org.bukkit.command.CommandSender; import org.bukkit.command.defaults.BukkitCommand; +import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; import xyz.theprogramsrc.supercoreapi.SuperUtils; @@ -91,7 +92,16 @@ public void registerBukkitCommand(BukkitCommand command) { * @param message the message */ public void sendMessage(CommandSender sender, String message){ - sender.sendMessage(color(message)); + if(sender instanceof Player){ + Player player = ((Player) sender); + if(this.isPlugin("PlaceholderAPI")){ // Here we apply the Placeholder API if is available + player.sendMessage(color(me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(player, message))); + }else{ + player.sendMessage(color(message)); + } + }else{ + sender.sendMessage(color(message)); + } } /** diff --git a/src/main/java/xyz/theprogramsrc/supercoreapi/spigot/utils/skintexture/SkinTextureManager.java b/src/main/java/xyz/theprogramsrc/supercoreapi/spigot/utils/skintexture/SkinTextureManager.java index 31e00290..bb75c753 100644 --- a/src/main/java/xyz/theprogramsrc/supercoreapi/spigot/utils/skintexture/SkinTextureManager.java +++ b/src/main/java/xyz/theprogramsrc/supercoreapi/spigot/utils/skintexture/SkinTextureManager.java @@ -13,11 +13,13 @@ public class SkinTextureManager { private final HashMap cache; private final HashMap urls; private final HashMap db; + public static SkinTextureManager INSTANCE; public SkinTextureManager(){ this.cache = new HashMap<>(); this.urls = new HashMap<>(); this.db = new HashMap<>(); + INSTANCE = this; } /**