Skip to content

Commit

Permalink
api: Remove deprecated methods (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
kashike committed Oct 14, 2020
1 parent 72c8687 commit b12e4a4
Show file tree
Hide file tree
Showing 19 changed files with 0 additions and 1,772 deletions.
31 changes: 0 additions & 31 deletions api/src/main/java/net/kyori/adventure/audience/Audience.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,37 +133,6 @@ public interface Audience {
return Audiences.COLLECTOR;
}

/**
* Creates an audience that forwards to many other audiences.
*
* @param audiences an array of audiences, can be empty
* @return an audience
* @see ForwardingAudience
* @since 4.0.0
* @deprecated use {@link #audience(Audience...)}
*/
@Deprecated
static @NonNull Audience of(final @NonNull Audience@NonNull... audiences) {
return audience(audiences);
}

/**
* Creates an audience that forwards to many other audiences.
*
* <p>The underlying <code>Iterable</code> is not copied, therefore any changes
* made will be reflected in <code>Audience</code>.</p>
*
* @param audiences an iterable of audiences, can be empty
* @return an audience
* @see ForwardingAudience
* @since 4.0.0
* @deprecated use {@link #audience(Iterable)}
*/
@Deprecated
static @NonNull ForwardingAudience of(final @NonNull Iterable<? extends Audience> audiences) {
return audience(audiences);
}

/**
* Sends a chat message.
*
Expand Down
35 changes: 0 additions & 35 deletions api/src/main/java/net/kyori/adventure/bossbar/BossBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,41 +81,6 @@ public interface BossBar extends Examinable {
return new BossBarImpl(name, percent, color, overlay, flags);
}

/**
* Creates a new bossbar.
*
* @param name the name
* @param percent the percent, between 0 and 1
* @param color the color
* @param overlay the overlay
* @return a bossbar
* @throws IllegalArgumentException if percent is less than 0 or greater than 1
* @since 4.0.0
* @deprecated use {@link #bossBar(Component, float, Color, Overlay)}
*/
@Deprecated
static @NonNull BossBar of(final @NonNull Component name, final float percent, final @NonNull Color color, final @NonNull Overlay overlay) {
return bossBar(name, percent, color, overlay);
}

/**
* Creates a new bossbar.
*
* @param name the name
* @param percent the percent, between 0 and 1
* @param color the color
* @param overlay the overlay
* @param flags the flags
* @return a bossbar
* @throws IllegalArgumentException if percent is less than 0 or greater than 1
* @since 4.0.0
* @deprecated use {@link #bossBar(Component, float, Color, Overlay, Set)}
*/
@Deprecated
static @NonNull BossBar of(final @NonNull Component name, final float percent, final @NonNull Color color, final @NonNull Overlay overlay, final @NonNull Set<Flag> flags) {
return bossBar(name, percent, color, overlay, flags);
}

/**
* Gets the name.
*
Expand Down
30 changes: 0 additions & 30 deletions api/src/main/java/net/kyori/adventure/inventory/Book.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,36 +64,6 @@ public interface Book extends Buildable<Book, Book.Builder>, Examinable {
return book(title, author, Arrays.asList(pages));
}

/**
* Creates a book.
*
* @param title the title
* @param author the author
* @param pages the collection of pages
* @return a book
* @since 4.0.0
* @deprecated use {@link #book(Component, Component, Collection)}
*/
@Deprecated
static @NonNull Book of(final @NonNull Component title, final @NonNull Component author, final @NonNull Collection<Component> pages) {
return book(title, author, pages);
}

/**
* Creates a book.
*
* @param title the title
* @param author the author
* @param pages an array of pages
* @return a book
* @since 4.0.0
* @deprecated use {@link #book(Component, Component, Component...)}
*/
@Deprecated
static @NonNull Book of(final @NonNull Component title, final @NonNull Component author, final @NonNull Component@NonNull... pages) {
return book(title, author, pages);
}

/**
* Create a new builder that will create a {@link Book}.
*
Expand Down
44 changes: 0 additions & 44 deletions api/src/main/java/net/kyori/adventure/key/Key.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,50 +82,6 @@ public interface Key extends Comparable<Key>, Examinable {
return new KeyImpl(namespace, value);
}

/**
* Creates a key.
*
* @param string the string
* @return the key
* @throws InvalidKeyException if the namespace or value contains an invalid character
* @since 4.0.0
* @deprecated use {@link #key(String)}
*/
@Deprecated
static @NonNull Key of(final @NonNull String string) {
return key(string);
}

/**
* Creates a key.
*
* @param string the string
* @param character the character
* @return the key
* @throws InvalidKeyException if the namespace or value contains an invalid character
* @since 4.0.0
* @deprecated use {@link #key(String, char)}
*/
@Deprecated
static @NonNull Key of(final @NonNull String string, final char character) {
return key(string, character);
}

/**
* Creates a key.
*
* @param namespace the namespace
* @param value the value
* @return the key
* @throws InvalidKeyException if the namespace or value contains an invalid character
* @since 4.0.0
* @deprecated use {@link #key(String, String)}
*/
@Deprecated
static @NonNull Key of(final @NonNull String namespace, final @NonNull String value) {
return key(namespace, value);
}

/**
* Gets the namespace.
*
Expand Down
48 changes: 0 additions & 48 deletions api/src/main/java/net/kyori/adventure/sound/Sound.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,54 +94,6 @@ public interface Sound extends Examinable {
};
}

/**
* Creates a new sound.
*
* @param name the name
* @param source the source
* @param volume the volume
* @param pitch the pitch
* @return the sound
* @since 4.0.0
* @deprecated use {@link #sound(Key, Source, float, float)}
*/
@Deprecated
static @NonNull Sound of(final @NonNull Key name, final @NonNull Source source, final float volume, final float pitch) {
return sound(name, source, volume, pitch);
}

/**
* Creates a new sound.
*
* @param type the type
* @param source the source
* @param volume the volume
* @param pitch the pitch
* @return the sound
* @since 4.0.0
* @deprecated use {@link #sound(Type, Source, float, float)}
*/
@Deprecated
static @NonNull Sound of(final @NonNull Type type, final @NonNull Source source, final float volume, final float pitch) {
return sound(type, source, volume, pitch);
}

/**
* Creates a new sound.
*
* @param type the type
* @param source the source
* @param volume the volume
* @param pitch the pitch
* @return the sound
* @since 4.0.0
* @deprecated use {@link #sound(Supplier, Source, float, float)}
*/
@Deprecated
static @NonNull Sound of(final @NonNull Supplier<? extends Type> type, final @NonNull Source source, final float volume, final float pitch) {
return sound(type, source, volume, pitch);
}

/**
* Gets the name.
*
Expand Down
40 changes: 0 additions & 40 deletions api/src/main/java/net/kyori/adventure/text/BlockNBTComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/
package net.kyori.adventure.text;

import java.util.function.Consumer;
import java.util.regex.Matcher;
import net.kyori.examination.Examinable;
import org.checkerframework.checker.nullness.qual.NonNull;
Expand All @@ -34,45 +33,6 @@
* @since 4.0.0
*/
public interface BlockNBTComponent extends NBTComponent<BlockNBTComponent, BlockNBTComponent.Builder>, ScopedComponent<BlockNBTComponent> {
/**
* Creates a block NBT component builder.
*
* @return a builder
* @since 4.0.0
* @deprecated use {@link Component#blockNBT()}
*/
@Deprecated
static @NonNull Builder builder() {
return Component.blockNBT();
}

/**
* Creates a block NBT component with a position.
*
* @param nbtPath the nbt path
* @param pos the block position
* @return a block NBT component
* @since 4.0.0
* @deprecated use {@link Component#blockNBT(String, BlockNBTComponent.Pos)}
*/
@Deprecated
static @NonNull BlockNBTComponent of(final @NonNull String nbtPath, final @NonNull Pos pos) {
return Component.blockNBT(nbtPath, pos);
}

/**
* Creates a block NBT component by applying configuration from {@code consumer}.
*
* @param consumer the builder configurator
* @return a block NBT component
* @since 4.0.0
* @deprecated use {@link Component#blockNBT(Consumer)}
*/
@Deprecated
static @NonNull BlockNBTComponent make(final @NonNull Consumer<? super Builder> consumer) {
return Component.blockNBT(consumer);
}

/**
* Gets the block position.
*
Expand Down
59 changes: 0 additions & 59 deletions api/src/main/java/net/kyori/adventure/text/ComponentBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,65 +44,6 @@
* @since 4.0.0
*/
public interface ComponentBuilder<C extends BuildableComponent<C, B>, B extends ComponentBuilder<C, B>> extends Buildable.Builder<C>, ComponentBuilderApplicable, ComponentLike {
/**
* Appends a text component to this component.
*
* @param content the content
* @return this builder
* @since 4.0.0
* @deprecated no replacement
*/
@Deprecated
default @NonNull B append(final @NonNull String content) {
return this.append(Component.text(content));
}

/**
* Appends a text component to this component.
*
* @param content the content
* @param color the color
* @return this builder
* @since 4.0.0
* @deprecated no replacement
*/
@Deprecated
default @NonNull B append(final @NonNull String content, final @NonNull TextColor color) {
return this.append(Component.text(content, color));
}

/**
* Appends a text component to this component.
*
* @param content the content
* @param color the color
* @param decorations the decorations
* @return this builder
* @since 4.0.0
* @deprecated no replacement
*/
@Deprecated
default @NonNull B append(final @NonNull String content, final @NonNull TextColor color, final TextDecoration@NonNull... decorations) {
return this.append(Component.text(content, color, decorations));
}

/**
* Appends a text component to this component.
*
* @param content the content
* @param builder the builder
* @return this builder
* @since 4.0.0
* @deprecated no replacement
*/
@Deprecated
default @NonNull B append(final @NonNull String content, final @NonNull Consumer<? super TextComponent.Builder> builder) {
return this.append(Component.text(text -> {
text.content(content);
builder.accept(text);
}));
}

/**
* Appends a component to this component.
*
Expand Down
40 changes: 0 additions & 40 deletions api/src/main/java/net/kyori/adventure/text/EntityNBTComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/
package net.kyori.adventure.text;

import java.util.function.Consumer;
import org.checkerframework.checker.nullness.qual.NonNull;

/**
Expand All @@ -32,45 +31,6 @@
* @since 4.0.0
*/
public interface EntityNBTComponent extends NBTComponent<EntityNBTComponent, EntityNBTComponent.Builder>, ScopedComponent<EntityNBTComponent> {
/**
* Creates an entity NBT component builder.
*
* @return a builder
* @since 4.0.0
* @deprecated use {@link Component#entityNBT()}
*/
@Deprecated
static @NonNull Builder builder() {
return Component.entityNBT();
}

/**
* Creates a entity NBT component with a position.
*
* @param nbtPath the nbt path
* @param selector the selector
* @return an entity NBT component
* @since 4.0.0
* @deprecated use {@link Component#entityNBT(String, String)}
*/
@Deprecated
static @NonNull EntityNBTComponent of(final @NonNull String nbtPath, final @NonNull String selector) {
return Component.entityNBT(nbtPath, selector);
}

/**
* Creates a entity NBT component by applying configuration from {@code consumer}.
*
* @param consumer the builder configurator
* @return an entity NBT component
* @since 4.0.0
* @deprecated use {@link Component#entityNBT(Consumer)}
*/
@Deprecated
static @NonNull EntityNBTComponent make(final @NonNull Consumer<? super Builder> consumer) {
return Component.entityNBT(consumer);
}

/**
* Gets the entity selector.
*
Expand Down
Loading

0 comments on commit b12e4a4

Please sign in to comment.