mirror of
https://github.com/GabsPuNs/Project-Zenith-Main.git
synced 2026-05-26 12:44:36 +00:00
* Remove stdafx.h and some <unordered_set> includes * Update Minecraft Server Defines and remove more unused folders/files * Unbloat stdafx.h from Minecraft.World
41 lines
748 B
C++
41 lines
748 B
C++
#include <iostream>
|
|
#include "InputOutputStream.h"
|
|
#include "PacketListener.h"
|
|
#include "EntityEventPacket.h"
|
|
|
|
|
|
|
|
EntityEventPacket::EntityEventPacket()
|
|
{
|
|
entityId = 0;
|
|
eventId = 0;
|
|
}
|
|
|
|
EntityEventPacket::EntityEventPacket(int entityId, BYTE eventId)
|
|
{
|
|
this->entityId = entityId;
|
|
this->eventId = eventId;
|
|
}
|
|
|
|
void EntityEventPacket::read(DataInputStream *dis) //throws IOException
|
|
{
|
|
entityId = dis->readInt();
|
|
eventId = dis->readByte();
|
|
}
|
|
|
|
void EntityEventPacket::write(DataOutputStream *dos) //throws IOException
|
|
{
|
|
dos->writeInt(entityId);
|
|
dos->writeByte(eventId);
|
|
}
|
|
|
|
void EntityEventPacket::handle(PacketListener *listener)
|
|
{
|
|
listener->handleEntityEvent(shared_from_this());
|
|
}
|
|
|
|
int EntityEventPacket::getEstimatedSize()
|
|
{
|
|
return 5;
|
|
}
|