mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Added some fields to new packets
gave up on EventPacket because it's a mess, and StructureBlockUpdate is a job all by itself
This commit is contained in:
@ -30,12 +30,35 @@ use pocketmine\network\mcpe\NetworkSession;
|
||||
class EventPacket extends DataPacket{
|
||||
const NETWORK_ID = ProtocolInfo::EVENT_PACKET;
|
||||
|
||||
const TYPE_ACHIEVEMENT_AWARDED = 0;
|
||||
const TYPE_ENTITY_INTERACT = 1;
|
||||
const TYPE_PORTAL_BUILT = 2;
|
||||
const TYPE_PORTAL_USED = 3;
|
||||
const TYPE_MOB_KILLED = 4;
|
||||
const TYPE_CAULDRON_USED = 5;
|
||||
const TYPE_PLAYER_DEATH = 6;
|
||||
const TYPE_BOSS_KILLED = 7;
|
||||
const TYPE_AGENT_COMMAND = 8;
|
||||
const TYPE_AGENT_CREATED = 9;
|
||||
|
||||
public $playerRuntimeId;
|
||||
public $eventData;
|
||||
public $type;
|
||||
|
||||
public function decodePayload(){
|
||||
//TODO
|
||||
$this->playerRuntimeId = $this->getEntityRuntimeId();
|
||||
$this->eventData = $this->getVarInt();
|
||||
$this->type = $this->getByte();
|
||||
|
||||
//TODO: nice confusing mess
|
||||
}
|
||||
|
||||
public function encodePayload(){
|
||||
//TODO
|
||||
$this->putEntityRuntimeId($this->playerRuntimeId);
|
||||
$this->putVarInt($this->eventData);
|
||||
$this->putByte($this->type);
|
||||
|
||||
//TODO: also nice confusing mess
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $session) : bool{
|
||||
|
Reference in New Issue
Block a user