s/windowid/windowId

This commit is contained in:
Dylan K. Taylor 2017-08-08 12:37:26 +01:00
parent 3ad1b1ba7f
commit 75644b5df2
4 changed files with 13 additions and 13 deletions

View File

@ -2789,17 +2789,17 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
} }
public function handleContainerClose(ContainerClosePacket $packet) : bool{ public function handleContainerClose(ContainerClosePacket $packet) : bool{
if($this->spawned === false or $packet->windowid === 0){ if($this->spawned === false or $packet->windowId === 0){
return true; return true;
} }
$this->craftingType = 0; $this->craftingType = 0;
$this->currentTransaction = null; $this->currentTransaction = null;
if(isset($this->windowIndex[$packet->windowid])){ if(isset($this->windowIndex[$packet->windowId])){
$this->server->getPluginManager()->callEvent(new InventoryCloseEvent($this->windowIndex[$packet->windowid], $this)); $this->server->getPluginManager()->callEvent(new InventoryCloseEvent($this->windowIndex[$packet->windowId], $this));
$this->removeWindow($this->windowIndex[$packet->windowid]); $this->removeWindow($this->windowIndex[$packet->windowId]);
}else{ }else{
unset($this->windowIndex[$packet->windowid]); unset($this->windowIndex[$packet->windowId]);
} }
return true; return true;

View File

@ -32,7 +32,7 @@ abstract class ContainerInventory extends BaseInventory{
public function onOpen(Player $who){ public function onOpen(Player $who){
parent::onOpen($who); parent::onOpen($who);
$pk = new ContainerOpenPacket(); $pk = new ContainerOpenPacket();
$pk->windowid = $who->getWindowId($this); $pk->windowId = $who->getWindowId($this);
$pk->type = $this->getNetworkType(); $pk->type = $this->getNetworkType();
$holder = $this->getHolder(); $holder = $this->getHolder();
if($holder instanceof Vector3){ if($holder instanceof Vector3){
@ -50,7 +50,7 @@ abstract class ContainerInventory extends BaseInventory{
public function onClose(Player $who){ public function onClose(Player $who){
$pk = new ContainerClosePacket(); $pk = new ContainerClosePacket();
$pk->windowid = $who->getWindowId($this); $pk->windowId = $who->getWindowId($this);
$who->dataPacket($pk); $who->dataPacket($pk);
parent::onClose($who); parent::onClose($who);
} }

View File

@ -31,14 +31,14 @@ use pocketmine\network\mcpe\NetworkSession;
class ContainerClosePacket extends DataPacket{ class ContainerClosePacket extends DataPacket{
const NETWORK_ID = ProtocolInfo::CONTAINER_CLOSE_PACKET; const NETWORK_ID = ProtocolInfo::CONTAINER_CLOSE_PACKET;
public $windowid; public $windowId;
protected function decodePayload(){ protected function decodePayload(){
$this->windowid = $this->getByte(); $this->windowId = $this->getByte();
} }
protected function encodePayload(){ protected function encodePayload(){
$this->putByte($this->windowid); $this->putByte($this->windowId);
} }
public function handle(NetworkSession $session) : bool{ public function handle(NetworkSession $session) : bool{

View File

@ -31,7 +31,7 @@ use pocketmine\network\mcpe\NetworkSession;
class ContainerOpenPacket extends DataPacket{ class ContainerOpenPacket extends DataPacket{
const NETWORK_ID = ProtocolInfo::CONTAINER_OPEN_PACKET; const NETWORK_ID = ProtocolInfo::CONTAINER_OPEN_PACKET;
public $windowid; public $windowId;
public $type; public $type;
public $x; public $x;
public $y; public $y;
@ -39,14 +39,14 @@ class ContainerOpenPacket extends DataPacket{
public $entityUniqueId = -1; public $entityUniqueId = -1;
protected function decodePayload(){ protected function decodePayload(){
$this->windowid = $this->getByte(); $this->windowId = $this->getByte();
$this->type = $this->getByte(); $this->type = $this->getByte();
$this->getBlockPosition($this->x, $this->y, $this->z); $this->getBlockPosition($this->x, $this->y, $this->z);
$this->entityUniqueId = $this->getEntityUniqueId(); $this->entityUniqueId = $this->getEntityUniqueId();
} }
protected function encodePayload(){ protected function encodePayload(){
$this->putByte($this->windowid); $this->putByte($this->windowId);
$this->putByte($this->type); $this->putByte($this->type);
$this->putBlockPosition($this->x, $this->y, $this->z); $this->putBlockPosition($this->x, $this->y, $this->z);
$this->putEntityUniqueId($this->entityUniqueId); $this->putEntityUniqueId($this->entityUniqueId);