mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-23 08:31:26 +01:00
Remove WrapperAudience
This commit is contained in:
parent
7351b9fdd3
commit
82820bc40b
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user