mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Hacks for dealing with negative item IDs...
This commit is contained in:
@ -39,8 +39,15 @@ class ItemBlock extends Item{
|
||||
* @param int|null $itemId
|
||||
*/
|
||||
public function __construct(int $blockId, int $meta = 0, int $itemId = null){
|
||||
if($blockId < 0){ //extended blocks
|
||||
if($itemId === null){
|
||||
$itemId = $blockId;
|
||||
}
|
||||
$blockId = 255 - $blockId;
|
||||
}
|
||||
$this->blockId = $blockId;
|
||||
$this->setDamage($meta);
|
||||
|
||||
parent::__construct($itemId ?? $blockId, $meta, $this->getBlock()->getName());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user