diff --git a/src/network/mcpe/cache/CraftingDataCache.php b/src/network/mcpe/cache/CraftingDataCache.php index da3c8e18d..275e1ac20 100644 --- a/src/network/mcpe/cache/CraftingDataCache.php +++ b/src/network/mcpe/cache/CraftingDataCache.php @@ -77,7 +77,7 @@ final class CraftingDataCache{ foreach($list as $recipe){ $pk->entries[] = new ProtocolShapelessRecipe( CraftingDataPacket::ENTRY_SHAPELESS, - Binary::writeInt($counter++), + Binary::writeInt(++$counter), array_map(function(Item $item) use ($converter) : RecipeIngredient{ return $converter->coreItemStackToRecipeIngredient($item); }, $recipe->getIngredientList()), @@ -102,7 +102,7 @@ final class CraftingDataCache{ } $pk->entries[] = $r = new ProtocolShapedRecipe( CraftingDataPacket::ENTRY_SHAPED, - Binary::writeInt($counter++), + Binary::writeInt(++$counter), $inputs, array_map(function(Item $item) use ($converter) : ItemStack{ return $converter->coreItemStackToNet($item); diff --git a/src/network/mcpe/protocol/AddEntityPacket.php b/src/network/mcpe/protocol/AddEntityPacket.php index 7d5ff64ce..a8c33d130 100644 --- a/src/network/mcpe/protocol/AddEntityPacket.php +++ b/src/network/mcpe/protocol/AddEntityPacket.php @@ -31,24 +31,24 @@ class AddEntityPacket extends DataPacket implements ClientboundPacket{ public const NETWORK_ID = ProtocolInfo::ADD_ENTITY_PACKET; /** @var int */ - private $uvarint1; + private $entityNetId; - public static function create(int $uvarint1) : self{ + public static function create(int $entityNetId) : self{ $result = new self; - $result->uvarint1 = $uvarint1; + $result->entityNetId = $entityNetId; return $result; } - public function getUvarint1() : int{ - return $this->uvarint1; + public function getEntityNetId() : int{ + return $this->entityNetId; } protected function decodePayload(PacketSerializer $in) : void{ - $this->uvarint1 = $in->getUnsignedVarInt(); + $this->entityNetId = $in->getUnsignedVarInt(); } protected function encodePayload(PacketSerializer $out) : void{ - $out->putUnsignedVarInt($this->uvarint1); + $out->putUnsignedVarInt($this->entityNetId); } public function handle(PacketHandlerInterface $handler) : bool{ diff --git a/src/network/mcpe/protocol/RemoveEntityPacket.php b/src/network/mcpe/protocol/RemoveEntityPacket.php index f2f334440..6c9981d21 100644 --- a/src/network/mcpe/protocol/RemoveEntityPacket.php +++ b/src/network/mcpe/protocol/RemoveEntityPacket.php @@ -31,24 +31,24 @@ class RemoveEntityPacket extends DataPacket implements ClientboundPacket{ public const NETWORK_ID = ProtocolInfo::REMOVE_ENTITY_PACKET; /** @var int */ - private $uvarint1; + private $entityNetId; - public static function create(int $uvarint1) : self{ + public static function create(int $entityNetId) : self{ $result = new self; - $result->uvarint1 = $uvarint1; + $result->entityNetId = $entityNetId; return $result; } - public function getUvarint1() : int{ - return $this->uvarint1; + public function getEntityNetId() : int{ + return $this->entityNetId; } protected function decodePayload(PacketSerializer $in) : void{ - $this->uvarint1 = $in->getUnsignedVarInt(); + $this->entityNetId = $in->getUnsignedVarInt(); } protected function encodePayload(PacketSerializer $out) : void{ - $out->putUnsignedVarInt($this->uvarint1); + $out->putUnsignedVarInt($this->entityNetId); } public function handle(PacketHandlerInterface $handler) : bool{ diff --git a/src/network/mcpe/protocol/SetDisplayObjectivePacket.php b/src/network/mcpe/protocol/SetDisplayObjectivePacket.php index 9c996dd4e..9154bfa95 100644 --- a/src/network/mcpe/protocol/SetDisplayObjectivePacket.php +++ b/src/network/mcpe/protocol/SetDisplayObjectivePacket.php @@ -30,6 +30,13 @@ use pocketmine\network\mcpe\protocol\serializer\PacketSerializer; class SetDisplayObjectivePacket extends DataPacket implements ClientboundPacket{ public const NETWORK_ID = ProtocolInfo::SET_DISPLAY_OBJECTIVE_PACKET; + public const DISPLAY_SLOT_LIST = "list"; + public const DISPLAY_SLOT_SIDEBAR = "sidebar"; + public const DISPLAY_SLOT_BELOW_NAME = "belowname"; + + public const SORT_ORDER_ASCENDING = 0; + public const SORT_ORDER_DESCENDING = 1; + /** @var string */ public $displaySlot; /** @var string */