mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-28 06:13:37 +00:00
Remove BYTE from mob effect packets
This commit is contained in:
parent
97d12ae2d8
commit
3da761347f
|
|
@ -17,7 +17,7 @@ UpdateMobEffectPacket::UpdateMobEffectPacket()
|
|||
UpdateMobEffectPacket::UpdateMobEffectPacket(int entityId, MobEffectInstance *effect)
|
||||
{
|
||||
this->entityId = entityId;
|
||||
this->effectId = (BYTE) (effect->getId() & 0xff);
|
||||
this->effectId = static_cast<std::uint8_t>(effect->getId() & 0xff);
|
||||
this->effectAmplifier = (char) (effect->getAmplifier() & 0xff);
|
||||
this->effectDurationTicks = (short) effect->getDuration();
|
||||
}
|
||||
|
|
@ -57,4 +57,4 @@ bool UpdateMobEffectPacket::isInvalidatedBy(std::shared_ptr<Packet> packet)
|
|||
{
|
||||
std::shared_ptr<UpdateMobEffectPacket> target = std::dynamic_pointer_cast<UpdateMobEffectPacket>(packet);
|
||||
return target->entityId == entityId && target->effectId == effectId;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma once
|
||||
#include <cstdint>
|
||||
|
||||
#include "Packet.h"
|
||||
|
||||
|
|
@ -8,7 +9,7 @@ class UpdateMobEffectPacket : public Packet, public std::enable_shared_from_this
|
|||
{
|
||||
public:
|
||||
int entityId;
|
||||
BYTE effectId;
|
||||
std::uint8_t effectId;
|
||||
char effectAmplifier;
|
||||
short effectDurationTicks;
|
||||
|
||||
|
|
@ -25,4 +26,4 @@ public:
|
|||
public:
|
||||
static std::shared_ptr<Packet> create() { return std::shared_ptr<Packet>(new UpdateMobEffectPacket()); }
|
||||
virtual int getId() { return 41; }
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue