Package com.ranull.graves.data
Class ChunkData
java.lang.Object
com.ranull.graves.data.ChunkData
- All Implemented Interfaces:
Serializable
Represents data for a specific chunk in the game world, including block and entity data.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionA map of block locations and their corresponding block data.private final Map
<UUID, EntityData> A map of entity UUIDs and their corresponding entity data.private final org.bukkit.World
The world in which the grave is located.private final int
The x-coordinate of the grave's location.private final int
The z-coordinate of the grave's location. -
Constructor Summary
ConstructorsConstructorDescriptionChunkData
(org.bukkit.Location location) Constructs a new ChunkData instance based on a location. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBlockData
(BlockData blockData) Adds block data to the chunk.void
addEntityData
(EntityData entityData) Adds entity data to the chunk.Gets the map of block data within the chunk.Gets the map of entity data within the chunk.org.bukkit.Location
Gets the location of the chunk.org.bukkit.World
getWorld()
Gets the world of the chunk.int
getX()
Gets the x-coordinate of the chunk.int
getZ()
Gets the z-coordinate of the chunk.boolean
hasData()
Checks if the chunk has any block or entity data.boolean
isLoaded()
Checks if the chunk is currently loaded.void
removeBlockData
(org.bukkit.Location location) Removes block data from the chunk based on the location.void
removeEntityData
(EntityData entityData) Removes entity data from the chunk based on the entity's UUID.
-
Field Details
-
world
private final org.bukkit.World worldThe world in which the grave is located.This
World
object represents the Minecraft world where the grave is situated. -
x
private final int xThe x-coordinate of the grave's location.This integer represents the horizontal position of the grave in the Minecraft world.
-
z
private final int zThe z-coordinate of the grave's location.This integer represents the horizontal position of the grave in the Minecraft world.
-
blockDataMap
-
entityDataMap
A map of entity UUIDs and their corresponding entity data.This
Map
containsUUID
keys representing unique identifiers for entities andEntityData
values representing the data associated with those entities.
-
-
Constructor Details
-
ChunkData
public ChunkData(org.bukkit.Location location) Constructs a new ChunkData instance based on a location.- Parameters:
location
- The location within the chunk.
-
-
Method Details
-
getWorld
public org.bukkit.World getWorld()Gets the world of the chunk.- Returns:
- The world of the chunk.
-
getX
public int getX()Gets the x-coordinate of the chunk.- Returns:
- The x-coordinate of the chunk.
-
getZ
public int getZ()Gets the z-coordinate of the chunk.- Returns:
- The z-coordinate of the chunk.
-
hasData
public boolean hasData()Checks if the chunk has any block or entity data.- Returns:
- True if the chunk has data, false otherwise.
-
isLoaded
public boolean isLoaded()Checks if the chunk is currently loaded.- Returns:
- True if the chunk is loaded, false otherwise.
-
getLocation
public org.bukkit.Location getLocation()Gets the location of the chunk.- Returns:
- The location of the chunk.
-
getBlockDataMap
Gets the map of block data within the chunk.- Returns:
- The map of block data.
-
addBlockData
Adds block data to the chunk.- Parameters:
blockData
- The block data to add.
-
removeBlockData
public void removeBlockData(org.bukkit.Location location) Removes block data from the chunk based on the location.- Parameters:
location
- The location of the block data to remove.
-
getEntityDataMap
Gets the map of entity data within the chunk.- Returns:
- The map of entity data.
-
addEntityData
Adds entity data to the chunk.- Parameters:
entityData
- The entity data to add.
-
removeEntityData
Removes entity data from the chunk based on the entity's UUID.- Parameters:
entityData
- The entity data to remove.
-