Skip to content

Commit

Permalink
Filter block groups to not include update blocks
Browse files Browse the repository at this point in the history
Signed-off-by: platz1de <[email protected]>
  • Loading branch information
platz1de committed Mar 5, 2024
1 parent 6b2638a commit 0f4a2a1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/platz1de/EasyEdit/convert/BlockTagManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,16 @@ public static function getTag(string $tag, bool $isMask): BlockGroup|MaskedBlock
if ($isMask) {
return new MaskedBlockGroup(self::$tags[$tag]);
}
return new BlockGroup(self::$tagStates[$tag]);
$group = [];
foreach (self::$tagStates[$tag] as $id) {
if ($id !== BlockParser::getInvalidBlockId()) {
$group[] = $id;
}
}
if ($group === []) {
throw new UnsupportedBlockStateException("No blocks available for tag $tag");
}
return new BlockGroup($group);
}

public static function loadResourceData(string $rawData): void
Expand Down

0 comments on commit 0f4a2a1

Please sign in to comment.