Skip to content

Commit

Permalink
[Code style] Remove unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
NEZNAMY committed Dec 13, 2024
1 parent 9fe1560 commit 1c4f404
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ public String toLegacyText() {
return text;
}

@Override
@NotNull
public String toFlatText() {
return text;
}

@Override
@NotNull
public String toRawText() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ public class StructuredComponent extends TabComponent {
@Nullable
private List<StructuredComponent> extra;

/** Component turned into flat text. RGB colors are represented as #RRGGBB. */
@Nullable
private String flatText;

/**
* Constructs a new component which is a clone of provided component
*
Expand Down Expand Up @@ -78,29 +74,6 @@ public String toLegacyText() {
return builder.toString();
}

@Override
@NotNull
public String toFlatText() {
if (flatText == null) {
StringBuilder builder = new StringBuilder();
TextColor color = modifier.getColor();
if (color != null) {
if (color.isLegacy()) {
builder.append(color.getLegacyColor());
} else {
builder.append("#").append(color.getHexCode());
}
}
builder.append(modifier.getMagicCodes());
builder.append(text);
for (StructuredComponent child : getExtra()) {
builder.append(child.toFlatText());
}
flatText = builder.toString();
}
return flatText;
}

@Override
@NotNull
public String toRawText() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,6 @@ public TextColor getLastColor() {
@NotNull
public abstract String toLegacyText();

/**
* Converts this component into a string. RGB colors are represented as #RRGGBB.
*
* @return String version of this component
*/
@NotNull
public abstract String toFlatText();

/**
* Converts this component into a string that only consists of text without any formatting.
*
Expand Down

0 comments on commit 1c4f404

Please sign in to comment.