Package org.spongepowered.api.adventure
Class Audiences
- java.lang.Object
-
- org.spongepowered.api.adventure.Audiences
-
public final class Audiences extends java.lang.Object
Audience
s.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Audiences.Factory
-
Constructor Summary
Constructors Constructor Description Audiences()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Optional<Audience>
filtered(Audience audience, java.util.function.Predicate<Audience> predicate)
Filters an audience with given predicate.static Audience
onlinePlayers()
Gets anAudience
that targets all online players.static Audience
server()
Gets anAudience
that targets the entire server, including players and system, when available.static Audience
system()
Gets anAudience
that targets the system, such as a server console.static Audience
withPermission(java.lang.String permission)
Gets anAudience
that targets all online players with the specified permission.
-
-
-
Method Detail
-
server
public static Audience server()
Gets anAudience
that targets the entire server, including players and system, when available.- Returns:
- An audience
-
onlinePlayers
public static Audience onlinePlayers()
Gets anAudience
that targets all online players.- Returns:
- An audience
-
withPermission
public static Audience withPermission(java.lang.String permission)
Gets anAudience
that targets all online players with the specified permission.- Parameters:
permission
- The permission- Returns:
- An audience
-
filtered
public static java.util.Optional<Audience> filtered(Audience audience, java.util.function.Predicate<Audience> predicate)
Filters an audience with given predicate.For
ForwardingAudience
s the predicate is tested on eachForwardingAudience.audiences()
- Parameters:
predicate
- The predicate- Returns:
- The filtered audience.
-
-