File tree Expand file tree Collapse file tree 4 files changed +28
-4
lines changed
src/main/java/io/github/mooy1/infinitylib Expand file tree Collapse file tree 4 files changed +28
-4
lines changed Original file line number Diff line number Diff line change 66 <modelVersion >4.0.0</modelVersion >
77 <groupId >io.github.mooy1</groupId >
88 <artifactId >InfinityLib</artifactId >
9- <version >1.3.9 </version >
9+ <version >1.3.10 </version >
1010
1111 <properties >
1212 <maven .compiler.source>1.8</maven .compiler.source>
Original file line number Diff line number Diff line change 1+ package io .github .mooy1 .infinitylib .common ;
2+
3+ import lombok .experimental .UtilityClass ;
4+
5+ @ UtilityClass
6+ public class StringUtils {
7+
8+ public static boolean isBlank (String string ) {
9+ // Is default blank if null or length = 0
10+ if (string == null || string .length () == 0 ) {
11+ return true ;
12+ }
13+
14+ // Otherwise loop through the chars to see if any are NOT whitespace
15+ for (char chr : string .toCharArray ()) {
16+ if (!Character .isWhitespace (chr )) {
17+ return false ;
18+ }
19+ }
20+
21+ // No non-whitespace chars, is blank
22+ return true ;
23+ }
24+ }
Original file line number Diff line number Diff line change 1313import javax .annotation .Nullable ;
1414import javax .annotation .ParametersAreNonnullByDefault ;
1515
16- import org .apache .commons .lang .StringUtils ;
16+ import io .github .mooy1 .infinitylib .common .StringUtils ;
17+
1718import org .bukkit .configuration .file .YamlConfiguration ;
1819
1920/**
Original file line number Diff line number Diff line change 33import java .util .HashMap ;
44import java .util .Map ;
55
6- import org .apache .commons .lang .ArrayUtils ;
76import org .bukkit .inventory .ItemStack ;
87
98import io .github .mooy1 .infinitylib .common .StackUtils ;
@@ -31,7 +30,7 @@ final class MachineBlockRecipe {
3130 }
3231
3332 this .strings = strings .keySet ().toArray (new String [0 ]);
34- this .amounts = ArrayUtils . toPrimitive ( strings .values ().toArray ( new Integer [ 0 ]) );
33+ this .amounts = strings .values ().stream (). mapToInt ( i -> i ). toArray ( );
3534 }
3635
3736 boolean check (Map <String , MachineInput > map ) {
You can’t perform that action at this time.
0 commit comments