Interface RangeFilter
public interface RangeFilter
Turns a
Range into a test for whether one player should receive a message,
by distance, by world, by server or across the whole proxy.-
Method Summary
Modifier and TypeMethodDescriptionbooleancheckDistance(@NonNull FPlayer fPlayer, @NonNull FPlayer fReceiver, int range) Whether two players are in the same world and within the given radius.booleancheckWorldNamePermission(@NonNull FPlayer fPlayer, @NonNull FPlayer fReceiver) Whether the receiver may read messages from the sender's world, by world name.booleancheckWorldTypePermission(@NonNull FPlayer fPlayer, @NonNull FPlayer fReceiver) Whether the receiver may read messages from the sender's world, by world type.createFilter(@NonNull FEntity filterPlayer, @NonNull Range range) Builds the receiver test for an explicit sender and range.createFilter(@NonNull EventMetadata eventMetadata, @NonNull MessageContext messageContext) Builds the receiver test for a message from its metadata.
-
Method Details
-
createFilter
@NonNull Predicate<FPlayer> createFilter(@NonNull EventMetadata eventMetadata, @NonNull MessageContext messageContext) Builds the receiver test for a message from its metadata.- Parameters:
eventMetadata- supplies the range and the extra filtermessageContext- supplies the sender the range is measured from- Returns:
- the test a player must pass to receive the message
-
createFilter
-
checkDistance
Whether two players are in the same world and within the given radius.- Parameters:
fPlayer- the senderfReceiver- the candidate receiverrange- the radius in blocks- Returns:
- true if the receiver is close enough
-
checkWorldNamePermission
-
checkWorldTypePermission
-