Skip to content

Commit 64c78e7

Browse files
authored
Merge pull request #5 from Mooy1/chore/1.19
Removal of Commons for 1.19+
2 parents 7e03c79 + f784252 commit 64c78e7

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
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>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
}

src/main/java/io/github/mooy1/infinitylib/core/AddonConfig.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
import javax.annotation.Nullable;
1414
import javax.annotation.ParametersAreNonnullByDefault;
1515

16-
import org.apache.commons.lang.StringUtils;
16+
import io.github.mooy1.infinitylib.common.StringUtils;
17+
1718
import org.bukkit.configuration.file.YamlConfiguration;
1819

1920
/**

src/main/java/io/github/mooy1/infinitylib/machines/MachineBlockRecipe.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import java.util.HashMap;
44
import java.util.Map;
55

6-
import org.apache.commons.lang.ArrayUtils;
76
import org.bukkit.inventory.ItemStack;
87

98
import 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) {

0 commit comments

Comments
 (0)