Class ChunkData

java.lang.Object
com.ranull.graves.data.ChunkData
All Implemented Interfaces:
Serializable

public class ChunkData extends Object implements Serializable
Represents data for a specific chunk in the game world, including block and entity data.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Map<org.bukkit.Location,BlockData>
    A 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

    Constructors
    Constructor
    Description
    ChunkData(org.bukkit.Location location)
    Constructs a new ChunkData instance based on a location.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds block data to the chunk.
    void
    Adds entity data to the chunk.
    Map<org.bukkit.Location,BlockData>
    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
    Gets the world of the chunk.
    int
    Gets the x-coordinate of the chunk.
    int
    Gets the z-coordinate of the chunk.
    boolean
    Checks if the chunk has any block or entity data.
    boolean
    Checks if the chunk is currently loaded.
    void
    removeBlockData(org.bukkit.Location location)
    Removes block data from the chunk based on the location.
    void
    Removes entity data from the chunk based on the entity's UUID.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • world

      private final org.bukkit.World world
      The world in which the grave is located.

      This World object represents the Minecraft world where the grave is situated.

    • x

      private final int x
      The x-coordinate of the grave's location.

      This integer represents the horizontal position of the grave in the Minecraft world.

    • z

      private final int z
      The z-coordinate of the grave's location.

      This integer represents the horizontal position of the grave in the Minecraft world.

    • blockDataMap

      private final Map<org.bukkit.Location,BlockData> blockDataMap
      A map of block locations and their corresponding block data.

      This Map contains Location keys representing the locations of blocks and BlockData values representing the data of those blocks at those locations.

    • entityDataMap

      private final Map<UUID,EntityData> entityDataMap
      A map of entity UUIDs and their corresponding entity data.

      This Map contains UUID keys representing unique identifiers for entities and EntityData 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

      public Map<org.bukkit.Location,BlockData> getBlockDataMap()
      Gets the map of block data within the chunk.
      Returns:
      The map of block data.
    • addBlockData

      public void addBlockData(BlockData blockData)
      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

      public Map<UUID,EntityData> getEntityDataMap()
      Gets the map of entity data within the chunk.
      Returns:
      The map of entity data.
    • addEntityData

      public void addEntityData(EntityData entityData)
      Adds entity data to the chunk.
      Parameters:
      entityData - The entity data to add.
    • removeEntityData

      public void removeEntityData(EntityData entityData)
      Removes entity data from the chunk based on the entity's UUID.
      Parameters:
      entityData - The entity data to remove.