Skip to content

Commit 2e5fced

Browse files
author
Francisco Solis
authored
Translations and Improvements (#11)
* 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
1 parent cb60395 commit 2e5fced

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,6 @@ Icon
6666
Network Trash Folder
6767
Temporary Items
6868
.apdisk
69+
.classpath
70+
.project
71+
.settings/

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
<dependency>
183183
<groupId>com.github.cryptomorin</groupId>
184184
<artifactId>XSeries</artifactId>
185-
<version>8.0.0</version>
185+
<version>8.2.0</version>
186186
<scope>compile</scope>
187187
</dependency>
188188
<!-- SLF4J -->
@@ -202,7 +202,7 @@
202202
<dependency>
203203
<groupId>commons-codec</groupId>
204204
<artifactId>commons-codec</artifactId>
205-
<version>1.11</version>
205+
<version>1.15</version>
206206
<scope>compile</scope>
207207
</dependency>
208208
<dependency>

src/main/java/xyz/theprogramsrc/supercoreapi/global/translations/Base.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ public enum Base implements TranslationPack{
8989
ITEM_PREVIOUS_DESCRIPTION("Items.Previous.Lore","&7Click to go to the previous page."),
9090

9191
ITEM_SEARCH_NAME("Items.Search.Name","&aSearch"),
92-
ITEM_SEARCH_DESCRIPTION("Items.Search.Name","&7Click to search between objects."),
92+
ITEM_SEARCH_DESCRIPTION("Items.Search.Lore","&7Click to search between objects."),
9393

9494
ITEM_END_SEARCH_NAME("Items.EndSearch.Name","&aEnd Search"),
95-
ITEM_END_SEARCH_DESCRIPTION("Items.EndSearch.Name","&7Click to end with the search"),
95+
ITEM_END_SEARCH_DESCRIPTION("Items.EndSearch.Lore","&7Click to end with the search"),
9696
;
9797

9898
private final String path;

src/main/java/xyz/theprogramsrc/supercoreapi/spigot/utils/SpigotUtils.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.bukkit.command.CommandMap;
77
import org.bukkit.command.CommandSender;
88
import org.bukkit.command.defaults.BukkitCommand;
9+
import org.bukkit.entity.Player;
910
import org.bukkit.plugin.Plugin;
1011
import xyz.theprogramsrc.supercoreapi.SuperUtils;
1112

@@ -91,7 +92,16 @@ public void registerBukkitCommand(BukkitCommand command) {
9192
* @param message the message
9293
*/
9394
public void sendMessage(CommandSender sender, String message){
94-
sender.sendMessage(color(message));
95+
if(sender instanceof Player){
96+
Player player = ((Player) sender);
97+
if(this.isPlugin("PlaceholderAPI")){ // Here we apply the Placeholder API if is available
98+
player.sendMessage(color(me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(player, message)));
99+
}else{
100+
player.sendMessage(color(message));
101+
}
102+
}else{
103+
sender.sendMessage(color(message));
104+
}
95105
}
96106

97107
/**

src/main/java/xyz/theprogramsrc/supercoreapi/spigot/utils/skintexture/SkinTextureManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ public class SkinTextureManager {
1313
private final HashMap<String, SkinTexture> cache;
1414
private final HashMap<String, SkinTexture> urls;
1515
private final HashMap<String, SkinTexture> db;
16+
public static SkinTextureManager INSTANCE;
1617

1718
public SkinTextureManager(){
1819
this.cache = new HashMap<>();
1920
this.urls = new HashMap<>();
2021
this.db = new HashMap<>();
22+
INSTANCE = this;
2123
}
2224

2325
/**

0 commit comments

Comments
 (0)