Skip to content

VaultData 5.47.0 ​

final class · pocketmine\block\vault\VaultData · source

The state of a vault (vanilla VaultServerData and VaultSharedData): the players it rewarded, the reward being ejected, the item it shows and the players near it that can open it.

Bedrock saves it in the "data" tag of the block entity. Rewarded players are kept by UUID (saved in "pm_rewarded_player_uuids"); the actor IDs of Bedrock's "rewarded_players" (worlds from Bedrock) are kept as they are. Timers are server ticks and are not saved: a loaded vault updates at once.

Constants ​

MAX_REWARDED_PLAYERS ​

php
public const MAX_REWARDED_PLAYERS = 128

Players remembered at most; the oldest are forgotten (vanilla VaultServerData.MAX_REWARD_PLAYERS).

TAG_DISPLAY_ITEM ​

php
public const TAG_DISPLAY_ITEM = "display_item"

TAG_ITEMS_TO_EJECT ​

php
public const TAG_ITEMS_TO_EJECT = "items_to_eject"

TAG_REWARDED_PLAYERS ​

php
public const TAG_REWARDED_PLAYERS = "rewarded_players"

TAG_REWARDED_PLAYER_UUIDS ​

php
public const TAG_REWARDED_PLAYER_UUIDS = "pm_rewarded_player_uuids"

UUIDs of the players the vault rewarded (PocketMine).

TAG_STATE_UPDATING_RESUMES_AT ​

php
public const TAG_STATE_UPDATING_RESUMES_AT = "state_updating_resumes_at"

TAG_TOTAL_EJECTIONS_NEEDED ​

php
public const TAG_TOTAL_EJECTIONS_NEEDED = "total_ejections_needed"

Properties ​

$lastInsertFailTimestamp ​

php
public int $lastInsertFailTimestamp

Server tick of the last refused key sound.

$stateUpdatingResumesAt ​

php
public int $stateUpdatingResumesAt

Server tick before which the state isn't updated (vanilla state_updating_resumes_at).

Methods ​

addRewardedPlayer() ​

php
public function addRewardedPlayer(string $uuid) : void

Remembers a rewarded player (vanilla addToRewardedPlayers), forgetting the oldest beyond VaultData::MAX_REWARDED_PLAYERS.

clearSharedDirty() ​

php
public function clearSharedDirty() : void

getConnectedPlayers() ​

php
public function getConnectedPlayers() : array

getDisplayItem() ​

php
public function getDisplayItem() : ?\pocketmine\item\Item

getItemsToEject() ​

php
public function getItemsToEject() : array

Items left to eject, the next one last.

getNextItemToEject() ​

php
public function getNextItemToEject() : ?\pocketmine\item\Item

getRewardedPlayers() ​

php
public function getRewardedPlayers() : array

getTotalEjectionsNeeded() ​

php
public function getTotalEjectionsNeeded() : int

hasConnectedPlayers() ​

php
public function hasConnectedPlayers() : bool

hasRewardedPlayer() ​

php
public function hasRewardedPlayer(string $uuid) : bool

isSharedDirty() ​

php
public function isSharedDirty() : bool

markEjectionFinished() ​

php
public function markEjectionFinished() : void

popNextItemToEject() ​

php
public function popNextItemToEject() : ?\pocketmine\item\Item

readSaveData() ​

php
public function readSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : void

setConnectedPlayers() ​

php
public function setConnectedPlayers(array $players) : void

Sets the players near the vault (UUID => entity ID); those it rewarded already are left out (vanilla updateConnectedPlayersWithinRange).

setDisplayItem() ​

php
public function setDisplayItem(?\pocketmine\item\Item $item) : void

setItemsToEject() ​

php
public function setItemsToEject(array $items) : void

writeSaveData() ​

php
public function writeSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : void

VanillaMine is a fork of PocketMine-MP. Not affiliated with the PMMP team or Mojang.