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

@ -151,18 +151,6 @@ class RuntimeBlockStateRegistry{
}
}
/**
* @internal
* Returns the default state of the block type associated with the given type ID.
*/
public function fromTypeId(int $typeId) : Block{
if(isset($this->typeIndex[$typeId])){
return clone $this->typeIndex[$typeId];
}
throw new \InvalidArgumentException("Block ID $typeId is not registered");
}
public function fromStateId(int $stateId) : Block{
if($stateId < 0){
throw new \InvalidArgumentException("Block state ID cannot be negative");
@ -178,22 +166,6 @@ class RuntimeBlockStateRegistry{
return $block;
}
/**
* Returns whether a specified block state is already registered in the block factory.
*/
public function isRegistered(int $typeId) : bool{
$b = $this->typeIndex[$typeId] ?? null;
return $b !== null && !($b instanceof UnknownBlock);
}
/**
* @return Block[]
* @phpstan-return array<int, Block>
*/
public function getAllKnownTypes() : array{
return $this->typeIndex;
}
/**
* @return Block[]
*/