Skip to content

Commit

Permalink
Prevent adding placeholders that are super long (links to the shortcu…
Browse files Browse the repository at this point in the history
…t expansion as a solution)
  • Loading branch information
ajgeiss0702 committed Oct 25, 2023
1 parent 336348f commit 90e84f6
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ public void execute(CommandSender sender, String[] args, String label) {
sender.sendMessage(message("&cYou cannot create a leaderboard out of an ajLeaderboards placeholder!\n&7See how to set up the plugin &r<underlined><click:open_url:https://wiki.ajg0702.us/ajleaderboards/setup/setup>here</click></underlined>"));
return;
}
if(placeholder.length() > 200) {
sender.sendMessage(message(
"&cThat board name is too long! &7Please use a shorter placeholder.\n" +
"&aI recommend using the " +
"<aqua>" +
"<underlined>" +
"<hover:show_text:'https://github.com/Andre601/Shortcut-Expansion'>" +
"<click:open_url:https://github.com/Andre601/Shortcut-Expansion>" +
"Shortcut expansion" +
"</click>" +
"</hover>" +
"</underlined> &ato make the placeholder shorter\n"
));
return;
}
if(!plugin.validatePlaceholder(placeholder, sender)) {
String lowerPlaceholder = placeholder.toLowerCase(Locale.ROOT);
sender.sendMessage(message("&cThe placeholder '"+placeholder+"' does not give a numerical value. Make sure that the placeholder returns a number that is not formatted."));
Expand Down

0 comments on commit 90e84f6

Please sign in to comment.