Fix critical bugs and Caffeine ClassNotFoundException
- Disabled minimize in shadowJar (was removing Caffeine's dynamic classes) - Fixed Score.fromString() ArrayIndexOutOfBoundsException - Fixed Leaderboard DIFFICULTY sort NumberFormatException - Fixed PAPIHook parsing errors (difficulty, score_until, rank) - Fixed HoloHook parsing errors (rank, difficulty) - Added proper error handling for all Integer/Double.parseX() calls
This commit is contained in:
parent
5526910bef
commit
e5dd567ca9
5 changed files with 78 additions and 27 deletions
|
|
@ -47,7 +47,12 @@ public class HoloHook {
|
|||
String type = split[1].toLowerCase();
|
||||
String rank = split[2].replace("#", "");
|
||||
|
||||
Score score = leaderboard.getScoreAtRank(Integer.parseInt(rank));
|
||||
Score score;
|
||||
try {
|
||||
score = leaderboard.getScoreAtRank(Integer.parseInt(rank));
|
||||
} catch (NumberFormatException e) {
|
||||
return "?";
|
||||
}
|
||||
|
||||
if (score == null) {
|
||||
return "?";
|
||||
|
|
@ -69,7 +74,15 @@ public class HoloHook {
|
|||
return "?";
|
||||
}
|
||||
|
||||
double difficulty = Double.parseDouble(string);
|
||||
try {
|
||||
double difficulty = Double.parseDouble(string);
|
||||
return parseDifficultyValue(difficulty);
|
||||
} catch (NumberFormatException e) {
|
||||
return "?";
|
||||
}
|
||||
}
|
||||
|
||||
private static String parseDifficultyValue(double difficulty) {
|
||||
if (difficulty <= 0.25) {
|
||||
return "easy";
|
||||
} else if (difficulty <= 0.5) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue