Rename some CommandBlockUpdatePacket fields

This commit is contained in:
Dylan K. Taylor 2017-03-13 10:44:23 +00:00
parent 565335f29e
commit e7dbda922a

View File

@ -30,7 +30,7 @@ use pocketmine\network\mcpe\NetworkSession;
class CommandBlockUpdatePacket extends DataPacket{ class CommandBlockUpdatePacket extends DataPacket{
const NETWORK_ID = ProtocolInfo::COMMAND_BLOCK_UPDATE_PACKET; const NETWORK_ID = ProtocolInfo::COMMAND_BLOCK_UPDATE_PACKET;
public $isCommandBlockUpdate; public $isBlock;
public $x; public $x;
public $y; public $y;
@ -39,7 +39,7 @@ class CommandBlockUpdatePacket extends DataPacket{
public $isRedstoneMode; public $isRedstoneMode;
public $isConditional; public $isConditional;
public $eid; public $minecartEid;
public $command; public $command;
public $lastOutput; public $lastOutput;
@ -48,15 +48,16 @@ class CommandBlockUpdatePacket extends DataPacket{
public $shouldTrackOutput; public $shouldTrackOutput;
public function decode(){ public function decode(){
$this->isCommandBlockUpdate = $this->getBool(); $this->isBlock = $this->getBool();
if($this->isCommandBlockUpdate){ if($this->isBlock){
$this->getBlockPosition($this->x, $this->y, $this->z); $this->getBlockPosition($this->x, $this->y, $this->z);
$this->commandBlockMode = $this->getUnsignedVarInt(); $this->commandBlockMode = $this->getUnsignedVarInt();
$this->isRedstoneMode = $this->getBool(); $this->isRedstoneMode = $this->getBool();
$this->isConditional = $this->getBool(); $this->isConditional = $this->getBool();
}else{ }else{
$this->eid = $this->getEntityRuntimeId(); //Minecart with command block
$this->minecartEid = $this->getEntityRuntimeId();
} }
$this->command = $this->getString(); $this->command = $this->getString();
@ -68,15 +69,15 @@ class CommandBlockUpdatePacket extends DataPacket{
public function encode(){ public function encode(){
$this->reset(); $this->reset();
$this->putBool($this->isCommandBlockUpdate); $this->putBool($this->isBlock);
if($this->isCommandBlockUpdate){ if($this->isBlock){
$this->putBlockPosition($this->x, $this->y, $this->z); $this->putBlockPosition($this->x, $this->y, $this->z);
$this->putUnsignedVarInt($this->commandBlockMode); $this->putUnsignedVarInt($this->commandBlockMode);
$this->putBool($this->isRedstoneMode); $this->putBool($this->isRedstoneMode);
$this->putBool($this->isConditional); $this->putBool($this->isConditional);
}else{ }else{
$this->putEntityRuntimeId($this->eid); $this->putEntityRuntimeId($this->minecartEid);
} }
$this->putString($this->command); $this->putString($this->command);