-
Notifications
You must be signed in to change notification settings - Fork 0
Accessing and Changing Person Data
HelightDev edited this page Sep 2, 2019
·
2 revisions
Before trying to interact with user-data, you should choose a datasource(DataAccessPerson) which meets your requirements, speaking of MongoDB (PersistentDataPerson) or Redis(TempDataPerson). You can then obtain a Instance by passing a Person to the individual constructor.
- You can use DataAccessPerson#get(field,class) directly after constructing a DataAccessPerson, giving access to simple data
- You can construct SpecificPerson-Implementations by passing a DataAccessPerson to the constructor, giving access to platform specific data like ItemStacks
A plain DataAccessPerson gives access to the methods getHash() and storeHash(), which are used with a Hash for comparing passwords or anonymizing data. For generating a Hash you should invoke HashingFactory#simpleHash(MD5) or HashingFactory#advancedHash(SHA512) passing the String to hash