mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-24 13:43:36 +00:00
45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
#include "../../Platform/stdafx.h"
|
|
#include <iostream>
|
|
#include "../../IO/Streams/InputOutputStream.h"
|
|
#include "PacketListener.h"
|
|
#include "SetSpawnPositionPacket.h"
|
|
|
|
SetSpawnPositionPacket::SetSpawnPositionPacket() {
|
|
x = 0;
|
|
y = 0;
|
|
z = 0;
|
|
}
|
|
|
|
SetSpawnPositionPacket::SetSpawnPositionPacket(int x, int y, int z) {
|
|
this->x = x;
|
|
this->y = y;
|
|
this->z = z;
|
|
}
|
|
|
|
void SetSpawnPositionPacket::read(DataInputStream* dis) // throws IOException
|
|
{
|
|
x = dis->readInt();
|
|
y = dis->readInt();
|
|
z = dis->readInt();
|
|
}
|
|
|
|
void SetSpawnPositionPacket::write(DataOutputStream* dos) // throws IOException
|
|
{
|
|
dos->writeInt(x);
|
|
dos->writeInt(y);
|
|
dos->writeInt(z);
|
|
}
|
|
|
|
void SetSpawnPositionPacket::handle(PacketListener* listener) {
|
|
listener->handleSetSpawn(shared_from_this());
|
|
}
|
|
|
|
int SetSpawnPositionPacket::getEstimatedSize() { return 3 * 4; }
|
|
|
|
bool SetSpawnPositionPacket::canBeInvalidated() { return true; }
|
|
|
|
bool SetSpawnPositionPacket::isInvalidatedBy(std::shared_ptr<Packet> packet) {
|
|
return true;
|
|
}
|
|
|
|
bool SetSpawnPositionPacket::isAync() { return false; } |