Skip to content

Commit

Permalink
fix: remove incorrect overrides for replaceText
Browse files Browse the repository at this point in the history
  • Loading branch information
zml2008 committed Feb 12, 2025
1 parent 0da7909 commit 998c50e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 2 additions & 0 deletions api/src/main/java/net/kyori/adventure/text/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -2532,6 +2532,7 @@ default boolean hasStyling() {
* @since 4.2.0
*/
@Contract(pure = true)
@ScopedComponentOverrideNotRequired
default @NotNull Component replaceText(final @NotNull Consumer<TextReplacementConfig.Builder> configurer) {
requireNonNull(configurer, "configurer");
return this.replaceText(AbstractBuilder.configureAndBuild(TextReplacementConfig.builder(), configurer));
Expand All @@ -2545,6 +2546,7 @@ default boolean hasStyling() {
* @since 4.2.0
*/
@Contract(pure = true)
@ScopedComponentOverrideNotRequired
default @NotNull Component replaceText(final @NotNull TextReplacementConfig config) {
requireNonNull(config, "replacement");
if (!(config instanceof TextReplacementConfigImpl)) {
Expand Down
12 changes: 0 additions & 12 deletions api/src/main/java/net/kyori/adventure/text/ScopedComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,18 +207,6 @@ public interface ScopedComponent<C extends Component> extends Component {
return (C) Component.super.insertion(insertion);
}

@Override
@SuppressWarnings("unchecked")
default @NotNull C replaceText(final @NotNull Consumer<TextReplacementConfig.Builder> configurer) {
return (C) Component.super.replaceText(configurer);
}

@Override
@SuppressWarnings("unchecked")
default @NotNull C replaceText(final @NotNull TextReplacementConfig config) {
return (C) Component.super.replaceText(config);
}

@Override
@SuppressWarnings("unchecked")
default @NotNull C font(final @Nullable Key key) {
Expand Down

0 comments on commit 998c50e

Please sign in to comment.