mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2025-02-22 23:11:20 +01:00
Optimize Placeholder API detection
This commit is contained in:
parent
016de63f93
commit
e7e27885b3
@ -22,7 +22,13 @@ public class PlaceholderAPIHook {
|
||||
}
|
||||
|
||||
public static boolean containsPlaceholders(String text) {
|
||||
return PlaceholderAPI.containsPlaceholders(text);
|
||||
int firstIndex = text.indexOf('%');
|
||||
if (firstIndex < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int lastIndex = text.lastIndexOf('%');
|
||||
return lastIndex - firstIndex >= 2; // At least one character between the two indexes
|
||||
}
|
||||
|
||||
public static String replacePlaceholders(Player player, String text) {
|
||||
|
Loading…
Reference in New Issue
Block a user