From 82820bc40b415034b90f54448a9ed54e624edd9c Mon Sep 17 00:00:00 2001 From: Kieran Wallbanks Date: Wed, 3 Mar 2021 17:36:52 +0000 Subject: [PATCH] Remove WrapperAudience --- .../java/net/minestom/server/Viewable.java | 4 +-- .../server/adventure/WrapperAudience.java | 27 ------------------- 2 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 src/main/java/net/minestom/server/adventure/WrapperAudience.java diff --git a/src/main/java/net/minestom/server/Viewable.java b/src/main/java/net/minestom/server/Viewable.java index 861930804..d7c3de2dd 100644 --- a/src/main/java/net/minestom/server/Viewable.java +++ b/src/main/java/net/minestom/server/Viewable.java @@ -1,8 +1,6 @@ package net.minestom.server; import net.kyori.adventure.audience.Audience; -import net.kyori.adventure.audience.ForwardingAudience; -import net.minestom.server.adventure.WrapperAudience; import net.minestom.server.entity.Player; import net.minestom.server.network.packet.server.ServerPacket; import net.minestom.server.utils.PacketUtils; @@ -92,6 +90,6 @@ public interface Viewable { * @return the audience */ default @NotNull Audience asAudience() { - return new WrapperAudience(this.getViewers()); + return Audience.audience(this.getViewers()); } } diff --git a/src/main/java/net/minestom/server/adventure/WrapperAudience.java b/src/main/java/net/minestom/server/adventure/WrapperAudience.java deleted file mode 100644 index c0ca3c400..000000000 --- a/src/main/java/net/minestom/server/adventure/WrapperAudience.java +++ /dev/null @@ -1,27 +0,0 @@ -package net.minestom.server.adventure; - -import net.kyori.adventure.audience.Audience; -import net.kyori.adventure.audience.ForwardingAudience; -import org.jetbrains.annotations.NotNull; - -/** - * Implementation of {@link ForwardingAudience} that acts as a wrapper around another - * iterable collection of audiences. - */ -public class WrapperAudience implements ForwardingAudience { - private final Iterable audiences; - - /** - * Creates a new wrapper audience. - * - * @param audiences the audiences to wrap - */ - public WrapperAudience(@NotNull Iterable audiences) { - this.audiences = audiences; - } - - @Override - public @NotNull Iterable audiences() { - return this.audiences; - } -}