mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Fixed dodgy custom block registration test
This commit is contained in:
parent
c3a2199f0e
commit
1c626baf1a
@ -62,16 +62,9 @@ class BlockTest extends TestCase{
|
|||||||
* Test registering a new block which does not yet exist
|
* Test registering a new block which does not yet exist
|
||||||
*/
|
*/
|
||||||
public function testRegisterNewBlock() : void{
|
public function testRegisterNewBlock() : void{
|
||||||
for($i = BlockTypeIds::FIRST_UNUSED_BLOCK_ID; $i < BlockTypeIds::FIRST_UNUSED_BLOCK_ID + 256; ++$i){
|
$b = new StrangeNewBlock(new BlockIdentifier(BlockTypeIds::newId()), "Strange New Block", new BlockTypeInfo(BlockBreakInfo::instant()));
|
||||||
if(!$this->blockFactory->isRegistered($i)){
|
|
||||||
$b = new StrangeNewBlock(new BlockIdentifier($i), "Strange New Block", new BlockTypeInfo(BlockBreakInfo::instant()));
|
|
||||||
$this->blockFactory->register($b);
|
$this->blockFactory->register($b);
|
||||||
self::assertInstanceOf(StrangeNewBlock::class, $this->blockFactory->fromStateId($b->getStateId()));
|
self::assertInstanceOf(StrangeNewBlock::class, $this->blockFactory->fromStateId($b->getStateId()));
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new \RuntimeException("Can't test registering new blocks because no unused spaces left");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user