New entity metadata and found some UpdateTradePacket fields

This commit is contained in:
Dylan K. Taylor 2017-02-15 11:39:51 +00:00
parent 8d43faf16e
commit f87b745771
2 changed files with 23 additions and 15 deletions

View File

@ -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;

View File

@ -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);
}
}