mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
ItemTypeIds::toBlockTypeId() now returns null for non-blockitem IDs
closes #5648
This commit is contained in:
parent
7e1467f3f7
commit
dbcd2b1e65
@ -320,9 +320,9 @@ final class ItemTypeIds{
|
||||
return -$blockTypeId;
|
||||
}
|
||||
|
||||
public static function toBlockTypeId(int $itemTypeId) : int{
|
||||
if($itemTypeId > 0){
|
||||
throw new \InvalidArgumentException("Item type ID $itemTypeId does not represent a block");
|
||||
public static function toBlockTypeId(int $itemTypeId) : ?int{
|
||||
if($itemTypeId > 0){ //not a blockitem
|
||||
return null;
|
||||
}
|
||||
return -$itemTypeId;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user