Implemented log stripping via axe right-click

This commit is contained in:
Dylan K. Taylor
2022-07-02 19:16:15 +01:00
parent 248eacd042
commit ff90c83d66
10 changed files with 112 additions and 191 deletions

View File

@ -33,6 +33,7 @@ use pocketmine\block\FloorCoralFan;
use pocketmine\block\FloorSign;
use pocketmine\block\GlazedTerracotta;
use pocketmine\block\Liquid;
use pocketmine\block\Log;
use pocketmine\block\RedMushroomBlock;
use pocketmine\block\RedstoneComparator;
use pocketmine\block\RedstoneRepeater;
@ -149,6 +150,13 @@ final class BlockStateDeserializerHelper{
return self::decodeLiquid($block, $in, true);
}
/** @throws BlockStateDeserializeException */
public static function decodeLog(Log $block, bool $stripped, BlockStateReader $in) : Log{
return $block
->setAxis($in->readPillarAxis())
->setStripped($stripped);
}
/** @throws BlockStateDeserializeException */
public static function decodeMushroomBlock(RedMushroomBlock $block, BlockStateReader $in) : Block{
switch($type = $in->readBoundedInt(BlockStateNames::HUGE_MUSHROOM_BITS, 0, 15)){