Package com.ranull.graves.manager
Class CacheManager
java.lang.Object
com.ranull.graves.manager.CacheManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionA map of chunk identifiers to their correspondingChunkData
objects.A map of grave UUIDs to their correspondingGrave
objects.A map of entity UUIDs to their last knownLocation
.A map of entity UUIDs to lists of removedItemStack
objects.A map of block identifiers to their correspondingLocation
objects where the block was right-clicked. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRightClickedBlock
(String playerName, org.bukkit.Location location) Adds a right-clicked block location for a specified player.Returns the map of chunk identifiers to their correspondingChunkData
objects.Returns the map of grave UUIDs to their correspondingGrave
objects.Returns the map of entity UUIDs to their last knownLocation
.getOldestGrave
(UUID playerUUID) Returns the oldest grave for a given player.Returns the map of entity UUIDs to lists of removedItemStack
objects.org.bukkit.Location
getRightClickedBlock
(String playerName) Retrieves the location of the right-clicked block for a specified player.boolean
hasRightClickedBlock
(String playerName) Checks if a right-clicked block location exists for a specified player.void
removeRightClickedBlock
(String playerName, org.bukkit.Location location) Removes the right-clicked block location for a specified player.
-
Field Details
-
graveMap
-
chunkMap
-
lastLocationMap
-
removedItemStackMap
-
rightClickedBlocks
-
-
Constructor Details
-
CacheManager
public CacheManager()Constructs a newCacheManager
with initialized maps.The constructor initializes all the maps used for caching data related to graves, chunks, locations, and items
-
-
Method Details
-
getGraveMap
Returns the map of grave UUIDs to their correspondingGrave
objects.- Returns:
- the map of graves
-
addRightClickedBlock
Adds a right-clicked block location for a specified player.- Parameters:
playerName
- the name of the playerlocation
- the location of the right-clicked block
-
getRightClickedBlock
Retrieves the location of the right-clicked block for a specified player.- Parameters:
playerName
- the name of the player- Returns:
- the location of the right-clicked block, or
null
if not found
-
removeRightClickedBlock
Removes the right-clicked block location for a specified player.- Parameters:
playerName
- the name of the playerlocation
- the location of the right-clicked block
-
hasRightClickedBlock
Checks if a right-clicked block location exists for a specified player.- Parameters:
playerName
- the name of the player- Returns:
true
if the right-clicked block location exists,false
otherwise
-
getChunkMap
Returns the map of chunk identifiers to their correspondingChunkData
objects.- Returns:
- the map of chunk data
-
getLastLocationMap
Returns the map of entity UUIDs to their last knownLocation
.- Returns:
- the map of last known locations
-
getRemovedItemStackMap
Returns the map of entity UUIDs to lists of removedItemStack
objects.- Returns:
- the map of removed item stacks
-
getOldestGrave
Returns the oldest grave for a given player.- Parameters:
playerUUID
- The UUID of the player whose graves to consider.- Returns:
- The oldest grave for the specified player.
-