mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-04 00:59:51 +00:00
Fixed mushroom block silk-touch drops and block picking behaviour
fixes #5284
This commit is contained in:
parent
b266f45152
commit
5f9e0081fd
@ -34,7 +34,7 @@ class RedMushroomBlock extends Opaque{
|
|||||||
protected MushroomBlockType $mushroomBlockType;
|
protected MushroomBlockType $mushroomBlockType;
|
||||||
|
|
||||||
public function __construct(BlockIdentifier $idInfo, string $name, BlockBreakInfo $breakInfo){
|
public function __construct(BlockIdentifier $idInfo, string $name, BlockBreakInfo $breakInfo){
|
||||||
$this->mushroomBlockType = MushroomBlockType::PORES();
|
$this->mushroomBlockType = MushroomBlockType::ALL_CAP();
|
||||||
parent::__construct($idInfo, $name, $breakInfo);
|
parent::__construct($idInfo, $name, $breakInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,6 +42,11 @@ class RedMushroomBlock extends Opaque{
|
|||||||
return MushroomBlockTypeIdMap::getInstance()->toId($this->mushroomBlockType);
|
return MushroomBlockTypeIdMap::getInstance()->toId($this->mushroomBlockType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function writeStateToItemMeta() : int{
|
||||||
|
//these blocks always drop as all-cap, but may exist in other forms in the inventory (particularly creative)
|
||||||
|
return BlockLegacyMetadata::MUSHROOM_BLOCK_ALL_CAP;
|
||||||
|
}
|
||||||
|
|
||||||
public function readStateFromData(int $id, int $stateMeta) : void{
|
public function readStateFromData(int $id, int $stateMeta) : void{
|
||||||
$type = MushroomBlockTypeIdMap::getInstance()->fromId($stateMeta);
|
$type = MushroomBlockTypeIdMap::getInstance()->fromId($stateMeta);
|
||||||
if($type === null){
|
if($type === null){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user