* Fixed boats falling and a TP glitch #266 * Replaced every C-style cast with C++ ones * Replaced every C-style cast with C++ ones * Fixed boats falling and a TP glitch #266 * Updated NULL to nullptr and fixing some type issues * Modernized and fixed a few bugs - Replaced most instances of `NULL` with `nullptr`. - Replaced most `shared_ptr(new ...)` with `make_shared`. - Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances. * Fixing more conflicts * Replace int loops with size_t and start work on overrides
39 lines
801 B
C++
39 lines
801 B
C++
#include "stdafx.h"
|
|
#include "net.minecraft.world.effect.h"
|
|
#include "InputOutputStream.h"
|
|
#include "PacketListener.h"
|
|
#include "RemoveMobEffectPacket.h"
|
|
|
|
|
|
|
|
RemoveMobEffectPacket::RemoveMobEffectPacket()
|
|
{
|
|
}
|
|
|
|
RemoveMobEffectPacket::RemoveMobEffectPacket(int entityId, MobEffectInstance *effect)
|
|
{
|
|
this->entityId = entityId;
|
|
this->effectId = static_cast<byte>(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;
|
|
} |