mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +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;
|
||||
|
||||
public function __construct(BlockIdentifier $idInfo, string $name, BlockBreakInfo $breakInfo){
|
||||
$this->mushroomBlockType = MushroomBlockType::PORES();
|
||||
$this->mushroomBlockType = MushroomBlockType::ALL_CAP();
|
||||
parent::__construct($idInfo, $name, $breakInfo);
|
||||
}
|
||||
|
||||
@ -42,6 +42,11 @@ class RedMushroomBlock extends Opaque{
|
||||
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{
|
||||
$type = MushroomBlockTypeIdMap::getInstance()->fromId($stateMeta);
|
||||
if($type === null){
|
||||
|
Loading…
x
Reference in New Issue
Block a user