mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
#1018: Add methods to get players seeing specific chunks
By: MetallicGoat <the.great.metallic.goat@gmail.com>
This commit is contained in:
parent
3dcb0dfc9a
commit
b4ac71a201
2 changed files with 39 additions and 0 deletions
|
@ -6,6 +6,7 @@ import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockState;
|
import org.bukkit.block.BlockState;
|
||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.generator.structure.GeneratedStructure;
|
import org.bukkit.generator.structure.GeneratedStructure;
|
||||||
import org.bukkit.generator.structure.Structure;
|
import org.bukkit.generator.structure.Structure;
|
||||||
import org.bukkit.persistence.PersistentDataHolder;
|
import org.bukkit.persistence.PersistentDataHolder;
|
||||||
|
@ -285,6 +286,17 @@ public interface Chunk extends PersistentDataHolder {
|
||||||
@NotNull
|
@NotNull
|
||||||
Collection<GeneratedStructure> getStructures(@NotNull Structure structure);
|
Collection<GeneratedStructure> getStructures(@NotNull Structure structure);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a list of all players who are can view the chunk from their client
|
||||||
|
* <p>
|
||||||
|
* This list will be empty if no players are viewing the chunk, or the chunk
|
||||||
|
* is unloaded.
|
||||||
|
*
|
||||||
|
* @return collection of players who can see the chunk
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
public Collection<Player> getPlayersSeeingChunk();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An enum to specify the load level of a chunk.
|
* An enum to specify the load level of a chunk.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -314,6 +314,33 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public boolean refreshChunk(int x, int z);
|
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
|
* Gets whether the chunk at the specified chunk coordinates is force
|
||||||
* loaded.
|
* loaded.
|
||||||
|
|
Loading…
Reference in a new issue