diff --git a/common/src/main/java/com/viaversion/viaversion/util/ComponentUtil.java b/common/src/main/java/com/viaversion/viaversion/util/ComponentUtil.java index 45778bbe3..131138c18 100644 --- a/common/src/main/java/com/viaversion/viaversion/util/ComponentUtil.java +++ b/common/src/main/java/com/viaversion/viaversion/util/ComponentUtil.java @@ -60,7 +60,9 @@ public final class ComponentUtil { final ATextComponent component = SerializerVersion.V1_20_3.toComponent(tag); return component != null ? SerializerVersion.V1_19_4.toJson(component) : null; } catch (final Exception e) { - Via.getPlatform().getLogger().log(Level.SEVERE, "Error converting tag: " + tag, e); + if (!Via.getConfig().isSuppressConversionWarnings()) { + Via.getPlatform().getLogger().log(Level.SEVERE, "Error converting tag: " + tag, e); + } return plainToJson(""); } } @@ -74,7 +76,9 @@ public final class ComponentUtil { final ATextComponent component = SerializerVersion.V1_19_4.toComponent(element); return trimStrings(SerializerVersion.V1_20_3.toTag(component)); } catch (final Exception e) { - Via.getPlatform().getLogger().log(Level.SEVERE, "Error converting component: " + element, e); + if (!Via.getConfig().isSuppressConversionWarnings()) { + Via.getPlatform().getLogger().log(Level.SEVERE, "Error converting component: " + element, e); + } return new StringTag(""); } } @@ -101,7 +105,9 @@ public final class ComponentUtil { final ATextComponent component = SerializerVersion.V1_20_5.toComponent(tag); return component != null ? SerializerVersion.V1_20_3.toString(component) : null; } catch (final Exception e) { - Via.getPlatform().getLogger().log(Level.SEVERE, "Error converting tag: " + tag, e); + if (!Via.getConfig().isSuppressConversionWarnings()) { + Via.getPlatform().getLogger().log(Level.SEVERE, "Error converting tag: " + tag, e); + } return plainToJson("").toString(); } } diff --git a/common/src/main/resources/assets/viaversion/config.yml b/common/src/main/resources/assets/viaversion/config.yml index 7476272f0..8ca67a932 100644 --- a/common/src/main/resources/assets/viaversion/config.yml +++ b/common/src/main/resources/assets/viaversion/config.yml @@ -25,7 +25,7 @@ block-disconnect-msg: "You are using an unsupported Minecraft version!" # (We don't suggest using reload either, use a plugin manager) # You can customize the message we kick people with if you use ProtocolLib here. reload-disconnect-msg: "Server reload, please rejoin!" -# We warn when there's an error converting item and block data over versions, should we suppress these? (Only suggested if spamming) +# We warn when there's an error converting item/block or component/nbt data over versions, should we suppress these? (Only suggested if spamming) suppress-conversion-warnings: false # #----------------------------------------------------------#