Skip to content

Accessing and Changing Person Data

HelightDev edited this page Sep 2, 2019 · 2 revisions

Selecting a Datasource

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.

Accessing & Modifying Data

  • 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

Hashes

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

Clone this wiki locally