Package com.ranull.graves.type
Class Grave
java.lang.Object
com.ranull.graves.type.Grave
- All Implemented Interfaces:
Serializable
,org.bukkit.inventory.InventoryHolder
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enum for defining different storage modes for the grave. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMap
<org.bukkit.inventory.EquipmentSlot, org.bukkit.inventory.ItemStack> Gets the equipment map for this grave.int
Gets the experience points stored in the grave.boolean
Gets the Preview state of a specific grave.@NotNull org.bukkit.inventory.Inventory
Gets the inventory associated with this grave.List
<org.bukkit.inventory.ItemStack> Gets a list of item stacks in the inventory.int
Gets the number of items in the grave's inventory.Gets the name of the grave's killer.Gets the display name of the grave's killer.org.bukkit.entity.EntityType
Gets the entity type of the grave's killer.Gets the UUID of the grave's killer.long
Gets the total lived time (in milliseconds) since the grave was created.org.bukkit.Location
Deprecated.This method is deprecated and will be removed in future versions.org.bukkit.Location
Gets the death location of the grave.Folia-friendly accessor for the raw serialized location data.Retrieves the display name of the owner.Gets the name of the grave's owner.Gets the display name of the grave's owner.Gets the texture of the grave's owner.Gets the texture signature of the grave's owner.org.bukkit.entity.EntityType
Gets the entity type of the grave's owner.Gets the UUID of the grave's owner.Gets the permission list associated with this grave.float
getPitch()
Gets the pitch (vertical rotation) of the grave.boolean
Checks if the grave has protection enabled.long
Gets the time (in milliseconds) the grave is set to be alive.long
Gets the remaining time (in milliseconds) the grave is set to be alive.long
Gets the creation time (in milliseconds) of the grave.long
Gets the protection time (in milliseconds) of the grave.long
Gets the remaining time (in milliseconds) the grave is protected.getUUID()
Gets the UUID of the grave.float
getYaw()
Gets the yaw (rotation) of the grave.boolean
Determines if a grave was abandoned.void
setAbandoned
(boolean is_abandoned) Determines if a grave was abandoned.void
setEquipmentMap
(Map<org.bukkit.inventory.EquipmentSlot, org.bukkit.inventory.ItemStack> equipmentMap) Sets the equipment map for this grave.void
setExperience
(int experience) Sets the experience points for the grave.void
setGravePreview
(boolean isPreview) Sets the Preview state of a specific grave.void
setInventory
(org.bukkit.inventory.Inventory inventory) Sets the inventory for this grave.void
setKillerName
(String killerName) Sets the name of the grave's killer.void
setKillerNameDisplay
(String killerNameDisplay) Sets the display name of the grave's killer.void
setKillerType
(org.bukkit.entity.EntityType killerType) Sets the entity type of the grave's killer.void
setKillerUUID
(UUID killerUUID) Sets the UUID of the grave's killer.void
setLocation
(org.bukkit.Location location) Deprecated.This method is deprecated and will be removed in future versions.void
setLocationDeath
(org.bukkit.Location locationDeath) Sets the death location for the grave.void
setOwnerDisplayName
(String ownerNameDisplay) Sets the display name of the owner.void
setOwnerName
(String ownerName) Sets the name of the grave's owner.void
setOwnerNameDisplay
(String ownerNameDisplay) Sets the display name of the grave's owner.void
setOwnerTexture
(String ownerTexture) Sets the texture of the grave's owner.void
setOwnerTextureSignature
(String ownerTextureSignature) Sets the texture signature of the grave's owner.void
setOwnerType
(org.bukkit.entity.EntityType ownerType) Sets the entity type of the grave's owner.void
setOwnerUUID
(UUID ownerUUID) Sets the UUID of the grave's owner.void
setPermissionList
(List<String> permissionList) Sets the permission list for this grave.void
setPitch
(float pitch) Sets the pitch (vertical rotation) of the grave.void
setProtection
(boolean protection) Sets the protection status for the grave.void
setTimeAlive
(long aliveTime) Sets the time (in milliseconds) the grave is set to be alive.void
setTimeAliveRemaining
(long timeAlive) Sets the remaining time (in milliseconds) the grave is set to be alive.void
setTimeCreation
(long timeCreation) Sets the creation time (in milliseconds) of the grave.void
setTimeProtection
(long timeProtection) Sets the protection time (in milliseconds) of the grave.void
setYaw
(float yaw) Sets the yaw (rotation) of the grave.
-
Constructor Details
-
Grave
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 interfaceorg.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
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
Gets a list of item stacks in the inventory.- Returns:
- A list of item stacks.
-
getUUID
Gets the UUID of the grave.- Returns:
- The UUID of the grave.
-
getPermissionList
Gets the permission list associated with this grave.- Returns:
- The permission list.
-
setPermissionList
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
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
, ornull
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
Gets the name of the grave's owner.- Returns:
- The owner name.
-
setOwnerName
Sets the name of the grave's owner.- Parameters:
ownerName
- The owner name to set.
-
getOwnerNameDisplay
Gets the display name of the grave's owner.- Returns:
- The owner display name.
-
setOwnerNameDisplay
Sets the display name of the grave's owner.- Parameters:
ownerNameDisplay
- The owner display name to set.
-
getOwnerUUID
Gets the UUID of the grave's owner.- Returns:
- The owner UUID.
-
setOwnerUUID
Sets the UUID of the grave's owner.- Parameters:
ownerUUID
- The owner UUID to set.
-
getOwnerTexture
Gets the texture of the grave's owner.- Returns:
- The owner texture.
-
setOwnerTexture
Sets the texture of the grave's owner.- Parameters:
ownerTexture
- The owner texture to set.
-
getOwnerTextureSignature
Gets the texture signature of the grave's owner.- Returns:
- The owner texture signature.
-
setOwnerTextureSignature
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
Gets the name of the grave's killer.- Returns:
- The killer name.
-
setKillerName
Sets the name of the grave's killer.- Parameters:
killerName
- The killer name to set.
-
getKillerNameDisplay
Gets the display name of the grave's killer.- Returns:
- The killer display name.
-
setKillerNameDisplay
Sets the display name of the grave's killer.- Parameters:
killerNameDisplay
- The killer display name to set.
-
getKillerUUID
Gets the UUID of the grave's killer.- Returns:
- The killer UUID.
-
setKillerUUID
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
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
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.This method is deprecated and will be removed in future versions. UsegetLocationDeath()
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.This method is deprecated and will be removed in future versions. UsesetLocationDeath(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.
-