mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 20:28:31 +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){
|
foreach($list as $recipe){
|
||||||
$pk->entries[] = new ProtocolShapelessRecipe(
|
$pk->entries[] = new ProtocolShapelessRecipe(
|
||||||
CraftingDataPacket::ENTRY_SHAPELESS,
|
CraftingDataPacket::ENTRY_SHAPELESS,
|
||||||
Binary::writeInt($counter++),
|
Binary::writeInt(++$counter),
|
||||||
array_map(function(Item $item) use ($converter) : RecipeIngredient{
|
array_map(function(Item $item) use ($converter) : RecipeIngredient{
|
||||||
return $converter->coreItemStackToRecipeIngredient($item);
|
return $converter->coreItemStackToRecipeIngredient($item);
|
||||||
}, $recipe->getIngredientList()),
|
}, $recipe->getIngredientList()),
|
||||||
@ -102,7 +102,7 @@ final class CraftingDataCache{
|
|||||||
}
|
}
|
||||||
$pk->entries[] = $r = new ProtocolShapedRecipe(
|
$pk->entries[] = $r = new ProtocolShapedRecipe(
|
||||||
CraftingDataPacket::ENTRY_SHAPED,
|
CraftingDataPacket::ENTRY_SHAPED,
|
||||||
Binary::writeInt($counter++),
|
Binary::writeInt(++$counter),
|
||||||
$inputs,
|
$inputs,
|
||||||
array_map(function(Item $item) use ($converter) : ItemStack{
|
array_map(function(Item $item) use ($converter) : ItemStack{
|
||||||
return $converter->coreItemStackToNet($item);
|
return $converter->coreItemStackToNet($item);
|
||||||
|
@ -31,24 +31,24 @@ class AddEntityPacket extends DataPacket implements ClientboundPacket{
|
|||||||
public const NETWORK_ID = ProtocolInfo::ADD_ENTITY_PACKET;
|
public const NETWORK_ID = ProtocolInfo::ADD_ENTITY_PACKET;
|
||||||
|
|
||||||
/** @var int */
|
/** @var int */
|
||||||
private $uvarint1;
|
private $entityNetId;
|
||||||
|
|
||||||
public static function create(int $uvarint1) : self{
|
public static function create(int $entityNetId) : self{
|
||||||
$result = new self;
|
$result = new self;
|
||||||
$result->uvarint1 = $uvarint1;
|
$result->entityNetId = $entityNetId;
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUvarint1() : int{
|
public function getEntityNetId() : int{
|
||||||
return $this->uvarint1;
|
return $this->entityNetId;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function decodePayload(PacketSerializer $in) : void{
|
protected function decodePayload(PacketSerializer $in) : void{
|
||||||
$this->uvarint1 = $in->getUnsignedVarInt();
|
$this->entityNetId = $in->getUnsignedVarInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function encodePayload(PacketSerializer $out) : void{
|
protected function encodePayload(PacketSerializer $out) : void{
|
||||||
$out->putUnsignedVarInt($this->uvarint1);
|
$out->putUnsignedVarInt($this->entityNetId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handle(PacketHandlerInterface $handler) : bool{
|
public function handle(PacketHandlerInterface $handler) : bool{
|
||||||
|
@ -31,24 +31,24 @@ class RemoveEntityPacket extends DataPacket implements ClientboundPacket{
|
|||||||
public const NETWORK_ID = ProtocolInfo::REMOVE_ENTITY_PACKET;
|
public const NETWORK_ID = ProtocolInfo::REMOVE_ENTITY_PACKET;
|
||||||
|
|
||||||
/** @var int */
|
/** @var int */
|
||||||
private $uvarint1;
|
private $entityNetId;
|
||||||
|
|
||||||
public static function create(int $uvarint1) : self{
|
public static function create(int $entityNetId) : self{
|
||||||
$result = new self;
|
$result = new self;
|
||||||
$result->uvarint1 = $uvarint1;
|
$result->entityNetId = $entityNetId;
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUvarint1() : int{
|
public function getEntityNetId() : int{
|
||||||
return $this->uvarint1;
|
return $this->entityNetId;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function decodePayload(PacketSerializer $in) : void{
|
protected function decodePayload(PacketSerializer $in) : void{
|
||||||
$this->uvarint1 = $in->getUnsignedVarInt();
|
$this->entityNetId = $in->getUnsignedVarInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function encodePayload(PacketSerializer $out) : void{
|
protected function encodePayload(PacketSerializer $out) : void{
|
||||||
$out->putUnsignedVarInt($this->uvarint1);
|
$out->putUnsignedVarInt($this->entityNetId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handle(PacketHandlerInterface $handler) : bool{
|
public function handle(PacketHandlerInterface $handler) : bool{
|
||||||
|
@ -30,6 +30,13 @@ use pocketmine\network\mcpe\protocol\serializer\PacketSerializer;
|
|||||||
class SetDisplayObjectivePacket extends DataPacket implements ClientboundPacket{
|
class SetDisplayObjectivePacket extends DataPacket implements ClientboundPacket{
|
||||||
public const NETWORK_ID = ProtocolInfo::SET_DISPLAY_OBJECTIVE_PACKET;
|
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 */
|
/** @var string */
|
||||||
public $displaySlot;
|
public $displaySlot;
|
||||||
/** @var string */
|
/** @var string */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user