Class Grave

java.lang.Object
com.ranull.graves.type.Grave
All Implemented Interfaces:
Serializable, org.bukkit.inventory.InventoryHolder

public class Grave extends Object implements org.bukkit.inventory.InventoryHolder, Serializable
Represents a grave in the game, storing information about the player or entity that the grave belongs to, including inventory, location, and various other attributes.
See Also:
  • Constructor Details

    • Grave

      public Grave(UUID uuid)
      Constructs a new Grave with the specified UUID.
      Parameters:
      uuid - The UUID of the grave.
  • Method Details

    • getInventory

      @NotNull public @NotNull org.bukkit.inventory.Inventory getInventory()
      Gets the inventory associated with this grave.
      Specified by:
      getInventory in interface org.bukkit.inventory.InventoryHolder
      Returns:
      The inventory of the grave.
    • setInventory

      public void setInventory(org.bukkit.inventory.Inventory inventory)
      Sets the inventory for this grave.
      Parameters:
      inventory - The inventory to set.
    • getEquipmentMap

      public Map<org.bukkit.inventory.EquipmentSlot,org.bukkit.inventory.ItemStack> getEquipmentMap()
      Gets the equipment map for this grave.
      Returns:
      The equipment map.
    • setEquipmentMap

      public void setEquipmentMap(Map<org.bukkit.inventory.EquipmentSlot,org.bukkit.inventory.ItemStack> equipmentMap)
      Sets the equipment map for this grave.
      Parameters:
      equipmentMap - The equipment map to set.
    • getInventoryItemStack

      public List<org.bukkit.inventory.ItemStack> getInventoryItemStack()
      Gets a list of item stacks in the inventory.
      Returns:
      A list of item stacks.
    • getUUID

      public UUID getUUID()
      Gets the UUID of the grave.
      Returns:
      The UUID of the grave.
    • getPermissionList

      public List<String> getPermissionList()
      Gets the permission list associated with this grave.
      Returns:
      The permission list.
    • setPermissionList

      public void setPermissionList(List<String> permissionList)
      Sets the permission list for this grave.
      Parameters:
      permissionList - The permission list to set.
    • getLocationDeath

      public org.bukkit.Location getLocationDeath()
      Gets the death location of the grave.
      Returns:
      The death location.
    • getLocationDeathData

      public LocationData getLocationDeathData()
      Folia-friendly accessor for the raw serialized location data.

      Use this to schedule region-bound tasks with your scheduler before touching the world.

      Returns:
      the underlying LocationData, or null if unset.
    • setLocationDeath

      public void setLocationDeath(org.bukkit.Location locationDeath)
      Sets the death location for the grave.
      Parameters:
      locationDeath - The death location to set.
    • getYaw

      public float getYaw()
      Gets the yaw (rotation) of the grave.
      Returns:
      The yaw.
    • setYaw

      public void setYaw(float yaw)
      Sets the yaw (rotation) of the grave.
      Parameters:
      yaw - The yaw to set.
    • getPitch

      public float getPitch()
      Gets the pitch (vertical rotation) of the grave.
      Returns:
      The pitch.
    • setPitch

      public void setPitch(float pitch)
      Sets the pitch (vertical rotation) of the grave.
      Parameters:
      pitch - The pitch to set.
    • getOwnerType

      public org.bukkit.entity.EntityType getOwnerType()
      Gets the entity type of the grave's owner.
      Returns:
      The owner entity type.
    • setOwnerType

      public void setOwnerType(org.bukkit.entity.EntityType ownerType)
      Sets the entity type of the grave's owner.
      Parameters:
      ownerType - The owner entity type to set.
    • getOwnerName

      public String getOwnerName()
      Gets the name of the grave's owner.
      Returns:
      The owner name.
    • setOwnerName

      public void setOwnerName(String ownerName)
      Sets the name of the grave's owner.
      Parameters:
      ownerName - The owner name to set.
    • getOwnerNameDisplay

      public String getOwnerNameDisplay()
      Gets the display name of the grave's owner.
      Returns:
      The owner display name.
    • setOwnerNameDisplay

      public void setOwnerNameDisplay(String ownerNameDisplay)
      Sets the display name of the grave's owner.
      Parameters:
      ownerNameDisplay - The owner display name to set.
    • getOwnerUUID

      public UUID getOwnerUUID()
      Gets the UUID of the grave's owner.
      Returns:
      The owner UUID.
    • setOwnerUUID

      public void setOwnerUUID(UUID ownerUUID)
      Sets the UUID of the grave's owner.
      Parameters:
      ownerUUID - The owner UUID to set.
    • getOwnerTexture

      public String getOwnerTexture()
      Gets the texture of the grave's owner.
      Returns:
      The owner texture.
    • setOwnerTexture

      public void setOwnerTexture(String ownerTexture)
      Sets the texture of the grave's owner.
      Parameters:
      ownerTexture - The owner texture to set.
    • getOwnerTextureSignature

      public String getOwnerTextureSignature()
      Gets the texture signature of the grave's owner.
      Returns:
      The owner texture signature.
    • setOwnerTextureSignature

      public void setOwnerTextureSignature(String ownerTextureSignature)
      Sets the texture signature of the grave's owner.
      Parameters:
      ownerTextureSignature - The owner texture signature to set.
    • getKillerType

      public org.bukkit.entity.EntityType getKillerType()
      Gets the entity type of the grave's killer.
      Returns:
      The killer entity type.
    • setKillerType

      public void setKillerType(org.bukkit.entity.EntityType killerType)
      Sets the entity type of the grave's killer.
      Parameters:
      killerType - The killer entity type to set.
    • getKillerName

      public String getKillerName()
      Gets the name of the grave's killer.
      Returns:
      The killer name.
    • setKillerName

      public void setKillerName(String killerName)
      Sets the name of the grave's killer.
      Parameters:
      killerName - The killer name to set.
    • getKillerNameDisplay

      public String getKillerNameDisplay()
      Gets the display name of the grave's killer.
      Returns:
      The killer display name.
    • setKillerNameDisplay

      public void setKillerNameDisplay(String killerNameDisplay)
      Sets the display name of the grave's killer.
      Parameters:
      killerNameDisplay - The killer display name to set.
    • getKillerUUID

      public UUID getKillerUUID()
      Gets the UUID of the grave's killer.
      Returns:
      The killer UUID.
    • setKillerUUID

      public void setKillerUUID(UUID killerUUID)
      Sets the UUID of the grave's killer.
      Parameters:
      killerUUID - The killer UUID to set.
    • getExperience

      public int getExperience()
      Gets the experience points stored in the grave.
      Returns:
      The experience points.
    • setExperience

      public void setExperience(int experience)
      Sets the experience points for the grave.
      Parameters:
      experience - The experience points to set.
    • getProtection

      public boolean getProtection()
      Checks if the grave has protection enabled.
      Returns:
      True if protection is enabled, otherwise false.
    • setProtection

      public void setProtection(boolean protection)
      Sets the protection status for the grave.
      Parameters:
      protection - True to enable protection, otherwise false.
    • getTimeAlive

      public long getTimeAlive()
      Gets the time (in milliseconds) the grave is set to be alive.
      Returns:
      The time alive.
    • setTimeAlive

      public void setTimeAlive(long aliveTime)
      Sets the time (in milliseconds) the grave is set to be alive.
      Parameters:
      aliveTime - The time alive to set.
    • getTimeCreation

      public long getTimeCreation()
      Gets the creation time (in milliseconds) of the grave.
      Returns:
      The creation time.
    • setTimeCreation

      public void setTimeCreation(long timeCreation)
      Sets the creation time (in milliseconds) of the grave.
      Parameters:
      timeCreation - The creation time to set.
    • getTimeProtection

      public long getTimeProtection()
      Gets the protection time (in milliseconds) of the grave.
      Returns:
      The protection time.
    • setTimeProtection

      public void setTimeProtection(long timeProtection)
      Sets the protection time (in milliseconds) of the grave.
      Parameters:
      timeProtection - The protection time to set.
    • setTimeAliveRemaining

      public void setTimeAliveRemaining(long timeAlive)
      Sets the remaining time (in milliseconds) the grave is set to be alive. A value of -1 indicates the grave should not expire.
      Parameters:
      timeAlive - The new remaining time alive.
    • getTimeAliveRemaining

      public long getTimeAliveRemaining()
      Gets the remaining time (in milliseconds) the grave is set to be alive.
      Returns:
      The remaining time alive.
    • getTimeProtectionRemaining

      public long getTimeProtectionRemaining()
      Gets the remaining time (in milliseconds) the grave is protected.
      Returns:
      The remaining protection time.
    • getLivedTime

      public long getLivedTime()
      Gets the total lived time (in milliseconds) since the grave was created.
      Returns:
      The lived time.
    • isAbandoned

      public boolean isAbandoned()
      Determines if a grave was abandoned. Credit to Grave abandoning feature
      Returns:
      the abandoned grave.
    • setAbandoned

      public void setAbandoned(boolean is_abandoned)
      Determines if a grave was abandoned. Credit to Grave abandoning feature
      Parameters:
      is_abandoned - set grave as abandoned.
    • getItemAmount

      public int getItemAmount()
      Gets the number of items in the grave's inventory.
      Returns:
      The number of items.
    • getOwnerDisplayName

      public String getOwnerDisplayName()
      Retrieves the display name of the owner.

      This method returns the display name of the owner as a String.

      Returns:
      The display name of the owner.
    • setOwnerDisplayName

      public void setOwnerDisplayName(String ownerNameDisplay)
      Sets the display name of the owner.

      This method sets the display name of the owner to the specified String.

      Parameters:
      ownerNameDisplay - The display name to set for the owner.
    • getLocation

      @Deprecated public org.bukkit.Location getLocation()
      Deprecated.
      This method is deprecated and will be removed in future versions. Use getLocationDeath() instead for accurate location data. Retrieves the location associated with this instance.

      This method returns the location as a Location object.

      Returns:
      The location associated with this instance.
    • setGravePreview

      public void setGravePreview(boolean isPreview)
      Sets the Preview state of a specific grave.
      Parameters:
      isPreview - Sets the grave preview state.
    • getGravePreview

      public boolean getGravePreview()
      Gets the Preview state of a specific grave.
    • setLocation

      @Deprecated public void setLocation(org.bukkit.Location location)
      Deprecated.
      This method is deprecated and will be removed in future versions. Use setLocationDeath(Location) instead for accurate location data. Sets the location associated with this instance.

      This method sets the location to the specified Location.

      Parameters:
      location - The location to set.