mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-07-03 21:34:25 +00:00
Remove BYTE from mob effect packets
This commit is contained in:
@@ -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; }
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user