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

@@ -7,59 +7,48 @@
#include "PacketListener.h"
#include "AddGlobalEntityPacket.h"
const int AddGlobalEntityPacket::LIGHTNING = 1;
AddGlobalEntityPacket::AddGlobalEntityPacket()
{
id = -1;
x = 0;
y = 0;
x = 0;
type = 0;
AddGlobalEntityPacket::AddGlobalEntityPacket() {
id = -1;
x = 0;
y = 0;
x = 0;
type = 0;
}
AddGlobalEntityPacket::AddGlobalEntityPacket(std::shared_ptr<Entity> e)
{
id = e->entityId;
AddGlobalEntityPacket::AddGlobalEntityPacket(std::shared_ptr<Entity> e) {
id = e->entityId;
x = Mth::floor(e->x * 32);
y = Mth::floor(e->y * 32);
z = Mth::floor(e->z * 32);
if (std::dynamic_pointer_cast<LightningBolt>(e) != NULL)
{
this->type = LIGHTNING;
}
else
{
this->type = 0;
}
if (std::dynamic_pointer_cast<LightningBolt>(e) != NULL) {
this->type = LIGHTNING;
} else {
this->type = 0;
}
}
void AddGlobalEntityPacket::read(DataInputStream *dis) // throws IOException
void AddGlobalEntityPacket::read(DataInputStream* dis) // throws IOException
{
id = dis->readInt();
type = static_cast<int>(dis->readByte());
x = dis->readInt();
y = dis->readInt();
z = dis->readInt();
id = dis->readInt();
type = static_cast<int>(dis->readByte());
x = dis->readInt();
y = dis->readInt();
z = dis->readInt();
}
void AddGlobalEntityPacket::write(DataOutputStream *dos) // throws IOException
void AddGlobalEntityPacket::write(DataOutputStream* dos) // throws IOException
{
dos->writeInt(id);
dos->writeByte(static_cast<uint8_t>(type));
dos->writeInt(x);
dos->writeInt(y);
dos->writeInt(z);
dos->writeInt(id);
dos->writeByte(static_cast<uint8_t>(type));
dos->writeInt(x);
dos->writeInt(y);
dos->writeInt(z);
}
void AddGlobalEntityPacket::handle(PacketListener *listener)
{
listener->handleAddGlobalEntity(shared_from_this());
void AddGlobalEntityPacket::handle(PacketListener* listener) {
listener->handleAddGlobalEntity(shared_from_this());
}
int AddGlobalEntityPacket::getEstimatedSize()
{
return 17;
}
int AddGlobalEntityPacket::getEstimatedSize() { return 17; }