Skip to content

Commit

Permalink
fix(serializer-gson): translatable component fallback serializes twice
Browse files Browse the repository at this point in the history
  • Loading branch information
LemonCaramel committed Mar 24, 2023
1 parent f680967 commit e8105f4
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ final class ComponentSerializerImpl extends TypeAdapter<Component> {
static final String TRANSLATE = "translate";
static final String TRANSLATE_FALLBACK = "fallback";
static final String TRANSLATE_WITH = "with";
static final String FALLBACK = "fallback";
static final String SCORE = "score";
static final String SCORE_NAME = "name";
static final String SCORE_OBJECTIVE = "objective";
Expand Down Expand Up @@ -275,10 +274,6 @@ public void write(final JsonWriter out, final Component value) throws IOExceptio
out.name(TRANSLATE_WITH);
this.gson.toJson(translatable.args(), COMPONENT_LIST_TYPE, out);
}
if (translatable.fallback() != null) {
out.name(FALLBACK);
out.value(translatable.fallback());
}
} else if (value instanceof ScoreComponent) {
final ScoreComponent score = (ScoreComponent) value;
out.name(SCORE);
Expand Down

0 comments on commit e8105f4

Please sign in to comment.