PocketMine-MP 5.21.2 git-b2aa6396c3cc2cafdd815eacc360e1ad89599899
|
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 40 of file BlockTransaction.php.
Adds a block to the transaction at the given position.
Definition at line 51 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 60 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 126 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 86 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 137 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 69 of file BlockTransaction.php.
pocketmine\world\BlockTransaction::fetchBlockAt | ( | int | $x, |
int | $y, | ||
int | $z ) |
Definition at line 76 of file BlockTransaction.php.
pocketmine\world\BlockTransaction::getBlocks | ( | ) |
Definition at line 109 of file BlockTransaction.php.