PocketMine-MP/src/pocketmine/network/mcpe/protocol/ContainerSetDataPacket.php
Dylan K. Taylor 7a05c46ff6 Merge branch 'stable'
# Conflicts:
#	resources/vanilla
2019-06-03 18:21:49 +01:00

67 lines
1.9 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\handler\SessionHandler;
class ContainerSetDataPacket extends DataPacket implements ClientboundPacket{
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;
public const PROPERTY_FURNACE_STORED_XP = 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() : void{
$this->windowId = $this->getByte();
$this->property = $this->getVarInt();
$this->value = $this->getVarInt();
}
protected function encodePayload() : void{
$this->putByte($this->windowId);
$this->putVarInt($this->property);
$this->putVarInt($this->value);
}
public function handle(SessionHandler $handler) : bool{
return $handler->handleContainerSetData($this);
}
}