chore: format Minecraft.World

This commit is contained in:
Tropical
2026-03-13 17:06:56 -05:00
parent bd6284025d
commit 33d0737d1d
1511 changed files with 108661 additions and 115521 deletions

View File

@@ -4,57 +4,45 @@
#include "PacketListener.h"
#include "UpdateMobEffectPacket.h"
UpdateMobEffectPacket::UpdateMobEffectPacket()
{
this->entityId = 0;
this->effectId = 0;
this->effectAmplifier = 0;
this->effectDurationTicks = 0;
UpdateMobEffectPacket::UpdateMobEffectPacket() {
this->entityId = 0;
this->effectId = 0;
this->effectAmplifier = 0;
this->effectDurationTicks = 0;
}
UpdateMobEffectPacket::UpdateMobEffectPacket(int entityId, MobEffectInstance *effect)
{
this->entityId = entityId;
this->effectId = static_cast<std::uint8_t>(effect->getId() & 0xff);
this->effectAmplifier = (char) (effect->getAmplifier() & 0xff);
this->effectDurationTicks = (short) effect->getDuration();
UpdateMobEffectPacket::UpdateMobEffectPacket(int entityId,
MobEffectInstance* effect) {
this->entityId = entityId;
this->effectId = static_cast<std::uint8_t>(effect->getId() & 0xff);
this->effectAmplifier = (char)(effect->getAmplifier() & 0xff);
this->effectDurationTicks = (short)effect->getDuration();
}
void UpdateMobEffectPacket::read(DataInputStream *dis)
{
entityId = dis->readInt();
effectId = dis->readByte();
effectAmplifier = dis->readByte();
effectDurationTicks = dis->readShort();
void UpdateMobEffectPacket::read(DataInputStream* dis) {
entityId = dis->readInt();
effectId = dis->readByte();
effectAmplifier = dis->readByte();
effectDurationTicks = dis->readShort();
}
void UpdateMobEffectPacket::write(DataOutputStream *dos)
{
dos->writeInt(entityId);
dos->writeByte(effectId);
dos->writeByte(effectAmplifier);
dos->writeShort(effectDurationTicks);
void UpdateMobEffectPacket::write(DataOutputStream* dos) {
dos->writeInt(entityId);
dos->writeByte(effectId);
dos->writeByte(effectAmplifier);
dos->writeShort(effectDurationTicks);
}
void UpdateMobEffectPacket::handle(PacketListener *listener)
{
listener->handleUpdateMobEffect(shared_from_this());
void UpdateMobEffectPacket::handle(PacketListener* listener) {
listener->handleUpdateMobEffect(shared_from_this());
}
int UpdateMobEffectPacket::getEstimatedSize()
{
return 8;
}
int UpdateMobEffectPacket::getEstimatedSize() { return 8; }
bool UpdateMobEffectPacket::canBeInvalidated()
{
return true;
}
bool UpdateMobEffectPacket::canBeInvalidated() { return true; }
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;
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;
}