From ea0f91136e704b314b7263bfe61cbd214b13706e Mon Sep 17 00:00:00 2001 From: KennyTV Date: Thu, 6 Aug 2020 10:15:38 +0200 Subject: [PATCH] Accept plain strings for components Addresses #1968 --- .../myles/ViaVersion/api/rewriters/ComponentRewriter.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/api/rewriters/ComponentRewriter.java b/common/src/main/java/us/myles/ViaVersion/api/rewriters/ComponentRewriter.java index 3a8df2a5a..38b10c76e 100644 --- a/common/src/main/java/us/myles/ViaVersion/api/rewriters/ComponentRewriter.java +++ b/common/src/main/java/us/myles/ViaVersion/api/rewriters/ComponentRewriter.java @@ -106,8 +106,12 @@ public class ComponentRewriter { processText(root); return root; } catch (JsonSyntaxException e) { - Via.getPlatform().getLogger().severe("Error when trying to parse json: " + value); - throw e; + if (Via.getManager().isDebug()) { + Via.getPlatform().getLogger().severe("Error when trying to parse json: " + value); + throw e; + } + // Yay to malformed json being accepted + return new JsonPrimitive(value); } }