#1018: Add methods to get players seeing specific chunks

By: MetallicGoat <the.great.metallic.goat@gmail.com>
This commit is contained in:
Bukkit/Spigot
2024-06-08 09:03:39 +10:00
parent 3dcb0dfc9a
commit b4ac71a201
2 changed files with 39 additions and 0 deletions

View File

@@ -314,6 +314,33 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@Deprecated
public boolean refreshChunk(int x, int z);
/**
* Get a list of all players who are can view the specified chunk from their
* client
* <p>
* This list will be empty if no players are viewing the chunk, or the chunk
* is unloaded.
*
* @param chunk the chunk to check
* @return collection of players who can see the chunk
*/
@NotNull
public Collection<Player> getPlayersSeeingChunk(@NotNull Chunk chunk);
/**
* Get a list of all players who are can view the specified chunk from their
* client
* <p>
* This list will be empty if no players are viewing the chunk, or the chunk
* is unloaded.
*
* @param x X-coordinate of the chunk
* @param z Z-coordinate of the chunk
* @return collection of players who can see the chunk
*/
@NotNull
public Collection<Player> getPlayersSeeingChunk(int x, int z);
/**
* Gets whether the chunk at the specified chunk coordinates is force
* loaded.