Skip to content

Commit 60afe7c

Browse files
committed
Use toString() instead of name() as recommended by the Enum code
1 parent 62f43d7 commit 60afe7c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/btw/lowercase/optiboxes/utils/components/Blend.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@ public Consumer<Float> getBlendFunc() {
6666
}
6767

6868
public static Blend byName(String name) {
69-
return Arrays.stream(Blend.values()).filter(blend -> blend.name().toLowerCase().equals(name)).findFirst().orElse(ADD);
69+
return Arrays.stream(Blend.values()).filter(blend -> blend.toString().toLowerCase().equals(name)).findFirst().orElse(ADD);
7070
}
7171
}

src/main/java/btw/lowercase/optiboxes/utils/components/Weather.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ public enum Weather {
1414
public static final Codec<Weather> CODEC = Codec.STRING.xmap(Weather::byName, Weather::toString);
1515

1616
public static Weather byName(String name) {
17-
return Arrays.stream(Weather.values()).filter(weather -> weather.name().toLowerCase().equals(name)).findFirst().orElse(null);
17+
return Arrays.stream(Weather.values()).filter(weather -> weather.toString().toLowerCase().equals(name)).findFirst().orElse(null);
1818
}
1919
}

0 commit comments

Comments
 (0)