PocketMine-MP
5.23.3 git-f7687af337d001ddbcc47b8e773f014a33faa662
Loading...
Searching...
No Matches
ItemStackRequestSlotInfo.php
1
<?php
2
3
/*
4
* This file is part of BedrockProtocol.
5
* Copyright (C) 2014-2022 PocketMine Team <https://github.com/pmmp/BedrockProtocol>
6
*
7
* BedrockProtocol is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU Lesser General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
*/
12
13
declare(strict_types=1);
14
15
namespace
pocketmine\network\mcpe\protocol\types\inventory\stackrequest;
16
17
use
pocketmine\network\mcpe\protocol\serializer\PacketSerializer
;
18
use
pocketmine\network\mcpe\protocol\types\inventory\FullContainerName
;
19
20
final
class
ItemStackRequestSlotInfo
{
21
public
function
__construct(
22
private
FullContainerName
$containerName,
23
private
int
$slotId,
24
private
int
$stackId
25
){}
26
27
public
function
getContainerName() :
FullContainerName
{
return
$this->containerName; }
28
29
public
function
getSlotId() :
int
{
return
$this->slotId; }
30
31
public
function
getStackId() :
int
{
return
$this->stackId; }
32
33
public
static
function
read(
PacketSerializer
$in) :
self
{
34
$containerName = FullContainerName::read($in);
35
$slotId = $in->
getByte
();
36
$stackId = $in->
readItemStackNetIdVariant
();
37
return
new
self
($containerName, $slotId, $stackId);
38
}
39
40
public
function
write(
PacketSerializer
$out) :
void
{
41
$this->containerName->write($out);
42
$out->putByte($this->slotId);
43
$out->
writeItemStackNetIdVariant
($this->stackId);
44
}
45
}
pocketmine\network\mcpe\protocol\serializer\PacketSerializer
Definition
bedrock-protocol/src/serializer/PacketSerializer.php:66
pocketmine\network\mcpe\protocol\serializer\PacketSerializer\readItemStackNetIdVariant
readItemStackNetIdVariant()
Definition
bedrock-protocol/src/serializer/PacketSerializer.php:755
pocketmine\network\mcpe\protocol\serializer\PacketSerializer\writeItemStackNetIdVariant
writeItemStackNetIdVariant(int $id)
Definition
bedrock-protocol/src/serializer/PacketSerializer.php:764
pocketmine\network\mcpe\protocol\types\inventory\FullContainerName
Definition
FullContainerName.php:19
pocketmine\network\mcpe\protocol\types\inventory\stackrequest\ItemStackRequestSlotInfo
Definition
ItemStackRequestSlotInfo.php:20
pocketmine\utils\BinaryStream\getByte
getByte()
Definition
BinaryStream.php:117
vendor
pocketmine
bedrock-protocol
src
types
inventory
stackrequest
ItemStackRequestSlotInfo.php
Generated by
1.12.0