Skip to content

Commit

Permalink
Merge pull request #451 from NoahvdAa/feature/add-removal-version
Browse files Browse the repository at this point in the history
api: Add inVersion to all @ApiStatus.ScheduledForRemoval annotations
  • Loading branch information
zml2008 authored Sep 25, 2021
2 parents 71061df + 3204638 commit 2497d92
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 15 deletions.
10 changes: 5 additions & 5 deletions api/src/main/java/net/kyori/adventure/bossbar/BossBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public interface BossBar extends Examinable {
* @deprecated for removal since 4.2.0, use {@link #MIN_PROGRESS}
* @since 4.0.0
*/
@ApiStatus.ScheduledForRemoval
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
float MIN_PERCENT = MIN_PROGRESS;
/**
Expand All @@ -80,7 +80,7 @@ public interface BossBar extends Examinable {
* @deprecated for removal since 4.2.0, use {@link #MAX_PROGRESS}
* @since 4.0.0
*/
@ApiStatus.ScheduledForRemoval
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
float MAX_PERCENT = MAX_PROGRESS;

Expand Down Expand Up @@ -212,7 +212,7 @@ public interface BossBar extends Examinable {
* @deprecated for removal since 4.2.0, use {@link #progress()}
* @since 4.0.0
*/
@ApiStatus.ScheduledForRemoval
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
default float percent() {
return this.progress();
Expand All @@ -229,7 +229,7 @@ default float percent() {
* @deprecated for removal since 4.2.0, use {@link #progress(float)}
* @since 4.0.0
*/
@ApiStatus.ScheduledForRemoval
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Contract("_ -> this")
@Deprecated
default @NotNull BossBar percent(final float progress) {
Expand Down Expand Up @@ -418,7 +418,7 @@ default void bossBarProgressChanged(final @NotNull BossBar bar, final float oldP
* @deprecated for removal since 4.2.0, use {@link #bossBarProgressChanged(BossBar, float, float)}
* @since 4.0.0
*/
@ApiStatus.ScheduledForRemoval
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
@SuppressWarnings("DeprecatedIsStillUsed")
default void bossBarPercentChanged(final @NotNull BossBar bar, final float oldProgress, final float newProgress) {
Expand Down
19 changes: 11 additions & 8 deletions api/src/main/java/net/kyori/adventure/text/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ public interface Component extends ComponentBuilderApplicable, ComponentLike, Ex
* @since 4.0.0
* @deprecated for removal since 4.9.0, use {@link #join(JoinConfiguration, ComponentLike...)} with {@link JoinConfiguration#separator(ComponentLike)} instead.
*/
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
@Contract(value = "_, _ -> new", pure = true)
static @NotNull TextComponent join(final @NotNull ComponentLike separator, final @NotNull ComponentLike@NotNull... components) {
Expand All @@ -167,6 +168,7 @@ public interface Component extends ComponentBuilderApplicable, ComponentLike, Ex
* @since 4.0.0
* @deprecated for removal since 4.9.0, use {@link #join(JoinConfiguration, Iterable)} with {@link JoinConfiguration#separator(ComponentLike)} instead.
*/
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
@Contract(value = "_, _ -> new", pure = true)
static @NotNull TextComponent join(final @NotNull ComponentLike separator, final Iterable<? extends ComponentLike> components) {
Expand Down Expand Up @@ -1657,6 +1659,7 @@ default boolean contains(final @NotNull Component that, final @NotNull BiPredica
* @deprecated for removal since 4.7.0, with no replacement - this method is not necessary due to the fact {@code Component}s are immutable
* @since 4.0.0
*/
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
default void detectCycle(final @NotNull Component that) {
if (that.contains(this)) {
Expand Down Expand Up @@ -2112,7 +2115,7 @@ default boolean hasStyling() {
* @since 4.0.0
* @deprecated for removal since 4.2.0, use {@link #replaceText(Consumer)} or {@link #replaceText(TextReplacementConfig)} instead.
*/
@ApiStatus.ScheduledForRemoval
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Contract(pure = true)
@Deprecated
default @NotNull Component replaceText(final @NotNull String search, final @Nullable ComponentLike replacement) {
Expand All @@ -2128,7 +2131,7 @@ default boolean hasStyling() {
* @since 4.0.0
* @deprecated for removal since 4.2.0, use {@link #replaceText(Consumer)} or {@link #replaceText(TextReplacementConfig)} instead.
*/
@ApiStatus.ScheduledForRemoval
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Contract(pure = true)
@Deprecated
default @NotNull Component replaceText(final @NotNull Pattern pattern, final @NotNull Function<TextComponent.Builder, @Nullable ComponentLike> replacement) {
Expand All @@ -2144,7 +2147,7 @@ default boolean hasStyling() {
* @since 4.0.0
* @deprecated for removal since 4.2.0, use {@link #replaceText(Consumer)} or {@link #replaceText(TextReplacementConfig)} instead.
*/
@ApiStatus.ScheduledForRemoval
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Contract(pure = true)
@Deprecated
default @NotNull Component replaceFirstText(final @NotNull String search, final @Nullable ComponentLike replacement) {
Expand All @@ -2160,7 +2163,7 @@ default boolean hasStyling() {
* @since 4.0.0
* @deprecated for removal since 4.2.0, use {@link #replaceText(Consumer)} or {@link #replaceText(TextReplacementConfig)} instead.
*/
@ApiStatus.ScheduledForRemoval
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Contract(pure = true)
@Deprecated
default @NotNull Component replaceFirstText(final @NotNull Pattern pattern, final @NotNull Function<TextComponent.Builder, @Nullable ComponentLike> replacement) {
Expand All @@ -2177,7 +2180,7 @@ default boolean hasStyling() {
* @since 4.0.0
* @deprecated for removal since 4.2.0, use {@link #replaceText(Consumer)} or {@link #replaceText(TextReplacementConfig)} instead.
*/
@ApiStatus.ScheduledForRemoval
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Contract(pure = true)
@Deprecated
default @NotNull Component replaceText(final @NotNull String search, final @Nullable ComponentLike replacement, final int numberOfReplacements) {
Expand All @@ -2194,7 +2197,7 @@ default boolean hasStyling() {
* @since 4.0.0
* @deprecated for removal since 4.2.0, use {@link #replaceText(Consumer)} or {@link #replaceText(TextReplacementConfig)} instead.
*/
@ApiStatus.ScheduledForRemoval
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Contract(pure = true)
@Deprecated
default @NotNull Component replaceText(final @NotNull Pattern pattern, final @NotNull Function<TextComponent.Builder, @Nullable ComponentLike> replacement, final int numberOfReplacements) {
Expand All @@ -2213,7 +2216,7 @@ default boolean hasStyling() {
* @since 4.0.0
* @deprecated for removal since 4.2.0, use {@link #replaceText(Consumer)} or {@link #replaceText(TextReplacementConfig)} instead.
*/
@ApiStatus.ScheduledForRemoval
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Contract(pure = true)
@Deprecated
default @NotNull Component replaceText(final @NotNull String search, final @Nullable ComponentLike replacement, final @NotNull IntFunction2<PatternReplacementResult> fn) {
Expand All @@ -2232,7 +2235,7 @@ default boolean hasStyling() {
* @since 4.0.0
* @deprecated for removal since 4.2.0, use {@link #replaceText(Consumer)} or {@link #replaceText(TextReplacementConfig)} instead.
*/
@ApiStatus.ScheduledForRemoval
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Contract(pure = true)
@Deprecated
default @NotNull Component replaceText(final @NotNull Pattern pattern, final @NotNull Function<TextComponent.Builder, @Nullable ComponentLike> replacement, final @NotNull IntFunction2<PatternReplacementResult> fn) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public interface TextComponent extends BuildableComponent<TextComponent, TextCom
* @since 4.0.0
* @deprecated For removal since 4.9.0, use {@link Component#join(JoinConfiguration, ComponentLike...)} with {@link JoinConfiguration#noSeparators()}.
*/
@ApiStatus.ScheduledForRemoval
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
static @NotNull TextComponent ofChildren(final @NotNull ComponentLike@NotNull... components) {
final Component joined = Component.join(JoinConfiguration.noSeparators(), components);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public interface ComponentSerializer<I extends Component, O extends Component, R
* @since 4.7.0
* @deprecated for removal since 4.8.0, use {@link #deserializeOrNull(Object)} instead.
*/
@ApiStatus.ScheduledForRemoval
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Contract(value = "!null -> !null; null -> null", pure = true)
@Deprecated
default @Nullable O deseializeOrNull(final @Nullable R input) {
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/net/kyori/adventure/util/ShadyPines.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
package net.kyori.adventure.util;

import java.util.Set;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;

/**
Expand All @@ -45,6 +46,7 @@ private ShadyPines() {
* @deprecated for removal since 4.8.0, use {@link MonkeyBars#enumSet(Class, Enum[])}
* @since 4.0.0
*/
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
@SafeVarargs
@SuppressWarnings("varargs")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import net.kyori.adventure.text.flattener.ComponentFlattener;
import net.kyori.adventure.text.serializer.ComponentSerializer;
import net.kyori.adventure.util.Buildable;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand All @@ -45,6 +46,7 @@
* @deprecated for removal since 4.8.0, use {@link PlainTextComponentSerializer} instead
* @since 4.0.0
*/
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
public class PlainComponentSerializer implements ComponentSerializer<Component, TextComponent, String>, Buildable<PlainComponentSerializer, PlainComponentSerializer.Builder> {
/**
Expand All @@ -54,6 +56,7 @@ public class PlainComponentSerializer implements ComponentSerializer<Component,
* @deprecated for removal since 4.8.0, use {@link PlainTextComponentSerializer#plainText()} instead
* @since 4.0.0
*/
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
public static @NotNull PlainComponentSerializer plain() {
return PlainComponentSerializerImpl.INSTANCE;
Expand All @@ -66,6 +69,7 @@ public class PlainComponentSerializer implements ComponentSerializer<Component,
* @deprecated for removal since 4.8.0, use {@link PlainTextComponentSerializer#builder()} instead
* @since 4.7.0
*/
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
public static PlainComponentSerializer.@NotNull Builder builder() {
return new PlainComponentSerializerImpl.BuilderImpl();
Expand All @@ -79,6 +83,7 @@ public class PlainComponentSerializer implements ComponentSerializer<Component,
* @since 4.0.0
* @deprecated for removal since 4.7.0
*/
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
public PlainComponentSerializer() {
this(PlainTextComponentSerializer.plainText());
Expand All @@ -92,6 +97,7 @@ public PlainComponentSerializer() {
* @since 4.0.0
* @deprecated for removal since 4.7.0, use the builder instead
*/
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
public PlainComponentSerializer(final @Nullable Function<KeybindComponent, String> keybind, final @Nullable Function<TranslatableComponent, String> translatable) {
this(PlainComponentSerializerImpl.createRealSerializerFromLegacyFunctions(keybind, translatable));
Expand Down Expand Up @@ -120,6 +126,7 @@ public PlainComponentSerializer(final @Nullable Function<KeybindComponent, Strin
* @deprecated for removal since 4.8.0, use {@link PlainTextComponentSerializer#serialize(StringBuilder, Component)} instead
* @since 4.0.0
*/
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
public void serialize(final @NotNull StringBuilder sb, final @NotNull Component component) {
this.serializer.serialize(sb, component);
Expand All @@ -136,6 +143,7 @@ public void serialize(final @NotNull StringBuilder sb, final @NotNull Component
* @deprecated for removal since 4.8.0, use {@link PlainTextComponentSerializer.Builder} instead
* @since 4.7.0
*/
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
public interface Builder extends Buildable.Builder<PlainComponentSerializer> {
/**
Expand All @@ -148,6 +156,7 @@ public interface Builder extends Buildable.Builder<PlainComponentSerializer> {
* @deprecated for removal since 4.8.0, use {@link PlainTextComponentSerializer.Builder#flattener(ComponentFlattener)} instead
* @since 4.7.0
*/
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
@Deprecated
@NotNull Builder flattener(final @NotNull ComponentFlattener flattener);
}
Expand Down

0 comments on commit 2497d92

Please sign in to comment.