mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-15 10:19:39 +00:00
Merge branch 'release/3.1'
This commit is contained in:
commit
2252f7498d
@ -846,18 +846,18 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Player[] $target
|
* @param Player[] $target
|
||||||
* @param Block[] $blocks
|
* @param Vector3[] $blocks
|
||||||
* @param int $flags
|
* @param int $flags
|
||||||
* @param bool $optimizeRebuilds
|
* @param bool $optimizeRebuilds
|
||||||
*/
|
*/
|
||||||
public function sendBlocks(array $target, array $blocks, int $flags = UpdateBlockPacket::FLAG_NONE, bool $optimizeRebuilds = false){
|
public function sendBlocks(array $target, array $blocks, int $flags = UpdateBlockPacket::FLAG_NONE, bool $optimizeRebuilds = false){
|
||||||
$packets = [];
|
$packets = [];
|
||||||
if($optimizeRebuilds){
|
if($optimizeRebuilds){
|
||||||
$chunks = [];
|
$chunks = [];
|
||||||
foreach($blocks as $b){
|
foreach($blocks as $b){
|
||||||
if($b === null){
|
if(!($b instanceof Vector3)){
|
||||||
continue;
|
throw new \TypeError("Expected Vector3 in blocks array, got " . (is_object($b) ? get_class($b) : gettype($b)));
|
||||||
}
|
}
|
||||||
$pk = new UpdateBlockPacket();
|
$pk = new UpdateBlockPacket();
|
||||||
|
|
||||||
@ -888,8 +888,8 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
foreach($blocks as $b){
|
foreach($blocks as $b){
|
||||||
if($b === null){
|
if(!($b instanceof Vector3)){
|
||||||
continue;
|
throw new \TypeError("Expected Vector3 in blocks array, got " . (is_object($b) ? get_class($b) : gettype($b)));
|
||||||
}
|
}
|
||||||
$pk = new UpdateBlockPacket();
|
$pk = new UpdateBlockPacket();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user