Skip to content

Commit

Permalink
Remove array index key check... It should never happen.
Browse files Browse the repository at this point in the history
  • Loading branch information
matcracker committed Jun 11, 2020
1 parent 3b23ea0 commit dd1bcdf
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/matcracker/BedcoreProtect/listeners/BlockListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,8 @@ static function (Block $block): bool {
function (array &$oldBlocks) use ($level, $sides) : array {
$newBlocks = [];
foreach ($sides as $key => $side) {
/** @var Block $updSide */
$updSide = $level->getBlock($side->asVector3());
if ($updSide instanceof $side) {
if (!array_key_exists($key, $oldBlocks)) {
throw new InvalidStateException("Key {$key} is missing.");
}
unset($oldBlocks[$key]);
} else {
$newBlocks[$key] = SerializableBlock::serialize($updSide);
Expand Down

0 comments on commit dd1bcdf

Please sign in to comment.