mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 04:17:48 +00:00
Level: stricten type checks on sendBlocks()
because people are morons
This commit is contained in:
parent
b04319a4ab
commit
17eef9f902
@ -856,8 +856,8 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
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