mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
Fixed ItemBlocks passing the wrong block name to their constructors
This commit is contained in:
parent
d92e79ba54
commit
7da51ae97e
@ -40,6 +40,7 @@ class ItemBlock extends Item{
|
|||||||
*/
|
*/
|
||||||
public function __construct(int $blockId, int $meta = 0, int $itemId = null){
|
public function __construct(int $blockId, int $meta = 0, int $itemId = null){
|
||||||
$this->blockId = $blockId;
|
$this->blockId = $blockId;
|
||||||
|
$this->setDamage($meta);
|
||||||
parent::__construct($itemId ?? $blockId, $meta, $this->getBlock()->getName());
|
parent::__construct($itemId ?? $blockId, $meta, $this->getBlock()->getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,10 +48,6 @@ class ItemBlock extends Item{
|
|||||||
return BlockFactory::get($this->blockId, $this->meta === -1 ? 0 : $this->meta & 0xf);
|
return BlockFactory::get($this->blockId, $this->meta === -1 ? 0 : $this->meta & 0xf);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getVanillaName() : string{
|
|
||||||
return $this->getBlock()->getName();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFuelTime() : int{
|
public function getFuelTime() : int{
|
||||||
return $this->getBlock()->getFuelTime();
|
return $this->getBlock()->getFuelTime();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user