13declare(strict_types=1);
 
   15namespace pocketmine\network\mcpe\protocol;
 
   17use pmmp\encoding\ByteBufferReader;
 
   18use pmmp\encoding\ByteBufferWriter;
 
   22    public const NETWORK_ID = ProtocolInfo::COMPLETED_USING_ITEM_PACKET;
 
   24    public const ACTION_UNKNOWN = -1;
 
   25    public const ACTION_EQUIP_ARMOR = 0;
 
   26    public const ACTION_EAT = 1;
 
   27    public const ACTION_ATTACK = 2;
 
   28    public const ACTION_CONSUME = 3;
 
   29    public const ACTION_THROW = 4;
 
   30    public const ACTION_SHOOT = 5;
 
   31    public const ACTION_PLACE = 6;
 
   32    public const ACTION_FILL_BOTTLE = 7;
 
   33    public const ACTION_FILL_BUCKET = 8;
 
   34    public const ACTION_POUR_BUCKET = 9;
 
   35    public const ACTION_USE_TOOL = 10;
 
   36    public const ACTION_INTERACT = 11;
 
   37    public const ACTION_RETRIEVED = 12;
 
   38    public const ACTION_DYED = 13;
 
   39    public const ACTION_TRADED = 14;
 
   40    public const ACTION_BRUSHING_COMPLETED = 15;
 
   48    public static function create(
int $itemId, 
int $action) : self{
 
   50        $result->itemId = $itemId;
 
   51        $result->action = $action;
 
 
   56        $this->itemId = LE::readSignedShort($in);
 
   57        $this->action = LE::readSignedInt($in);
 
 
   61        LE::writeSignedShort($out, $this->itemId);
 
   62        LE::writeSignedInt($out, $this->action);
 
 
   66        return $handler->handleCompletedUsingItem($this);
 
 
 
handle(PacketHandlerInterface $handler)
 
encodePayload(ByteBufferWriter $out)
 
decodePayload(ByteBufferReader $in)
 
static create(int $itemId, int $action)