mirror of
https://github.com/Minestom/Minestom.git
synced 2024-10-02 16:38:16 +02:00
Add single Audience getter from Viewable viewers
This commit is contained in:
parent
e738efded3
commit
9490f1f9da
@ -90,7 +90,17 @@ public interface Viewable {
|
|||||||
*
|
*
|
||||||
* @return the audience
|
* @return the audience
|
||||||
*/
|
*/
|
||||||
|
default @NotNull Audience getViewersAsAudience() {
|
||||||
|
return Audience.audience(this.getViewersAsAudiences());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the result of {@link #getViewers()} as an {@link Iterable} of Adventure
|
||||||
|
* {@link Audience}s.
|
||||||
|
*
|
||||||
|
* @return the audiences
|
||||||
|
*/
|
||||||
default @NotNull Iterable<? extends Audience> getViewersAsAudiences() {
|
default @NotNull Iterable<? extends Audience> getViewersAsAudiences() {
|
||||||
return Collections.unmodifiableSet(this.getViewers());
|
return this.getViewers();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user