From f87b7457713c9bde26337221c389751a9ae45f52 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 15 Feb 2017 11:39:51 +0000 Subject: [PATCH] New entity metadata and found some UpdateTradePacket fields --- src/pocketmine/entity/Entity.php | 8 +++++ .../network/protocol/UpdateTradePacket.php | 30 +++++++++---------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index fef279be9c..c318f31f2c 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -109,6 +109,14 @@ abstract class Entity extends Location implements Metadatable{ * 58 (byte) * 59 (float) * 60 (float) */ + const DATA_AREA_EFFECT_CLOUD_RADIUS = 61; //float + const DATA_AREA_EFFECT_CLOUD_WAITING = 62; //int + const DATA_AREA_EFFECT_CLOUD_PARTICLE_ID = 63; //int + /* 64 (int), shulker-related + * 65 (byte), shulker-related + * 66 (short) shulker-related + * 67 (unknown), shulker-related */ + const DATA_TRADING_PLAYER_EID = 68; //long const DATA_FLAG_ONFIRE = 0; diff --git a/src/pocketmine/network/protocol/UpdateTradePacket.php b/src/pocketmine/network/protocol/UpdateTradePacket.php index f781b6caa5..e45528bd07 100644 --- a/src/pocketmine/network/protocol/UpdateTradePacket.php +++ b/src/pocketmine/network/protocol/UpdateTradePacket.php @@ -33,22 +33,22 @@ class UpdateTradePacket extends DataPacket{ public $byte2; public $varint1; public $varint2; - public $bool1; - public $eid1; - public $eid2; - public $string; - public $nbt; + public $isWilling; + public $traderEid; + public $playerEid; + public $displayName; + public $offers; public function decode(){ $this->byte1 = $this->getByte(); $this->byte2 = $this->getByte(); $this->varint1 = $this->getVarInt(); $this->varint2 = $this->getVarInt(); - $this->bool1 = $this->getBool(); - $this->eid1 = $this->getEntityId(); - $this->eid2 = $this->getEntityId(); - $this->string = $this->getString(); - $this->nbt = $this->get(true); + $this->isWilling = $this->getBool(); + $this->traderEid = $this->getEntityId(); + $this->playerEid = $this->getEntityId(); + $this->displayName = $this->getString(); + $this->offers = $this->get(true); } public function encode(){ @@ -57,10 +57,10 @@ class UpdateTradePacket extends DataPacket{ $this->putByte($this->byte2); $this->putVarInt($this->varint1); $this->putVarInt($this->varint2); - $this->putBool($this->bool1); - $this->putEntityId($this->eid1); //UniqueID - $this->putEntityId($this->eid2); //UniqueID - $this->putString($this->string); - $this->put($this->nbt); + $this->putBool($this->isWilling); + $this->putEntityId($this->traderEid); //UniqueID + $this->putEntityId($this->playerEid); //UniqueID + $this->putString($this->displayName); + $this->put($this->offers); } } \ No newline at end of file