PocketMine-MP 5.23.3 git-f7687af337d001ddbcc47b8e773f014a33faa662
Loading...
Searching...
No Matches
pocketmine\player\DatFilePlayerDataProvider Class Reference
+ Inheritance diagram for pocketmine\player\DatFilePlayerDataProvider:
+ Collaboration diagram for pocketmine\player\DatFilePlayerDataProvider:

Public Member Functions

 __construct (private string $path)
 
 hasData (string $name)
 
 loadData (string $name)
 
 saveData (string $name, CompoundTag $data)
 

Detailed Description

Stores player data in a single .dat file per player. Each file is gzipped big-endian NBT.

Definition at line 44 of file DatFilePlayerDataProvider.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\player\DatFilePlayerDataProvider::__construct ( private string $path)

Definition at line 46 of file DatFilePlayerDataProvider.php.

Member Function Documentation

◆ hasData()

pocketmine\player\DatFilePlayerDataProvider::hasData ( string $name)

Returns whether there are any data associated with the given player name.

Implements pocketmine\player\PlayerDataProvider.

Definition at line 59 of file DatFilePlayerDataProvider.php.

◆ loadData()

pocketmine\player\DatFilePlayerDataProvider::loadData ( string $name)

Returns the data associated with the given player name, or null if there is no data. TODO: we need an async version of this

Exceptions
PlayerDataLoadException

Implements pocketmine\player\PlayerDataProvider.

Definition at line 63 of file DatFilePlayerDataProvider.php.

◆ saveData()

pocketmine\player\DatFilePlayerDataProvider::saveData ( string $name,
CompoundTag $data )

Saves data for the give player name.

Exceptions
PlayerDataSaveException

Implements pocketmine\player\PlayerDataProvider.

Definition at line 91 of file DatFilePlayerDataProvider.php.


The documentation for this class was generated from the following file: