Added TransferPacket

TYSM MOJANG
This commit is contained in:
Dylan K. Taylor 2017-02-01 12:59:01 +00:00
parent bf6e8db941
commit 38937fc4cc
2 changed files with 44 additions and 0 deletions

View File

@ -90,6 +90,7 @@ use pocketmine\network\protocol\SpawnExperienceOrbPacket;
use pocketmine\network\protocol\StartGamePacket;
use pocketmine\network\protocol\TakeItemEntityPacket;
use pocketmine\network\protocol\TextPacket;
use pocketmine\network\protocol\TransferPacket;
use pocketmine\network\protocol\UpdateBlockPacket;
use pocketmine\network\protocol\UseItemPacket;
use pocketmine\Player;
@ -365,6 +366,7 @@ class Network{
$this->registerPacket(ProtocolInfo::START_GAME_PACKET, StartGamePacket::class);
$this->registerPacket(ProtocolInfo::TAKE_ITEM_ENTITY_PACKET, TakeItemEntityPacket::class);
$this->registerPacket(ProtocolInfo::TEXT_PACKET, TextPacket::class);
$this->registerPacket(ProtocolInfo::TRANSFER_PACKET, TransferPacket::class);
$this->registerPacket(ProtocolInfo::UPDATE_BLOCK_PACKET, UpdateBlockPacket::class);
$this->registerPacket(ProtocolInfo::USE_ITEM_PACKET, UseItemPacket::class);
}

View File

@ -0,0 +1,42 @@
<?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/
*
*
*/
namespace pocketmine\network\protocol;
#include <rules/DataPacket.h>
class TransferPacket extends DataPacket{
const NETWORK_ID = Info::TRANSFER_PACKET;
public $address;
public $port;
public function decode(){
}
public function encode(){
$this->reset();
$this->putString($this->address);
$this->putLShort($this->port);
}
}