mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-26 05:14:05 +00:00
More protocol changes for 1.1, fixed resource packs
This commit is contained in:
parent
894beed59b
commit
cdf6d200ef
@ -36,6 +36,7 @@ class MoveEntityPacket extends DataPacket{
|
||||
public $yaw;
|
||||
public $headYaw;
|
||||
public $pitch;
|
||||
public $byte1;
|
||||
|
||||
public function decode(){
|
||||
$this->eid = $this->getEntityRuntimeId();
|
||||
@ -43,6 +44,7 @@ class MoveEntityPacket extends DataPacket{
|
||||
$this->pitch = $this->getByte() * (360.0 / 256);
|
||||
$this->yaw = $this->getByte() * (360.0 / 256);
|
||||
$this->headYaw = $this->getByte() * (360.0 / 256);
|
||||
$this->byte1 = $this->getByte();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
@ -52,6 +54,7 @@ class MoveEntityPacket extends DataPacket{
|
||||
$this->putByte($this->pitch / (360.0 / 256));
|
||||
$this->putByte($this->yaw / (360.0 / 256));
|
||||
$this->putByte($this->headYaw / (360.0 / 256));
|
||||
$this->putByte($this->byte1);
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $session) : bool{
|
||||
|
@ -41,14 +41,14 @@ class ResourcePackStackPacket extends DataPacket{
|
||||
|
||||
public function decode(){
|
||||
/*$this->mustAccept = $this->getBool();
|
||||
$behaviorPackCount = $this->getLShort();
|
||||
$behaviorPackCount = $this->getUnsignedVarInt();
|
||||
while($behaviorPackCount-- > 0){
|
||||
$packId = $this->getString();
|
||||
$version = $this->getString();
|
||||
$this->behaviorPackStack[] = new ResourcePackInfoEntry($packId, $version);
|
||||
}
|
||||
|
||||
$resourcePackCount = $this->getLShort();
|
||||
$resourcePackCount = $this->getUnsignedVarInt();
|
||||
while($resourcePackCount-- > 0){
|
||||
$packId = $this->getString();
|
||||
$version = $this->getString();
|
||||
@ -60,13 +60,13 @@ class ResourcePackStackPacket extends DataPacket{
|
||||
$this->reset();
|
||||
$this->putBool($this->mustAccept);
|
||||
|
||||
$this->putLShort(count($this->behaviorPackStack));
|
||||
$this->putUnsignedVarInt(count($this->behaviorPackStack));
|
||||
foreach($this->behaviorPackStack as $entry){
|
||||
$this->putString($entry->getPackId());
|
||||
$this->putString($entry->getPackVersion());
|
||||
}
|
||||
|
||||
$this->putLShort(count($this->resourcePackStack));
|
||||
$this->putUnsignedVarInt(count($this->resourcePackStack));
|
||||
foreach($this->resourcePackStack as $entry){
|
||||
$this->putString($entry->getPackId());
|
||||
$this->putString($entry->getPackVersion());
|
||||
|
@ -39,19 +39,19 @@ class ResourcePacksInfoPacket extends DataPacket{
|
||||
|
||||
public function decode(){
|
||||
/*$this->mustAccept = $this->getBool();
|
||||
$behaviorPackCount = $this->getLShort();
|
||||
$behaviorPackCount = $this->getUnsignedVarInt();
|
||||
while($behaviorPackCount-- > 0){
|
||||
$id = $this->getString();
|
||||
$version = $this->getString();
|
||||
$size = $this->getLLong();
|
||||
$size = $this->getUnsignedVarLong();
|
||||
$this->behaviorPackEntries[] = new ResourcePackInfoEntry($id, $version, $size);
|
||||
}
|
||||
|
||||
$resourcePackCount = $this->getLShort();
|
||||
$resourcePackCount = $this->getUnsignedVarInt();
|
||||
while($resourcePackCount-- > 0){
|
||||
$id = $this->getString();
|
||||
$version = $this->getString();
|
||||
$size = $this->getLLong();
|
||||
$size = $this->getUnsignedVarLong();
|
||||
$this->resourcePackEntries[] = new ResourcePackInfoEntry($id, $version, $size);
|
||||
}*/
|
||||
}
|
||||
@ -60,17 +60,17 @@ class ResourcePacksInfoPacket extends DataPacket{
|
||||
$this->reset();
|
||||
|
||||
$this->putBool($this->mustAccept);
|
||||
$this->putLShort(count($this->behaviorPackEntries));
|
||||
$this->putUnsignedVarInt(count($this->behaviorPackEntries));
|
||||
foreach($this->behaviorPackEntries as $entry){
|
||||
$this->putString($entry->getPackId());
|
||||
$this->putString($entry->getPackVersion());
|
||||
$this->putLLong($entry->getPackSize());
|
||||
$this->putUnsignedVarLong($entry->getPackSize());
|
||||
}
|
||||
$this->putLShort(count($this->resourcePackEntries));
|
||||
$this->putUnsignedVarInt(count($this->resourcePackEntries));
|
||||
foreach($this->resourcePackEntries as $entry){
|
||||
$this->putString($entry->getPackId());
|
||||
$this->putString($entry->getPackVersion());
|
||||
$this->putLLong($entry->getPackSize());
|
||||
$this->putUnsignedVarLong($entry->getPackSize());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user