3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-10-03 08:41:05 +02:00

Add system property to print components before conversion

Dieser Commit ist enthalten in:
Nassim Jahnke 2023-12-11 12:47:00 +01:00
Ursprung 4aefc23bb8
Commit 70645ec5ee
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F

Datei anzeigen

@ -50,6 +50,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
public final class ComponentConverter {
private static final boolean DEBUG = Boolean.getBoolean("viaversion.debug.components");
private static final Set<String> BOOLEAN_TYPES = new HashSet<>(Arrays.asList(
"interpret",
"bold",
@ -69,6 +70,10 @@ public final class ComponentConverter {
);
public static @Nullable JsonElement tagComponentToJson(@Nullable final Tag tag) {
if (DEBUG) {
Via.getPlatform().getLogger().info("Converting tag to json: " + tag);
}
try {
return convertToJson(null, tag);
} catch (final Exception e) {
@ -78,6 +83,10 @@ public final class ComponentConverter {
}
public static @Nullable Tag jsonComponentToTag(@Nullable final JsonElement component) {
if (DEBUG) {
Via.getPlatform().getLogger().info("Converting json to tag: " + component);
}
try {
return convertToTag(component);
} catch (final Exception e) {