From 576866540eaba634b10af2aef99f4b9b1af744b4 Mon Sep 17 00:00:00 2001 From: Josh Roy <10731363+JRoy@users.noreply.github.com> Date: Wed, 17 Aug 2022 02:52:38 -0400 Subject: [PATCH] Fix gson incompatibility on 1.8.8 (#5067) --- .../java/com/earth2me/essentials/utils/CommandMapUtil.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Essentials/src/main/java/com/earth2me/essentials/utils/CommandMapUtil.java b/Essentials/src/main/java/com/earth2me/essentials/utils/CommandMapUtil.java index d861ce715f4..287da28c4c6 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/utils/CommandMapUtil.java +++ b/Essentials/src/main/java/com/earth2me/essentials/utils/CommandMapUtil.java @@ -4,6 +4,7 @@ import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; import net.ess3.api.IEssentials; import org.bukkit.command.Command; import org.bukkit.command.FormattedCommandAlias; @@ -59,8 +60,8 @@ public static JsonObject toJson(IEssentials ess, Command value) { } else if (value instanceof FormattedCommandAlias) { json.addProperty("source", "commands.yml"); final JsonArray formatStrings = new JsonArray(); - for (String entry : ess.getFormattedCommandAliasProvider().getFormatStrings((FormattedCommandAlias) value)) { - formatStrings.add(entry); + for (final String entry : ess.getFormattedCommandAliasProvider().getFormatStrings((FormattedCommandAlias) value)) { + formatStrings.add(new JsonPrimitive(entry)); } json.add("bukkit_aliases", formatStrings); }