BlockFactory: fix failing test

This commit is contained in:
Dylan K. Taylor 2018-10-12 21:40:45 +01:00
parent 7af7783cc8
commit f671da99a6

View File

@ -464,6 +464,9 @@ class BlockFactory{
throw new \InvalidArgumentException("Block variant collides with state bitmask"); throw new \InvalidArgumentException("Block variant collides with state bitmask");
} }
if(!$override and self::isRegistered($id, $variant)){
throw new \InvalidArgumentException("Block registration conflicts with an existing block");
}
self::fillStaticArrays(($id << 4) | $variant, $block); //register default state mapped to variant, for blocks which don't use 0 as valid state self::fillStaticArrays(($id << 4) | $variant, $block); //register default state mapped to variant, for blocks which don't use 0 as valid state
for($m = $variant + 1; $m <= ($variant | $stateMask); ++$m){ for($m = $variant + 1; $m <= ($variant | $stateMask); ++$m){