BedrockProtocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

LGPL-3.0 License

Downloads
288.2K
Stars
123
Committers
28

Bot releases are hidden (Show)

BedrockProtocol - 7.1.0 for Minecraft Bedrock 1.18.0

Published by dktapps almost 3 years ago

Changes since 7.0.0

  • Fixed incorrect decoding of block positions in block actions in PlayerAuthInputPacket.
  • Added some missing ActorEvent constants.
  • Added some missing LevelSoundEvent constants.
  • Added some missing EntityMetadataFlags constants.
BedrockProtocol - 7.0.0 for Minecraft Bedrock 1.18.0

Published by dktapps almost 3 years ago

Changes since 6.0.0

  • Added protocol changes for Bedrock 1.18.0.
  • Removed static method EntityMetadataProperty::id() (use EntityMetadataProperty->getTypeId() or WhateverClassMetadataProperty::ID instead).
  • GameRule->getType() has been renamed to GameRule->getTypeId().
  • ItemStackRequestAction::getTypeId() is no longer static.
  • Each GameRule subclass now declares an ID constant.
  • Each TransactionData subclass now declares an ID constant.
  • Each ItemStackRequestAction subclass now declares an ID constant.
  • Each EntityMetadataProperty subclass now declares an ID constant.
BedrockProtocol - 6.0.0 for Minecraft Bedrock 1.17.40

Published by dktapps almost 3 years ago

Changes since 5.x

BC-breaking changes

  • Added missing responseType field to StructureTemplateDataResponsePacket.
  • Updated type constants of StructureTemplateDataRequestPacket.
  • Added missing fields of StructureSettings: animationMode, animationSeconds.

Bug fixes

  • Fixed incorrect field type encoding of StructureSettings (incorrectly used big-endian instead of little-endian).

Other changes

  • Preprocessor #include directives have been removed.
  • Updated to PHPStan 1.2.0.
  • Published script tools/generate-create-static-methods.php, used to generate ::create() methods in packet classes.
BedrockProtocol - 5.1.3 for Minecraft Bedrock 1.17.40

Published by dktapps almost 3 years ago

Changes since 5.1.2

  • Fixed encoding of PlayerAuthInputPacket.
BedrockProtocol - 5.1.2 for Minecraft Bedrock 1.17.40

Published by dktapps almost 3 years ago

Changes since 5.1.0

  • Fixed DisconnectPacket not showing disconnection screen messages.
BedrockProtocol - 5.1.0 for Minecraft Bedrock 1.17.40

Published by dktapps almost 3 years ago

Changes since 5.0.x

  • Implemented missing changes in PlayerAuthInputPacket.
  • Fixed integer underflow for Y coordinate in BlockPosition - the protocol still uses an unsigned varint, but the game sends signed integers (negative Y).
BedrockProtocol - 5.0.0 for Minecraft Bedrock 1.17.40

Published by dktapps almost 3 years ago

Changes since 4.0.x

Additions

  • Added ClientboundMapItemDataPacket::BITFLAG_MAP_CREATION.
  • Almost all packets now have a ::create() static method. This should be preferred over the old way of new WhateverPacket and then assigning fields, since it ensures you can't accidentally forget to assign a field.

API changes

  • UnknownPacket is removed. Unknown packets are now signified by null returned from PacketBatch->getPackets().
  • Replaced integer x/y/z block position fields with BlockPosition structure.
  • CacheableNbt is now used everywhere CompoundTags were used (except ItemStack, because those use a different encoding ...)
  • All ActorEventPacket action constants have been moved to types\ActorEvent.
  • All LevelEventPacket::EVENT_* constants have been moved to types\LevelEvent.
  • All LevelSoundEventPacket::SOUND_* constants have been moved to types\LevelSoundEvent.
  • All PlayerActionPacket::ACTION_* constants have been moved to types\PlayerAction.
  • actorUniqueId fields in AddActorPacket, AddPlayerPacket, AddItemActorPacket and AddPaintingPacket are now mandatory and non-nullable.
  • actor is now consistently used instead of entity. This affects the following things:
    • PacketSerializer->getEntityUniqueId()
    • PacketSerializer->getEntityRuntimeId()
    • PacketSerializer->putEntityUniqueId()
    • PacketSerializer->putEntityRuntimeId()
  • PacketSerializer->putByteRotation() has been renamed to putRotationByte().
  • PacketSerializer->getByteRotation() has been renamed to getRotationByte().
  • DisconnectPacket now uses a nullable message field. null value indicates that the disconnection screen should not be shown.
  • LevelChunkPacket::withoutCache() and LevelChunkPacket::withCache() have been removed. LevelChunkPacket now has a standard ::create().
  • LevelChunkPacket->cacheEnabled has been removed. This is now represented by usedBlobHashes being null instead.
  • LevelSettings has been extracted from StartGamePacket.
  • LevelSoundEventPacket::create() now has a standardised signature. Unfortunately, this means it requires all fields to be specified, which may not be ideal for some use cases. So...
  • LevelSoundEventPacket::nonActorSound() static method has been added.
  • LevelSoundEvent->position is no longer nullable.
  • AddPlayerPacket->headYaw is no longer nullable, but is still optional (defaults to 0).

Field renames

  • actor is now consistently used instead of entity. This affects the following things:
    • entityUniqueId and/or entityRuntimeId fields in AddActorPacket, AddPlayerPacket, AddPaintingPacket, AddItemActorPacket, AdventureSettingsPacket, AnimatePacket, ContainerOpenPacket, CreatePhotoPacket, DebugInfoPacket, EmotePacket, MobArmorEquipmentPacket, MobEffectPacket, MobEquipmentPacket, MotionPredictionHintsPacket, MoveActorAbsolutePacket, MoveActorDeltaPacket, MovePlayerPacket, NpcRequestPacket, PlayerActionPacket, PlayerListEntry, RemoveActorPacket, RespawnPacket, SetActorDataPacket, SetActorMotionPacket, SetLocalPlayerAsInitializedPacket, ScorePacketEntry, ScoreboardIdentityPacketEntry, SpawnParticleEffectPacket, StartGamePacket, UpdateAttributesPacket, UpdateBlockSyncedPacket, UpdateEquipPacket, MapTrackedObject, UseItemOnEntityTransactionData
    • bossEid and playerEid fields in BossEventPacket (now bossActorUniqueId and playerActorUniqueId respectively)
    • minecartEid field in CommandBlockUpdatePacket (now minecartActorRuntimeId)
    • playerEntityRuntimeId field in EmoteListPacket
    • playerEntityUniqueId field in UpdatePlayerGameTypePacket
    • ridingEid field in MovePlayerPacket (now ridingActorRuntimeId)
    • ownerEntityUniqueId field in PhotoTransferPacket
    • playerEid field in ShowCreditsPacket (now playerActorRuntimeId)
    • target field in TakeItemActorPacket (now itemActorRuntimeId)
    • eid field in TakeItemActorPacket (now takerActorRuntimeId)
    • traderEid field in UpdateTradePacket (now traderActorUniqueId)
    • playerEid field in UpdateTradePacket (now playerActorUniqueId)
    • fromEntityUniqueId and toEntityUniqueId fields in EntityLink (yes, some things weren't noticed until release was tagged)
    • playerEntityUniqueId field in CommandOriginData
    • syncedUpdateEntityUniqueId field in UpdateSubChunkBlocksPacketEntry
  • position is now consistently used instead of pos for naming.
  • The following other fields have been renamed (not including those listed above):
    • ClientboundMapItemDataPacket
      • eids -> parentMapIds.
    • UpdateTradePacket
      • isWilling ->isEconomyTrade.
      • ActorEventPacket
        • event -> eventId
        • data -> eventData
      • AdventureSettingsPacket
        • entityUniqueId -> targetActorUniqueId
      • BiomeDefinitionListPacket
        • defs -> definitions
      • BlockActorDataPacket
        • namedtag -> nbt
      • CameraPacket
        • playerUniqueId -> playerActorUniqueId
        • cameraUniqueId -> cameraActorUniqueId
      • ContainerOpenPacket
        • type -> windowType
      • CraftingDataPacket
        • entries -> recipesWithTypeIds
      • CraftingEventPacket
        • type -> windowType
        • id -> recipeUUID
      • InteractPacket
        • target -> targetActorRuntimeId
      • LabTablePacket
        • type -> actionType
      • LevelEventPacket
        • evid -> eventId
        • data -> eventData
      • NpcRequestPacket
        • actionType -> actionIndex
      • ResourcePackChunkDataPacket
        • progress -> offset
      • StructureTemplateDataRequestPacket
        • structureTemplateResponseType -> requestType (no, this is not a typo)
      • StructureTemplateDataResponsePacket
        • namedtag -> nbt
      • SyncActorPropertyPacket
        • data -> nbt
      • UpdateEquipPacket
        • namedtag -> nbt
BedrockProtocol - 4.0.1 for Minecraft Bedrock 1.17.40

Published by dktapps almost 3 years ago

Changes since 4.0.0

  • Fixed some missing initializers for optional fields.
BedrockProtocol - 4.0.0 for Minecraft Bedrock 1.17.40

Published by dktapps almost 3 years ago

Changes since 3.0.x

  • Typed properties are now used throughout the code.
  • Unknown field of MineBlockStackRequestAction has been renamed to hotbarSlot.