mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-24 05:03:40 +00:00
29 lines
901 B
C++
29 lines
901 B
C++
#include "../../Platform/stdafx.h"
|
|
#include "../../Headers/net.minecraft.world.effect.h"
|
|
#include "../../IO/Streams/InputOutputStream.h"
|
|
#include "PacketListener.h"
|
|
#include "RemoveMobEffectPacket.h"
|
|
|
|
RemoveMobEffectPacket::RemoveMobEffectPacket() {}
|
|
|
|
RemoveMobEffectPacket::RemoveMobEffectPacket(int entityId,
|
|
MobEffectInstance* effect) {
|
|
this->entityId = entityId;
|
|
this->effectId = (uint8_t)(effect->getId() & 0xff);
|
|
}
|
|
|
|
void RemoveMobEffectPacket::read(DataInputStream* dis) {
|
|
entityId = dis->readInt();
|
|
effectId = dis->readByte();
|
|
}
|
|
|
|
void RemoveMobEffectPacket::write(DataOutputStream* dos) {
|
|
dos->writeInt(entityId);
|
|
dos->writeByte(effectId);
|
|
}
|
|
|
|
void RemoveMobEffectPacket::handle(PacketListener* listener) {
|
|
listener->handleRemoveMobEffect(shared_from_this());
|
|
}
|
|
|
|
int RemoveMobEffectPacket::getEstimatedSize() { return 5; } |