mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-08 04:38:35 +00:00
ItemSerializer: change exception type
This commit is contained in:
parent
3109a179db
commit
fdb724c646
@ -32,7 +32,6 @@ use pocketmine\item\CoralFan;
|
|||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\item\ItemBlock;
|
use pocketmine\item\ItemBlock;
|
||||||
use pocketmine\item\VanillaItems as Items;
|
use pocketmine\item\VanillaItems as Items;
|
||||||
use pocketmine\utils\AssumptionFailedError;
|
|
||||||
use function get_class;
|
use function get_class;
|
||||||
|
|
||||||
final class ItemSerializer{
|
final class ItemSerializer{
|
||||||
@ -79,7 +78,7 @@ final class ItemSerializer{
|
|||||||
public function mapBlock(Block $block, \Closure $serializer) : void{
|
public function mapBlock(Block $block, \Closure $serializer) : void{
|
||||||
$index = $block->getTypeId();
|
$index = $block->getTypeId();
|
||||||
if(isset($this->blockItemSerializers[$index])){
|
if(isset($this->blockItemSerializers[$index])){
|
||||||
throw new AssumptionFailedError("Registering the same blockitem twice!");
|
throw new \InvalidArgumentException("Block type ID " . $index . " already has a serializer registered");
|
||||||
}
|
}
|
||||||
$this->blockItemSerializers[$index] = $serializer;
|
$this->blockItemSerializers[$index] = $serializer;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user