ItemBlock: drop the charade about overriding built-in block types

this allows cleaning up a whole lot of abusable mess from the API, and we never properly supported overriding built-in block types anyway.
This commit is contained in:
Dylan K. Taylor
2023-03-02 15:50:18 +00:00
parent 33140482bb
commit f64dc01bd1
82 changed files with 94 additions and 149 deletions

View File

@ -62,16 +62,9 @@ class BlockTest extends TestCase{
* Test registering a new block which does not yet exist
*/
public function testRegisterNewBlock() : void{
for($i = BlockTypeIds::FIRST_UNUSED_BLOCK_ID; $i < BlockTypeIds::FIRST_UNUSED_BLOCK_ID + 256; ++$i){
if(!$this->blockFactory->isRegistered($i)){
$b = new StrangeNewBlock(new BlockIdentifier($i), "Strange New Block", new BlockTypeInfo(BlockBreakInfo::instant()));
$this->blockFactory->register($b);
self::assertInstanceOf(StrangeNewBlock::class, $this->blockFactory->fromStateId($b->getStateId()));
return;
}
}
throw new \RuntimeException("Can't test registering new blocks because no unused spaces left");
$b = new StrangeNewBlock(new BlockIdentifier(BlockTypeIds::newId()), "Strange New Block", new BlockTypeInfo(BlockBreakInfo::instant()));
$this->blockFactory->register($b);
self::assertInstanceOf(StrangeNewBlock::class, $this->blockFactory->fromStateId($b->getStateId()));
}
/**