Fix gson incompatibility on 1.8.8 (#5067)

This commit is contained in:
Josh Roy 2022-08-17 02:52:38 -04:00 committed by GitHub
parent dfcb9a1c52
commit 576866540e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray; import com.google.gson.JsonArray;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import net.ess3.api.IEssentials; import net.ess3.api.IEssentials;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.FormattedCommandAlias; import org.bukkit.command.FormattedCommandAlias;
@ -59,8 +60,8 @@ public final class CommandMapUtil {
} else if (value instanceof FormattedCommandAlias) { } else if (value instanceof FormattedCommandAlias) {
json.addProperty("source", "commands.yml"); json.addProperty("source", "commands.yml");
final JsonArray formatStrings = new JsonArray(); final JsonArray formatStrings = new JsonArray();
for (String entry : ess.getFormattedCommandAliasProvider().getFormatStrings((FormattedCommandAlias) value)) { for (final String entry : ess.getFormattedCommandAliasProvider().getFormatStrings((FormattedCommandAlias) value)) {
formatStrings.add(entry); formatStrings.add(new JsonPrimitive(entry));
} }
json.add("bukkit_aliases", formatStrings); json.add("bukkit_aliases", formatStrings);
} }