Remove WrapperAudience

This commit is contained in:
Kieran Wallbanks 2021-03-03 17:36:52 +00:00
parent 7351b9fdd3
commit 82820bc40b
2 changed files with 1 additions and 30 deletions

View File

@ -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());
}
}

View File

@ -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<? extends Audience> audiences;
/**
* Creates a new wrapper audience.
*
* @param audiences the audiences to wrap
*/
public WrapperAudience(@NotNull Iterable<? extends Audience> audiences) {
this.audiences = audiences;
}
@Override
public @NotNull Iterable<? extends Audience> audiences() {
return this.audiences;
}
}