Skip to content

Commit f9f604b

Browse files
committed
isValueValid
1 parent 45d00b0 commit f9f604b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/java/meteordevelopment/meteorclient/settings/AbstractRegistryItemSetting.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected final V parseImpl(String str) {
3131

3232
@Override
3333
protected final boolean isValueValid(V value) {
34-
return filter.test(value);
34+
return value != null && filter.test(value);
3535
}
3636

3737
@Override
@@ -50,9 +50,7 @@ protected final NbtCompound save(NbtCompound tag) {
5050
protected final V load(NbtCompound tag) {
5151
V value = registry.get(Identifier.of(tag.getString("value", "")));
5252

53-
if (value == null) {
54-
resetImpl();
55-
} else if (!filter.test(value)) {
53+
if (!isValueValid(value)) {
5654
resetImpl();
5755
} else {
5856
this.value = value;

0 commit comments

Comments
 (0)