We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d16c190 commit 06182a0Copy full SHA for 06182a0
src/main/java/me/hsgamer/bettergui/util/SlotUtil.java
@@ -1,5 +1,8 @@
1
package me.hsgamer.bettergui.util;
2
3
+import me.hsgamer.hscore.common.Validate;
4
+
5
+import java.math.BigDecimal;
6
import java.util.*;
7
import java.util.regex.Matcher;
8
import java.util.regex.Pattern;
@@ -69,10 +72,9 @@ public static Stream<Integer> generateSlots(String input) {
69
72
}
70
73
71
74
- try {
- return Stream.of(Integer.parseInt(input));
- } catch (Exception ignored) {
75
- return Stream.empty();
76
- }
+ return Validate.getNumber(input)
+ .map(BigDecimal::intValue)
77
+ .map(Stream::of)
78
+ .orElseGet(Stream::empty);
79
80
0 commit comments