Refactored Generation and class structure
This commit is contained in:
@@ -7,6 +7,7 @@ import net.kyori.adventure.text.ComponentBuilder;
|
||||
import net.kyori.adventure.text.ComponentLike;
|
||||
import net.kyori.adventure.text.TextComponent;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
import net.minestom.server.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -94,8 +95,8 @@ public abstract class TranslatableMessage implements Sendable {
|
||||
public Component build(Player p) {
|
||||
ComponentBuilder<TextComponent, TextComponent.Builder> out = Component.text();
|
||||
chain.forEach(componentLike -> {
|
||||
if(componentLike == null) componentLike = Component.text("NULL", NamedTextColor.RED, TextDecoration.ITALIC);
|
||||
if(componentLike instanceof Translatable t) t.assemble(p);
|
||||
|
||||
out.append(componentLike);
|
||||
});
|
||||
return out.build();
|
||||
|
||||
Reference in New Issue
Block a user