mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-05 19:37:17 +00:00
Merge remote-tracking branch 'origin/stable'
This commit is contained in:
commit
2d686e6dc0
4
src/network/mcpe/cache/CraftingDataCache.php
vendored
4
src/network/mcpe/cache/CraftingDataCache.php
vendored
@ -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);
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user