public class ChunkKeyMap<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,T> |
storage |
Constructor and Description |
---|
ChunkKeyMap() |
Modifier and Type | Method and Description |
---|---|
T |
get(org.bukkit.Chunk key)
Gets the value, mapped to the given chunk.
|
static java.lang.String |
getChunkKey(org.bukkit.Chunk chunk)
Converts the chunk's data into an unique key.
|
java.util.List<T> |
getInRadius(org.bukkit.Chunk key,
int radius)
Gets all values, mapped to chunks inside the the given radius.
|
void |
put(org.bukkit.Chunk key,
T value)
Maps a chunk to the given value.
|
void |
remove(org.bukkit.Chunk key)
Removes the given chunk and its associated value from the map.
|
private java.util.Map<java.lang.String,T> storage
public void put(org.bukkit.Chunk key, T value)
key
- The chunk to use as key.value
- The value.public void remove(org.bukkit.Chunk key)
key
- The chunk to use as key.public T get(org.bukkit.Chunk key)
key
- The chunk to use as key.public java.util.List<T> getInRadius(org.bukkit.Chunk key, int radius)
key
- The chunk to use as key for the center.radius
- The radius in chunks, in which values should be found.public static java.lang.String getChunkKey(org.bukkit.Chunk chunk)
chunk
- The chunk to get a key to.