mirror of
https://github.com/GeyserMC/Geyser.git
synced 2025-12-19 14:59:27 +00:00
Introduce nesting limit for component flattening
This commit is contained in:
@@ -27,7 +27,6 @@ package org.geysermc.geyser.translator.text;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.JoinConfiguration;
|
||||
import net.kyori.adventure.text.ScoreComponent;
|
||||
import net.kyori.adventure.text.TranslatableComponent;
|
||||
import net.kyori.adventure.text.flattener.ComponentFlattener;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
@@ -110,10 +109,9 @@ public class MessageTranslator {
|
||||
formats.add(CharacterAndFormat.characterAndFormat('t', TextColor.color(33, 73, 123))); // Lapis
|
||||
formats.add(CharacterAndFormat.characterAndFormat('u', TextColor.color(154, 92, 198))); // Amethyst
|
||||
|
||||
// Can be removed once Adventure 1.15.0 is released (see https://github.com/KyoriPowered/adventure/pull/954)
|
||||
ComponentFlattener flattener = ComponentFlattener.basic().toBuilder()
|
||||
.mapper(ScoreComponent.class, component -> "")
|
||||
.build();
|
||||
.nestingLimit(30)
|
||||
.build();
|
||||
|
||||
BEDROCK_SERIALIZER = LegacyComponentSerializer.legacySection().toBuilder()
|
||||
.formats(formats)
|
||||
|
||||
Reference in New Issue
Block a user