Added glowing item frames

This commit is contained in:
Dylan K. Taylor
2022-07-14 16:24:20 +01:00
parent 0c7370e564
commit 323d31005f
8 changed files with 44 additions and 15 deletions

View File

@ -36,6 +36,7 @@ use pocketmine\block\FenceGate;
use pocketmine\block\FloorCoralFan;
use pocketmine\block\FloorSign;
use pocketmine\block\GlazedTerracotta;
use pocketmine\block\ItemFrame;
use pocketmine\block\Liquid;
use pocketmine\block\RedMushroomBlock;
use pocketmine\block\RedstoneComparator;
@ -48,6 +49,7 @@ use pocketmine\block\Trapdoor;
use pocketmine\block\utils\CopperOxidation;
use pocketmine\block\utils\DyeColor;
use pocketmine\block\VanillaBlocks;
use pocketmine\block\VanillaBlocks as Blocks;
use pocketmine\block\Wall;
use pocketmine\block\WallCoralFan;
use pocketmine\block\WallSign;
@ -170,6 +172,14 @@ final class BlockStateDeserializerHelper{
->setFacing($in->readHorizontalFacing());
}
public static function decodeItemFrame(BlockStateReader $in, bool $glowing) : ItemFrame{
$in->todo(StateNames::ITEM_FRAME_PHOTO_BIT); //TODO: not sure what the point of this is
return Blocks::ITEM_FRAME()
->setFacing($in->readFacingDirection())
->setHasMap($in->readBool(StateNames::ITEM_FRAME_MAP_BIT))
->setGlowing($glowing);
}
/** @throws BlockStateDeserializeException */
public static function decodeLiquid(Liquid $block, BlockStateReader $in, bool $still) : Liquid{
$fluidHeightState = $in->readBoundedInt(BlockStateNames::LIQUID_DEPTH, 0, 15);