PocketMine-MP 5.21.3 git-fcef015f32c0b0709cfd4d6f1b3c32f484b25bde
|
Public Member Functions | |
__construct (private ChunkManager $world) | |
addBlock (Vector3 $pos, Block $state) | |
addBlockAt (int $x, int $y, int $z, Block $state) | |
addValidator (\Closure $validator) | |
apply () | |
dummyValidator (ChunkManager $world, int $x, int $y, int $z) | |
fetchBlock (Vector3 $pos) | |
fetchBlockAt (int $x, int $y, int $z) | |
getBlocks () | |
Definition at line 30 of file BlockTransaction.php.
pocketmine\world\BlockTransaction::__construct | ( | private ChunkManager | $world | ) |
Definition at line 43 of file BlockTransaction.php.
Adds a block to the transaction at the given position.
Definition at line 54 of file BlockTransaction.php.
Referenced by pocketmine\block\Bed\place(), and pocketmine\block\Door\place().
pocketmine\world\BlockTransaction::addBlockAt | ( | int | $x, |
int | $y, | ||
int | $z, | ||
Block | $state ) |
Adds a block to the batch at the given coordinates.
Definition at line 63 of file BlockTransaction.php.
pocketmine\world\BlockTransaction::addValidator | ( | \Closure | $validator | ) |
Add a validation predicate which will be used to validate every block. The callable signature should be the same as the below dummy function.
@phpstan-param \Closure(ChunkManager $world, int $x, int $y, int $z) : bool $validator
Definition at line 129 of file BlockTransaction.php.
pocketmine\world\BlockTransaction::apply | ( | ) |
Validates and attempts to apply the transaction to the given world. If any part of the transaction fails to validate, no changes will be made to the world.
Definition at line 89 of file BlockTransaction.php.
pocketmine\world\BlockTransaction::dummyValidator | ( | ChunkManager | $world, |
int | $x, | ||
int | $y, | ||
int | $z ) |
Dummy function demonstrating the required closure signature for validators.
@dummy
Definition at line 140 of file BlockTransaction.php.
pocketmine\world\BlockTransaction::fetchBlock | ( | Vector3 | $pos | ) |
Reads a block from the given world, masked by the blocks in this transaction. This can be useful if you want to add blocks to the transaction that depend on previous blocks should they exist.
Definition at line 72 of file BlockTransaction.php.
pocketmine\world\BlockTransaction::fetchBlockAt | ( | int | $x, |
int | $y, | ||
int | $z ) |
Definition at line 79 of file BlockTransaction.php.
pocketmine\world\BlockTransaction::getBlocks | ( | ) |
Definition at line 112 of file BlockTransaction.php.