Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-03 14:50:30 +01:00
Don't use not yet loaded platform logger in config
Dieser Commit ist enthalten in:
Ursprung
cbf8b8f401
Commit
095fe16447
@ -34,12 +34,14 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentSkipListMap;
|
import java.util.concurrent.ConcurrentSkipListMap;
|
||||||
|
import java.util.logging.Logger;
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
import org.yaml.snakeyaml.DumperOptions;
|
import org.yaml.snakeyaml.DumperOptions;
|
||||||
import org.yaml.snakeyaml.Yaml;
|
import org.yaml.snakeyaml.Yaml;
|
||||||
|
|
||||||
@SuppressWarnings("VulnerableCodeUsages")
|
@SuppressWarnings("VulnerableCodeUsages")
|
||||||
public abstract class Config {
|
public abstract class Config {
|
||||||
|
private static final Logger LOGGER = Logger.getLogger("ViaVersion Config");
|
||||||
private static final YamlCompat YAMP_COMPAT = YamlCompat.isVersion1() ? new Yaml1Compat() : new Yaml2Compat();
|
private static final YamlCompat YAMP_COMPAT = YamlCompat.isVersion1() ? new Yaml1Compat() : new Yaml2Compat();
|
||||||
private static final ThreadLocal<Yaml> YAML = ThreadLocal.withInitial(() -> {
|
private static final ThreadLocal<Yaml> YAML = ThreadLocal.withInitial(() -> {
|
||||||
DumperOptions options = new DumperOptions();
|
DumperOptions options = new DumperOptions();
|
||||||
@ -226,7 +228,7 @@ public abstract class Config {
|
|||||||
if (type.isInstance(o1)) {
|
if (type.isInstance(o1)) {
|
||||||
filteredValues.add(type.cast(o1));
|
filteredValues.add(type.cast(o1));
|
||||||
} else if (invalidValueMessage != null) {
|
} else if (invalidValueMessage != null) {
|
||||||
Via.getPlatform().getLogger().warning(String.format(invalidValueMessage, o1));
|
LOGGER.warning(String.format(invalidValueMessage, o1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return filteredValues;
|
return filteredValues;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren