isDirty

Flag indicating whether this PlayerData instance has been modified.

The dirty flag is used by the persistence system to optimize database operations. When true, it indicates that the data has been modified since the last save operation and needs to be written to the database.

Automatic Management:

  • Set to true automatically by property setters when values change

  • Set to false by calling setClean() after successful database saves

  • Can be manually set to true using markDirty()

Performance Impact: This flag allows the autosave system to skip unnecessary database operations for unchanged data, significantly improving performance with many online players.

Thread Safety: The @Transient annotation ensures this field is not serialized if the class is ever serialized directly (though it's primarily stored in JSON).