diff --git a/src/LevelChunkPacket.php b/src/LevelChunkPacket.php index 6c1dbc1a..d2824b41 100644 --- a/src/LevelChunkPacket.php +++ b/src/LevelChunkPacket.php @@ -16,6 +16,7 @@ use pocketmine\network\mcpe\protocol\serializer\PacketSerializer; use pocketmine\network\mcpe\protocol\types\ChunkPosition; +use pocketmine\network\mcpe\protocol\types\DimensionIds; use pocketmine\utils\Limits; use function count; use const PHP_INT_MAX; @@ -37,6 +38,8 @@ class LevelChunkPacket extends DataPacket implements ClientboundPacket{ private const MAX_BLOB_HASHES = 64; private ChunkPosition $chunkPosition; + /** @phpstan-var DimensionIds::* */ + private int $dimensionId; private int $subChunkCount; private bool $clientSubChunkRequestsEnabled; /** @var int[]|null */ @@ -46,10 +49,12 @@ class LevelChunkPacket extends DataPacket implements ClientboundPacket{ /** * @generate-create-func * @param int[] $usedBlobHashes + * @phpstan-param DimensionIds::* $dimensionId */ - public static function create(ChunkPosition $chunkPosition, int $subChunkCount, bool $clientSubChunkRequestsEnabled, ?array $usedBlobHashes, string $extraPayload) : self{ + public static function create(ChunkPosition $chunkPosition, int $dimensionId, int $subChunkCount, bool $clientSubChunkRequestsEnabled, ?array $usedBlobHashes, string $extraPayload) : self{ $result = new self; $result->chunkPosition = $chunkPosition; + $result->dimensionId = $dimensionId; $result->subChunkCount = $subChunkCount; $result->clientSubChunkRequestsEnabled = $clientSubChunkRequestsEnabled; $result->usedBlobHashes = $usedBlobHashes; @@ -59,6 +64,8 @@ public static function create(ChunkPosition $chunkPosition, int $subChunkCount, public function getChunkPosition() : ChunkPosition{ return $this->chunkPosition; } + public function getDimensionId() : int{ return $this->dimensionId; } + public function getSubChunkCount() : int{ return $this->subChunkCount; } @@ -84,6 +91,7 @@ public function getExtraPayload() : string{ protected function decodePayload(PacketSerializer $in) : void{ $this->chunkPosition = ChunkPosition::read($in); + $this->dimensionId = $in->getVarInt(); $subChunkCountButNotReally = $in->getUnsignedVarInt(); if($subChunkCountButNotReally === self::CLIENT_REQUEST_FULL_COLUMN_FAKE_COUNT){ @@ -113,6 +121,7 @@ protected function decodePayload(PacketSerializer $in) : void{ protected function encodePayload(PacketSerializer $out) : void{ $this->chunkPosition->write($out); + $out->putVarInt($this->dimensionId); if($this->clientSubChunkRequestsEnabled){ if($this->subChunkCount === PHP_INT_MAX){ diff --git a/src/PacketHandlerDefaultImplTrait.php b/src/PacketHandlerDefaultImplTrait.php index 65aaee74..d524eaee 100644 --- a/src/PacketHandlerDefaultImplTrait.php +++ b/src/PacketHandlerDefaultImplTrait.php @@ -82,6 +82,10 @@ public function handleAddItemActor(AddItemActorPacket $packet) : bool{ return false; } + public function handleServerPlayerPostMovePosition(ServerPlayerPostMovePositionPacket $packet) : bool{ + return false; + } + public function handleTakeItemActor(TakeItemActorPacket $packet) : bool{ return false; } @@ -498,14 +502,6 @@ public function handleLecternUpdate(LecternUpdatePacket $packet) : bool{ return false; } - public function handleAddEntity(AddEntityPacket $packet) : bool{ - return false; - } - - public function handleRemoveEntity(RemoveEntityPacket $packet) : bool{ - return false; - } - public function handleClientCacheStatus(ClientCacheStatusPacket $packet) : bool{ return false; } @@ -809,4 +805,8 @@ public function handlePlayerToggleCrafterSlotRequest(PlayerToggleCrafterSlotRequ public function handleSetPlayerInventoryOptions(SetPlayerInventoryOptionsPacket $packet) : bool{ return false; } + + public function handleSetHud(SetHudPacket $packet) : bool{ + return false; + } } diff --git a/src/PacketHandlerInterface.php b/src/PacketHandlerInterface.php index cb862b5a..8818d3c6 100644 --- a/src/PacketHandlerInterface.php +++ b/src/PacketHandlerInterface.php @@ -48,6 +48,8 @@ public function handleRemoveActor(RemoveActorPacket $packet) : bool; public function handleAddItemActor(AddItemActorPacket $packet) : bool; + public function handleServerPlayerPostMovePosition(ServerPlayerPostMovePositionPacket $packet) : bool; + public function handleTakeItemActor(TakeItemActorPacket $packet) : bool; public function handleMoveActorAbsolute(MoveActorAbsolutePacket $packet) : bool; @@ -256,10 +258,6 @@ public function handleLevelEventGeneric(LevelEventGenericPacket $packet) : bool; public function handleLecternUpdate(LecternUpdatePacket $packet) : bool; - public function handleAddEntity(AddEntityPacket $packet) : bool; - - public function handleRemoveEntity(RemoveEntityPacket $packet) : bool; - public function handleClientCacheStatus(ClientCacheStatusPacket $packet) : bool; public function handleOnScreenTextureAnimation(OnScreenTextureAnimationPacket $packet) : bool; @@ -411,4 +409,6 @@ public function handleRefreshEntitlements(RefreshEntitlementsPacket $packet) : b public function handlePlayerToggleCrafterSlotRequest(PlayerToggleCrafterSlotRequestPacket $packet) : bool; public function handleSetPlayerInventoryOptions(SetPlayerInventoryOptionsPacket $packet) : bool; + + public function handleSetHud(SetHudPacket $packet) : bool; } diff --git a/src/PacketPool.php b/src/PacketPool.php index 0cc082e5..06e491f0 100644 --- a/src/PacketPool.php +++ b/src/PacketPool.php @@ -48,6 +48,7 @@ public function __construct(){ $this->registerPacket(new AddActorPacket()); $this->registerPacket(new RemoveActorPacket()); $this->registerPacket(new AddItemActorPacket()); + $this->registerPacket(new ServerPlayerPostMovePositionPacket()); $this->registerPacket(new TakeItemActorPacket()); $this->registerPacket(new MoveActorAbsolutePacket()); $this->registerPacket(new MovePlayerPacket()); @@ -152,8 +153,6 @@ public function __construct(){ $this->registerPacket(new LevelSoundEventPacket()); $this->registerPacket(new LevelEventGenericPacket()); $this->registerPacket(new LecternUpdatePacket()); - $this->registerPacket(new AddEntityPacket()); - $this->registerPacket(new RemoveEntityPacket()); $this->registerPacket(new ClientCacheStatusPacket()); $this->registerPacket(new OnScreenTextureAnimationPacket()); $this->registerPacket(new MapCreateLockedCopyPacket()); @@ -230,6 +229,7 @@ public function __construct(){ $this->registerPacket(new RefreshEntitlementsPacket()); $this->registerPacket(new PlayerToggleCrafterSlotRequestPacket()); $this->registerPacket(new SetPlayerInventoryOptionsPacket()); + $this->registerPacket(new SetHudPacket()); } public function registerPacket(Packet $packet) : void{ diff --git a/src/PlayerAuthInputPacket.php b/src/PlayerAuthInputPacket.php index e01cad50..91969443 100644 --- a/src/PlayerAuthInputPacket.php +++ b/src/PlayerAuthInputPacket.php @@ -49,6 +49,7 @@ class PlayerAuthInputPacket extends DataPacket implements ServerboundPacket{ private ?ItemStackRequest $itemStackRequest = null; /** @var PlayerBlockAction[]|null */ private ?array $blockActions = null; + private ?int $clientPredictedVehicleActorUniqueId = null; private float $analogMoveVecX; private float $analogMoveVecZ; @@ -77,6 +78,7 @@ public static function create( ?ItemInteractionData $itemInteractionData, ?ItemStackRequest $itemStackRequest, ?array $blockActions, + ?int $clientPredictedVehicleActorUniqueId, float $analogMoveVecX, float $analogMoveVecZ ) : self{ @@ -102,6 +104,9 @@ public static function create( if($blockActions !== null){ $result->inputFlags |= 1 << PlayerAuthInputFlags::PERFORM_BLOCK_ACTIONS; } + if($clientPredictedVehicleActorUniqueId !== null){ + $result->inputFlags |= 1 << PlayerAuthInputFlags::IN_CLIENT_PREDICTED_VEHICLE; + } $result->inputMode = $inputMode; $result->playMode = $playMode; @@ -114,6 +119,7 @@ public static function create( $result->itemInteractionData = $itemInteractionData; $result->itemStackRequest = $itemStackRequest; $result->blockActions = $blockActions; + $result->clientPredictedVehicleActorUniqueId = $clientPredictedVehicleActorUniqueId; $result->analogMoveVecX = $analogMoveVecX; $result->analogMoveVecZ = $analogMoveVecZ; return $result; @@ -198,6 +204,8 @@ public function getBlockActions() : ?array{ return $this->blockActions; } + public function getClientPredictedVehicleActorUniqueId() : ?int{ return $this->clientPredictedVehicleActorUniqueId; } + public function getAnalogMoveVecX() : float{ return $this->analogMoveVecX; } public function getAnalogMoveVecZ() : float{ return $this->analogMoveVecZ; } @@ -240,6 +248,9 @@ protected function decodePayload(PacketSerializer $in) : void{ }; } } + if($this->hasFlag(PlayerAuthInputFlags::IN_CLIENT_PREDICTED_VEHICLE)){ + $this->clientPredictedVehicleActorUniqueId = $in->getActorUniqueId(); + } $this->analogMoveVecX = $in->getLFloat(); $this->analogMoveVecZ = $in->getLFloat(); } @@ -274,6 +285,9 @@ protected function encodePayload(PacketSerializer $out) : void{ $blockAction->write($out); } } + if($this->clientPredictedVehicleActorUniqueId !== null){ + $out->putActorUniqueId($this->clientPredictedVehicleActorUniqueId); + } $out->putLFloat($this->analogMoveVecX); $out->putLFloat($this->analogMoveVecZ); } diff --git a/src/PlayerListPacket.php b/src/PlayerListPacket.php index 4512e1ad..b622aa7e 100644 --- a/src/PlayerListPacket.php +++ b/src/PlayerListPacket.php @@ -69,6 +69,7 @@ protected function decodePayload(PacketSerializer $in) : void{ $entry->skinData = $in->getSkin(); $entry->isTeacher = $in->getBool(); $entry->isHost = $in->getBool(); + $entry->isSubClient = $in->getBool(); }else{ $entry->uuid = $in->getUUID(); } @@ -96,6 +97,7 @@ protected function encodePayload(PacketSerializer $out) : void{ $out->putSkin($entry->skinData); $out->putBool($entry->isTeacher); $out->putBool($entry->isHost); + $out->putBool($entry->isSubClient); }else{ $out->putUUID($entry->uuid); } diff --git a/src/ProtocolInfo.php b/src/ProtocolInfo.php index a62d1bfc..a622420e 100644 --- a/src/ProtocolInfo.php +++ b/src/ProtocolInfo.php @@ -32,11 +32,11 @@ private function __construct(){ */ /** Actual Minecraft: PE protocol version */ - public const CURRENT_PROTOCOL = 630; + public const CURRENT_PROTOCOL = 649; /** Current Minecraft PE version reported by the server. This is usually the earliest currently supported version. */ - public const MINECRAFT_VERSION = 'v1.20.50'; + public const MINECRAFT_VERSION = 'v1.20.60'; /** Version number sent to clients in ping responses. */ - public const MINECRAFT_VERSION_NETWORK = '1.20.50'; + public const MINECRAFT_VERSION_NETWORK = '1.20.60'; public const LOGIN_PACKET = 0x01; public const PLAY_STATUS_PACKET = 0x02; @@ -53,7 +53,7 @@ private function __construct(){ public const ADD_ACTOR_PACKET = 0x0d; public const REMOVE_ACTOR_PACKET = 0x0e; public const ADD_ITEM_ACTOR_PACKET = 0x0f; - + public const SERVER_PLAYER_POST_MOVE_POSITION_PACKET = 0x10; public const TAKE_ITEM_ACTOR_PACKET = 0x11; public const MOVE_ACTOR_ABSOLUTE_PACKET = 0x12; public const MOVE_PLAYER_PACKET = 0x13; @@ -163,8 +163,6 @@ private function __construct(){ public const LEVEL_EVENT_GENERIC_PACKET = 0x7c; public const LECTERN_UPDATE_PACKET = 0x7d; - public const ADD_ENTITY_PACKET = 0x7f; - public const REMOVE_ENTITY_PACKET = 0x80; public const CLIENT_CACHE_STATUS_PACKET = 0x81; public const ON_SCREEN_TEXTURE_ANIMATION_PACKET = 0x82; public const MAP_CREATE_LOCKED_COPY_PACKET = 0x83; @@ -245,5 +243,6 @@ private function __construct(){ public const REFRESH_ENTITLEMENTS_PACKET = 0x131; public const PLAYER_TOGGLE_CRAFTER_SLOT_REQUEST_PACKET = 0x132; public const SET_PLAYER_INVENTORY_OPTIONS_PACKET = 0x133; + public const SET_HUD_PACKET = 0x134; } diff --git a/src/RemoveEntityPacket.php b/src/RemoveEntityPacket.php deleted file mode 100644 index 184ba473..00000000 --- a/src/RemoveEntityPacket.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * BedrockProtocol is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - */ - -declare(strict_types=1); - -namespace pocketmine\network\mcpe\protocol; - -use pocketmine\network\mcpe\protocol\serializer\PacketSerializer; - -class RemoveEntityPacket extends DataPacket implements ClientboundPacket{ - public const NETWORK_ID = ProtocolInfo::REMOVE_ENTITY_PACKET; - - private int $entityNetId; - - /** - * @generate-create-func - */ - public static function create(int $entityNetId) : self{ - $result = new self; - $result->entityNetId = $entityNetId; - return $result; - } - - public function getEntityNetId() : int{ - return $this->entityNetId; - } - - protected function decodePayload(PacketSerializer $in) : void{ - $this->entityNetId = $in->getUnsignedVarInt(); - } - - protected function encodePayload(PacketSerializer $out) : void{ - $out->putUnsignedVarInt($this->entityNetId); - } - - public function handle(PacketHandlerInterface $handler) : bool{ - return $handler->handleRemoveEntity($this); - } -} diff --git a/src/AddEntityPacket.php b/src/ServerPlayerPostMovePositionPacket.php similarity index 61% rename from src/AddEntityPacket.php rename to src/ServerPlayerPostMovePositionPacket.php index c48635b3..103e6c6f 100644 --- a/src/AddEntityPacket.php +++ b/src/ServerPlayerPostMovePositionPacket.php @@ -14,35 +14,34 @@ namespace pocketmine\network\mcpe\protocol; +use pocketmine\math\Vector3; use pocketmine\network\mcpe\protocol\serializer\PacketSerializer; -class AddEntityPacket extends DataPacket implements ClientboundPacket{ - public const NETWORK_ID = ProtocolInfo::ADD_ENTITY_PACKET; +class ServerPlayerPostMovePositionPacket extends DataPacket implements ClientboundPacket{ + public const NETWORK_ID = ProtocolInfo::SERVER_PLAYER_POST_MOVE_POSITION_PACKET; - private int $entityNetId; + private Vector3 $position; /** * @generate-create-func */ - public static function create(int $entityNetId) : self{ + public static function create(Vector3 $position) : self{ $result = new self; - $result->entityNetId = $entityNetId; + $result->position = $position; return $result; } - public function getEntityNetId() : int{ - return $this->entityNetId; - } + public function getPosition() : Vector3{ return $this->position; } protected function decodePayload(PacketSerializer $in) : void{ - $this->entityNetId = $in->getUnsignedVarInt(); + $this->position = $in->getVector3(); } protected function encodePayload(PacketSerializer $out) : void{ - $out->putUnsignedVarInt($this->entityNetId); + $out->putVector3($this->position); } public function handle(PacketHandlerInterface $handler) : bool{ - return $handler->handleAddEntity($this); + return $handler->handleServerPlayerPostMovePosition($this); } } diff --git a/src/SetHudPacket.php b/src/SetHudPacket.php new file mode 100644 index 00000000..3fa78f66 --- /dev/null +++ b/src/SetHudPacket.php @@ -0,0 +1,64 @@ + + * + * BedrockProtocol is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + */ + +declare(strict_types=1); + +namespace pocketmine\network\mcpe\protocol; + +use pocketmine\network\mcpe\protocol\serializer\PacketSerializer; +use pocketmine\network\mcpe\protocol\types\hud\HudElement; +use pocketmine\network\mcpe\protocol\types\hud\HudVisibility; +use function count; + +class SetHudPacket extends DataPacket implements ClientboundPacket{ + public const NETWORK_ID = ProtocolInfo::SET_HUD_PACKET; + + /** @var HudElement[] */ + private array $hudElements = []; + private HudVisibility $visibility; + + /** + * @generate-create-func + * @param HudElement[] $hudElements + */ + public static function create(array $hudElements, HudVisibility $visibility) : self{ + $result = new self; + $result->hudElements = $hudElements; + $result->visibility = $visibility; + return $result; + } + + /** @return HudElement[] */ + public function getHudElements() : array{ return $this->hudElements; } + + public function getVisibility() : HudVisibility{ return $this->visibility; } + + protected function decodePayload(PacketSerializer $in) : void{ + $this->hudElements = []; + for($i = 0, $count = $in->getUnsignedVarInt(); $i < $count; ++$i){ + $this->hudElements[] = HudElement::fromPacket($in->getByte()); + } + $this->visibility = HudVisibility::fromPacket($in->getByte()); + } + + protected function encodePayload(PacketSerializer $out) : void{ + $out->putUnsignedVarInt(count($this->hudElements)); + foreach($this->hudElements as $element){ + $out->putByte($element->value); + } + $out->putByte($this->visibility->value); + } + + public function handle(PacketHandlerInterface $handler) : bool{ + return $handler->handleSetHud($this); + } +} diff --git a/src/types/CompressionAlgorithm.php b/src/types/CompressionAlgorithm.php index 08a02deb..55a1655a 100644 --- a/src/types/CompressionAlgorithm.php +++ b/src/types/CompressionAlgorithm.php @@ -25,4 +25,6 @@ private function __construct(){ public const ZLIB = 0; public const SNAPPY = 1; + + public const NONE = 255; } diff --git a/src/types/LevelEvent.php b/src/types/LevelEvent.php index d98e6982..023c57d6 100644 --- a/src/types/LevelEvent.php +++ b/src/types/LevelEvent.php @@ -138,6 +138,10 @@ private function __construct(){ public const PARTICLE_PUNCH_BLOCK_WEST = 3607; public const PARTICLE_PUNCH_BLOCK_EAST = 3608; public const PARTICLE_SHOOT_WHITE_SMOKE = 3609; + public const PARTICLE_WIND_EXPLOSION = 3610; + public const PARTICLE_TRIAL_SPAWNER_DETECTION = 3611; + public const PARTICLE_TRIAL_SPAWNER_SPAWNING = 3612; + public const PARTICLE_TRIAL_SPAWNER_EJECTING = 3613; public const SET_DATA = 4000; diff --git a/src/types/ParticleIds.php b/src/types/ParticleIds.php index 1e272813..5eb6a6df 100644 --- a/src/types/ParticleIds.php +++ b/src/types/ParticleIds.php @@ -36,75 +36,76 @@ private function __construct(){ public const SNOWBALL_POOF = 15; public const HUGE_EXPLODE = 16; public const HUGE_EXPLODE_SEED = 17; - public const MOB_FLAME = 18; - public const HEART = 19; - public const TERRAIN = 20; - public const SUSPENDED_TOWN = 21, TOWN_AURA = 21; - public const PORTAL = 22; - //23 same as 22 - public const SPLASH = 24, WATER_SPLASH = 24; - public const WATER_SPLASH_MANUAL = 25; - public const WATER_WAKE = 26; - public const DRIP_WATER = 27; - public const DRIP_LAVA = 28; - public const DRIP_HONEY = 29; - public const STALACTITE_DRIP_WATER = 30; - public const STALACTITE_DRIP_LAVA = 31; - public const FALLING_DUST = 32, DUST = 32; - public const MOB_SPELL = 33; - public const MOB_SPELL_AMBIENT = 34; - public const MOB_SPELL_INSTANTANEOUS = 35; - public const INK = 36; - public const SLIME = 37; - public const RAIN_SPLASH = 38; - public const VILLAGER_ANGRY = 39; - public const VILLAGER_HAPPY = 40; - public const ENCHANTMENT_TABLE = 41; - public const TRACKING_EMITTER = 42; - public const NOTE = 43; - public const WITCH_SPELL = 44; - public const CARROT = 45; - public const MOB_APPEARANCE = 46; - public const END_ROD = 47; - public const DRAGONS_BREATH = 48; - public const SPIT = 49; - public const TOTEM = 50; - public const FOOD = 51; - public const FIREWORKS_STARTER = 52; - public const FIREWORKS_SPARK = 53; - public const FIREWORKS_OVERLAY = 54; - public const BALLOON_GAS = 55; - public const COLORED_FLAME = 56; - public const SPARKLER = 57; - public const CONDUIT = 58; - public const BUBBLE_COLUMN_UP = 59; - public const BUBBLE_COLUMN_DOWN = 60; - public const SNEEZE = 61; - public const SHULKER_BULLET = 62; - public const BLEACH = 63; - public const DRAGON_DESTROY_BLOCK = 64; - public const MYCELIUM_DUST = 65; - public const FALLING_RED_DUST = 66; - public const CAMPFIRE_SMOKE = 67; - public const TALL_CAMPFIRE_SMOKE = 68; - public const DRAGON_BREATH_FIRE = 69; - public const DRAGON_BREATH_TRAIL = 70; - public const BLUE_FLAME = 71; - public const SOUL = 72; - public const OBSIDIAN_TEAR = 73; - public const PORTAL_REVERSE = 74; - public const SNOWFLAKE = 75; - public const VIBRATION_SIGNAL = 76; - public const SCULK_SENSOR_REDSTONE = 77; - public const SPORE_BLOSSOM_SHOWER = 78; - public const SPORE_BLOSSOM_AMBIENT = 79; - public const WAX = 80; - public const ELECTRIC_SPARK = 81; - public const SHRIEK = 82; - public const SCULK_SOUL = 83; - public const SONIC_EXPLOSION = 84; - public const BRUSH_DUST = 85; - public const CHERRY_LEAVES = 86; - public const DUST_PLUME = 87; - public const WHITE_SMOKE = 88; + public const WIND_EXPLOSION = 18; + public const MOB_FLAME = 19; + public const HEART = 20; + public const TERRAIN = 21; + public const SUSPENDED_TOWN = 22, TOWN_AURA = 22; + public const PORTAL = 23; + //24 same as 23 + public const SPLASH = 25, WATER_SPLASH = 25; + public const WATER_SPLASH_MANUAL = 26; + public const WATER_WAKE = 27; + public const DRIP_WATER = 28; + public const DRIP_LAVA = 29; + public const DRIP_HONEY = 30; + public const STALACTITE_DRIP_WATER = 31; + public const STALACTITE_DRIP_LAVA = 32; + public const FALLING_DUST = 33, DUST = 33; + public const MOB_SPELL = 34; + public const MOB_SPELL_AMBIENT = 35; + public const MOB_SPELL_INSTANTANEOUS = 36; + public const INK = 37; + public const SLIME = 38; + public const RAIN_SPLASH = 39; + public const VILLAGER_ANGRY = 40; + public const VILLAGER_HAPPY = 41; + public const ENCHANTMENT_TABLE = 42; + public const TRACKING_EMITTER = 43; + public const NOTE = 44; + public const WITCH_SPELL = 45; + public const CARROT = 46; + public const MOB_APPEARANCE = 47; + public const END_ROD = 48; + public const DRAGONS_BREATH = 49; + public const SPIT = 50; + public const TOTEM = 51; + public const FOOD = 52; + public const FIREWORKS_STARTER = 53; + public const FIREWORKS_SPARK = 54; + public const FIREWORKS_OVERLAY = 55; + public const BALLOON_GAS = 56; + public const COLORED_FLAME = 57; + public const SPARKLER = 58; + public const CONDUIT = 59; + public const BUBBLE_COLUMN_UP = 60; + public const BUBBLE_COLUMN_DOWN = 61; + public const SNEEZE = 62; + public const SHULKER_BULLET = 63; + public const BLEACH = 64; + public const DRAGON_DESTROY_BLOCK = 65; + public const MYCELIUM_DUST = 66; + public const FALLING_RED_DUST = 67; + public const CAMPFIRE_SMOKE = 68; + public const TALL_CAMPFIRE_SMOKE = 69; + public const DRAGON_BREATH_FIRE = 70; + public const DRAGON_BREATH_TRAIL = 71; + public const BLUE_FLAME = 72; + public const SOUL = 73; + public const OBSIDIAN_TEAR = 74; + public const PORTAL_REVERSE = 75; + public const SNOWFLAKE = 76; + public const VIBRATION_SIGNAL = 77; + public const SCULK_SENSOR_REDSTONE = 78; + public const SPORE_BLOSSOM_SHOWER = 79; + public const SPORE_BLOSSOM_AMBIENT = 80; + public const WAX = 81; + public const ELECTRIC_SPARK = 82; + public const SHRIEK = 83; + public const SCULK_SOUL = 84; + public const SONIC_EXPLOSION = 85; + public const BRUSH_DUST = 86; + public const CHERRY_LEAVES = 87; + public const DUST_PLUME = 88; + public const WHITE_SMOKE = 89; } diff --git a/src/types/PlayerAuthInputFlags.php b/src/types/PlayerAuthInputFlags.php index b7fc2dd7..7c46aee6 100644 --- a/src/types/PlayerAuthInputFlags.php +++ b/src/types/PlayerAuthInputFlags.php @@ -98,5 +98,6 @@ final class PlayerAuthInputFlags{ public const START_FLYING = 42; public const STOP_FLYING = 43; public const ACK_ACTOR_DATA = 44; + public const IN_CLIENT_PREDICTED_VEHICLE = 45; } diff --git a/src/types/PlayerListEntry.php b/src/types/PlayerListEntry.php index b697327c..18070db9 100644 --- a/src/types/PlayerListEntry.php +++ b/src/types/PlayerListEntry.php @@ -28,6 +28,7 @@ class PlayerListEntry{ public int $buildPlatform = DeviceOS::UNKNOWN; public bool $isTeacher = false; public bool $isHost = false; + public bool $isSubClient = false; public static function createRemovalEntry(UuidInterface $uuid) : PlayerListEntry{ $entry = new PlayerListEntry(); @@ -36,7 +37,18 @@ public static function createRemovalEntry(UuidInterface $uuid) : PlayerListEntry return $entry; } - public static function createAdditionEntry(UuidInterface $uuid, int $actorUniqueId, string $username, SkinData $skinData, string $xboxUserId = "", string $platformChatId = "", int $buildPlatform = -1, bool $isTeacher = false, bool $isHost = false) : PlayerListEntry{ + public static function createAdditionEntry( + UuidInterface $uuid, + int $actorUniqueId, + string $username, + SkinData $skinData, + string $xboxUserId = "", + string $platformChatId = "", + int $buildPlatform = -1, + bool $isTeacher = false, + bool $isHost = false, + bool $isSubClient = false + ) : PlayerListEntry{ $entry = new PlayerListEntry(); $entry->uuid = $uuid; $entry->actorUniqueId = $actorUniqueId; @@ -47,6 +59,7 @@ public static function createAdditionEntry(UuidInterface $uuid, int $actorUnique $entry->buildPlatform = $buildPlatform; $entry->isTeacher = $isTeacher; $entry->isHost = $isHost; + $entry->isSubClient = $isSubClient; return $entry; } diff --git a/src/types/hud/HudElement.php b/src/types/hud/HudElement.php new file mode 100644 index 00000000..3a25af83 --- /dev/null +++ b/src/types/hud/HudElement.php @@ -0,0 +1,33 @@ + + * + * BedrockProtocol is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + */ + +declare(strict_types=1); + +namespace pocketmine\network\mcpe\protocol\types\hud; + +use pocketmine\network\mcpe\protocol\types\PacketIntEnumTrait; + +enum HudElement : int{ + use PacketIntEnumTrait; + + case PAPER_DOLL = 0; + case ARMOR = 1; + case TOOLTIPS = 2; + case TOUCH_CONTROLS = 3; + case CROSSHAIR = 4; + case HOTBAR = 5; + case HEALTH = 6; + case XP = 7; + case FOOD = 8; + case AIR_BUBBLES = 9; + case HORSE_HEALTH = 10; +} diff --git a/src/types/hud/HudVisibility.php b/src/types/hud/HudVisibility.php new file mode 100644 index 00000000..b7f946c4 --- /dev/null +++ b/src/types/hud/HudVisibility.php @@ -0,0 +1,24 @@ + + * + * BedrockProtocol is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + */ + +declare(strict_types=1); + +namespace pocketmine\network\mcpe\protocol\types\hud; + +use pocketmine\network\mcpe\protocol\types\PacketIntEnumTrait; + +enum HudVisibility : int{ + use PacketIntEnumTrait; + + case HIDE = 0; + case RESET = 1; +}