PocketMine-MP/src/pocketmine/network/mcpe/protocol/ContainerSetDataPacket.php
Dylan K. Taylor 4f8e4f0522
Add EOF newlines where missing (bulk) (#1836)
This should solve issues with people making GitHub PRs and having the web editor messing things up. GitHub Web Editor sucks :(
2017-12-20 11:56:36 +00:00

68 lines
1.8 KiB
PHP

<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
class ContainerSetDataPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::CONTAINER_SET_DATA_PACKET;
public const PROPERTY_FURNACE_TICK_COUNT = 0;
public const PROPERTY_FURNACE_LIT_TIME = 1;
public const PROPERTY_FURNACE_LIT_DURATION = 2;
//TODO: check property 3
public const PROPERTY_FURNACE_FUEL_AUX = 4;
public const PROPERTY_BREWING_STAND_BREW_TIME = 0;
public const PROPERTY_BREWING_STAND_FUEL_AMOUNT = 1;
public const PROPERTY_BREWING_STAND_FUEL_TOTAL = 2;
/** @var int */
public $windowId;
/** @var int */
public $property;
/** @var int */
public $value;
protected function decodePayload(){
$this->windowId = $this->getByte();
$this->property = $this->getVarInt();
$this->value = $this->getVarInt();
}
protected function encodePayload(){
$this->putByte($this->windowId);
$this->putVarInt($this->property);
$this->putVarInt($this->value);
}
public function handle(NetworkSession $session) : bool{
return $session->handleContainerSetData($this);
}
}