Class GraveLogger
java.lang.Object
com.haven.havenplugin.graves.GraveLogger
Persists a historical record of recent graves.
Files live at: data/graves//.yml
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanupAsync(long retentionMillis) Deletes log files whosecreatedAtpredates the retention window.listGraveIds(UUID ownerId) Returns logged grave UUID strings for a player (used for tab completion).Returns all log entries for a player sorted by createdAt ascending.loadGraveFromLog(UUID ownerId, UUID graveId) Deserialises a fullGravefrom a log file for /graves restore.voidWrites a full log entry with status=ACTIVE.voidmarkDeleted(UUID ownerId, UUID graveId, GraveRemoveReason reason) Updates the status field on an existing log entry.voidreactivate(UUID ownerId, UUID graveId, org.bukkit.Location newLoc, long newExpiresAt) Marks the log ACTIVE again and updates coordinates + expiresAt after a restore.
-
Constructor Details
-
GraveLogger
-
-
Method Details
-
logGrave
Writes a full log entry with status=ACTIVE. Call immediately after grave creation. -
markDeleted
Updates the status field on an existing log entry. RESTORED is intentionally a no-op so the file keeps its previous status untilreactivate(UUID, UUID, Location, long)is called. -
reactivate
-
loadGraveFromLog
-
listLogs
-
listGraveIds
-
cleanupAsync
public void cleanupAsync(long retentionMillis) Deletes log files whosecreatedAtpredates the retention window. Runs asynchronously to avoid blocking the main thread.
-