Package org.spongepowered.api.adventure
Class Audiences
- java.lang.Object
-
- org.spongepowered.api.adventure.Audiences
-
-
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 Optional<Audience>
filtered(Audience audience, 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(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(String permission)
Gets anAudience
that targets all online players with the specified permission.- Parameters:
permission
- The permission- Returns:
- An audience
-
filtered
public static Optional<Audience> filtered(Audience audience, 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.
-
-