22declare(strict_types=1);
 
   24namespace pocketmine\data\bedrock\block\convert;
 
   49use pocketmine\block\utils\CopperOxidation;
 
   50use pocketmine\block\utils\SlabType;
 
   71            ->setFacing($in->readFacingDirection())
 
 
   85            ->setCount($in->readBoundedInt(StateNames::CANDLES, 0, 3) + 1)
 
   86            ->setLit($in->readBool(StateNames::LIT));
 
 
   97        return $block->setAge($in->readBoundedInt(
BlockStateNames::GROWTH, 0, 7));
 
 
  103            ->setFacing($in->readCardinalHorizontalFacing())
 
  105            ->setSubtractMode($in->readBool(
BlockStateNames::OUTPUT_SUBTRACT_BIT));
 
 
  116        $block->setOxidation($oxidation);
 
 
  129        $block->setOxidation($oxidation);
 
 
  137            ->setOutputSignalStrength($in->readBoundedInt(
BlockStateNames::REDSTONE_SIGNAL, 0, 15));
 
 
  153            ->setFacing(
Facing::rotateY($in->readCardinalHorizontalFacing(), clockwise: false))
 
 
  170            ->setFacing($in->readCardinalHorizontalFacing())
 
 
  190            ->setRotation($in->readBoundedInt(
BlockStateNames::GROUND_SIGN_DIRECTION, 0, 15));
 
 
  194        $in->todo(StateNames::ITEM_FRAME_PHOTO_BIT); 
 
  197            ->setHasMap($in->
readBool(StateNames::ITEM_FRAME_MAP_BIT));
 
  206            ->setNoDecay($in->readBool(StateNames::PERSISTENT_BIT))
 
  207            ->setCheckDecay($in->readBool(StateNames::UPDATE_BIT));
 
 
  212        $fluidHeightState = $in->readBoundedInt(
BlockStateNames::LIQUID_DEPTH, 0, 15);
 
  215            ->setFalling(($fluidHeightState & 0x8) !== 0)
 
 
  220        return self::decodeLiquid($block, $in, false);
 
  223    public static function decodeStillLiquid(Liquid $block, BlockStateReader $in) : Liquid{
 
  224        return self::decodeLiquid($block, $in, true);
 
  230            ->setAxis($in->readPillarAxis())
 
  231            ->setStripped($stripped);
 
 
  236        switch($type = $in->readBoundedInt(
BlockStateNames::HUGE_MUSHROOM_BITS, 0, 15)){
 
  237            case BlockLegacyMetadata::MUSHROOM_BLOCK_ALL_STEM:
 
  241                $type = MushroomBlockTypeIdMap::getInstance()->fromId($type);
 
 
  249            ->setFacing($in->readCardinalHorizontalFacing())
 
  250            ->setDelay($in->readBoundedInt(
BlockStateNames::REPEATER_DELAY, 0, 3) + 1);
 
 
  266        return $block->setPressed($in->readBoundedInt(
BlockStateNames::REDSTONE_SIGNAL, 0, 15) !== 0);
 
 
  277        return $block->setSlabType($in->readSlabPosition());
 
 
  288        $in->ignored(StateNames::MC_VERTICAL_HALF);
 
 
  303            ->setFacing($in->readWeirdoHorizontalFacing());
 
 
  311        $facing = $in->readFacingWithoutUp();
 
  312        return self::decodeCrops($block, $in)
 
  313            ->setFacing($facing === Facing::DOWN ? Facing::UP : $facing);
 
 
  326            ->setFacing($in->read5MinusHorizontalFacing())
 
 
  348            ->setFacing($in->readHorizontalFacing());
 
 
  357            ->setOutputSignalStrength($in->readBoundedInt(
BlockStateNames::REDSTONE_SIGNAL, 0, 15));
 
 
 
setMushroomBlockType(MushroomBlockType $mushroomBlockType)
 
setSlabType(SlabType $slabType)
 
setConnection(int $face, ?WallConnectionType $type)
 
static decodeRepeater(RedstoneRepeater $block, BlockStateReader $in)
 
static decodeCrops(Crops $block, BlockStateReader $in)
 
static decodeCopper(CopperMaterial $block, CopperOxidation $oxidation)
 
static decodeMushroomBlock(RedMushroomBlock $block, BlockStateReader $in)
 
static decodeDoublePlant(DoublePlant $block, BlockStateReader $in)
 
static decodeDoubleSlab(Slab $block, BlockStateReader $in)
 
static decodeWallSign(WallSign $block, BlockStateReader $in)
 
static decodeLiquid(Liquid $block, BlockStateReader $in, bool $still)
 
static decodeLeaves(Leaves $block, BlockStateReader $in)
 
static decodeStairs(Stair $block, BlockStateReader $in)
 
static decodeCandle(Candle $block, BlockStateReader $in)
 
static decodeWall(Wall $block, BlockStateReader $in)
 
static decodeTrapdoor(Trapdoor $block, BlockStateReader $in)
 
static decodeStem(Stem $block, BlockStateReader $in)
 
static decodeFenceGate(FenceGate $block, BlockStateReader $in)
 
static decodeFloorSign(FloorSign $block, BlockStateReader $in)
 
static decodeLog(Wood $block, bool $stripped, BlockStateReader $in)
 
static decodeSapling(Sapling $block, BlockStateReader $in)
 
static decodeDaylightSensor(DaylightSensor $block, BlockStateReader $in)
 
static decodeWaxedCopper(CopperMaterial $block, CopperOxidation $oxidation)
 
static decodeDoor(Door $block, BlockStateReader $in)
 
static decodeSingleSlab(Slab $block, BlockStateReader $in)
 
static decodeFloorCoralFan(FloorCoralFan $block, BlockStateReader $in)
 
static decodeSimplePressurePlate(SimplePressurePlate $block, BlockStateReader $in)
 
static decodeWeightedPressurePlate(WeightedPressurePlate $block, BlockStateReader $in)
 
static decodeComparator(RedstoneComparator $block, BlockStateReader $in)
 
static decodeButton(Button $block, BlockStateReader $in)
 
readWallConnectionType(string $name)