Add radius/same-world/same-server to channel options

This commit is contained in:
Draycia committed 2022-06-08 15:17:20 -07:00
1 parent ddb6998bc8
commit 60285830d4
11 files changed
+259

No files matched your search

@@ -121,6 +121,16 @@ public interface ChatChannel extends Keyed, ChatComponentRenderer {
*/
@MonotonicNonNull String permission();
/**
* The distance from the sender players must be to receive chat messages.<br>
* Return of '0' means players must be in the same world/server.<br>
* Return of '-1' means there is no radius.
*
* @return the channel radius
* @since 2.0.8
*/
double radius();
/**
* Represents the result of a channel permission check.
*
@@ -57,6 +57,24 @@ public interface CarbonPlayer extends Audience, Identified {
}
}
/**
* Returns the distance from the other {@link CarbonPlayer}, or -1 if the players are not in the same world.
*
* @param other the other player
* @return the distance from the other player, or -1
* @since 2.0.8
*/
double distanceSquaredFrom(final CarbonPlayer other);
/**
* Returns if both players are in the same world or server.
*
* @param other the other player
* @return if both players are in the same world/server
* @since 2.0.8
*/
boolean sameWorldAs(final CarbonPlayer other);
/**
* Gets the player's username.
*