Interface TachyonProfile
- All Known Implementing Classes:
TachyonProfileImpl
public interface TachyonProfile
Project Tachyon
Class TachyonProfile
Component lifecycle:
-
setComponent()called by plugins — sets value AND marks dirty. -
saveComponent()marks dirty + immediately enqueues a gRPC save. -
saveProfile()flushes only dirty components to the backend.
The dirty set acts as a safety net: if a saveComponent() gRPC call hasn't
been confirmed yet when the player disconnects, saveProfile() will catch it.
- Since:
- 1.0.0-SNAPSHOT
- Version:
- 1.0
- Author:
- Jimmy (vSKAH) - 09/04/2026
-
Method Summary
Modifier and TypeMethodDescription@NotNull List<ComponentNamespace> @NotNull Map<ComponentNamespace, org.bson.BsonDocument> <T extends Record>
TgetComponent(@NotNull Class<T> clazz) Retrieves a component by its class type.<T extends Record>
TgetComponent(@NotNull Class<T> clazz, T defaultValue) Retrieves a component by its class type, returning a fallback value if it is not found.getUuid()Gets the unique identifier of the player who owns this profile.booleanvoidmarkAsClean(@NotNull Collection<Class<? extends Record>> savedClasses, @NotNull Collection<ComponentNamespace> deletedComponent) <T extends Record>
voidremoveComponent(@NotNull Class<T> clazz) <T extends Record>
voidsetComponent(T component) Overwrites the current instance of the component in the profile memory and marks it as dirty for the next profile save.<T extends Record>
voidupdateComponent(@NotNull Class<T> clazz, @NotNull UnaryOperator<T> modifier) Convenience method to safely update an existing Record component using its Builder.
-
Method Details
-
setComponent
Overwrites the current instance of the component in the profile memory and marks it as dirty for the next profile save.- Type Parameters:
T- The specific type of the Protobuf message.- Parameters:
component- The new Protobuf component instance to store.
-
updateComponent
<T extends Record> void updateComponent(@NotNull @NotNull Class<T> clazz, @NotNull @NotNull UnaryOperator<T> modifier) Convenience method to safely update an existing Record component using its Builder.This retrieves the current immutable Record component, applies the modification function replaces the stored component, and automatically mark it as dirty for the next save cycle, and increment its version counter.
- Type Parameters:
T- The specific record comportnent type- Parameters:
clazz- The class of the Record component to updatemodifier- A function taking the current Record instance and returning a new updated Record instance.
-
getComponent
Retrieves a component by its class type, returning a fallback value if it is not found.- Type Parameters:
T- The specific type of the Protobuf message.- Parameters:
clazz- The class of the component to retrieve.defaultValue- The value to return if the player does not have this component loaded.- Returns:
- The current component instance, or the provided default value.
-
getComponent
Retrieves a component by its class type.- Type Parameters:
T- The specific type of the Protobuf message.- Parameters:
clazz- The class of the component to retrieve.- Returns:
- The current component instance, or
nullif not found.
-
removeComponent
-
hasPendingChanges
boolean hasPendingChanges() -
extractDirtyComponents
-
extractDeletedComponents
-
markAsClean
void markAsClean(@NotNull @NotNull Collection<Class<? extends Record>> savedClasses, @NotNull @NotNull Collection<ComponentNamespace> deletedComponent) -
getUuid
UUID getUuid()Gets the unique identifier of the player who owns this profile.- Returns:
- The player's UUID.
-