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,69 +4,52 @@
#include "../../Util/BasicTypeContainers.h"
#include "GameCommandPacket.h"
GameCommandPacket::GameCommandPacket()
{
length = 0;
}
GameCommandPacket::GameCommandPacket() { length = 0; }
GameCommandPacket::GameCommandPacket(EGameCommand command, byteArray data)
{
this->command = command;
this->data = data;
length = 0;
GameCommandPacket::GameCommandPacket(EGameCommand command, byteArray data) {
this->command = command;
this->data = data;
length = 0;
if (data.data != NULL)
{
length = data.length;
if (data.data != NULL) {
length = data.length;
if (length > Short::MAX_VALUE)
{
app.DebugPrintf("Payload may not be larger than 32K\n");
if (length > Short::MAX_VALUE) {
app.DebugPrintf("Payload may not be larger than 32K\n");
#ifndef _CONTENT_PACKAGE
__debugbreak();
__debugbreak();
#endif
//throw new IllegalArgumentException("Payload may not be larger than 32k");
}
}
// throw new IllegalArgumentException("Payload may not be larger
// than 32k");
}
}
}
GameCommandPacket::~GameCommandPacket()
{
delete [] data.data;
GameCommandPacket::~GameCommandPacket() { delete[] data.data; }
void GameCommandPacket::read(DataInputStream* dis) {
command = (EGameCommand)dis->readInt();
length = dis->readShort();
if (length > 0 && length < Short::MAX_VALUE) {
if (data.data != NULL) {
delete[] data.data;
}
data = byteArray(length);
dis->readFully(data);
}
}
void GameCommandPacket::read(DataInputStream *dis)
{
command = (EGameCommand)dis->readInt();
length = dis->readShort();
if (length > 0 && length < Short::MAX_VALUE)
{
if(data.data != NULL)
{
delete [] data.data;
}
data = byteArray(length);
dis->readFully(data);
}
void GameCommandPacket::write(DataOutputStream* dos) {
dos->writeInt(command);
dos->writeShort((short)length);
if (data.data != NULL) {
dos->write(data);
}
}
void GameCommandPacket::write(DataOutputStream *dos)
{
dos->writeInt(command);
dos->writeShort((short) length);
if (data.data != NULL)
{
dos->write(data);
}
void GameCommandPacket::handle(PacketListener* listener) {
listener->handleGameCommand(shared_from_this());
}
void GameCommandPacket::handle(PacketListener *listener)
{
listener->handleGameCommand( shared_from_this() );
}
int GameCommandPacket::getEstimatedSize()
{
return 2 + 2 + length;
}
int GameCommandPacket::getEstimatedSize() { return 2 + 2 + length; }