mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-03 21:37:28 +01:00
Use JsonSerializationContext#serialize instead of recursion for AdventureComponents - fixes #5580 and #5371
This commit is contained in:
parent
57b254d94f
commit
e57a4cbe72
1 changed files with 8 additions and 0 deletions
|
@ -1038,6 +1038,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
gsonbuilder.registerTypeHierarchyAdapter(IChatBaseComponent.class, new IChatBaseComponent.ChatSerializer());
|
||||
gsonbuilder.registerTypeHierarchyAdapter(ChatModifier.class, new ChatModifier.ChatModifierSerializer());
|
||||
gsonbuilder.registerTypeAdapterFactory(new ChatTypeAdapterFactory());
|
||||
@@ -0,0 +0,0 @@ public interface IChatBaseComponent extends Message, IChatFormatted, Iterable<IC
|
||||
}
|
||||
|
||||
public JsonElement serialize(IChatBaseComponent ichatbasecomponent, Type type, JsonSerializationContext jsonserializationcontext) {
|
||||
+ if (ichatbasecomponent instanceof AdventureComponent) return jsonserializationcontext.serialize(ichatbasecomponent); // Paper
|
||||
JsonObject jsonobject = new JsonObject();
|
||||
|
||||
if (!ichatbasecomponent.getChatModifier().g()) {
|
||||
@@ -0,0 +0,0 @@ public interface IChatBaseComponent extends Message, IChatFormatted, Iterable<IC
|
||||
return jsonobject;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue