chore: switch all entity ids to dedicated ints (#86)

* switch all entity ids to dedicated ints

* Increment NETWORK_PROTOCOL_VERSION to 79
This commit is contained in:
DrPerkyLegit
2026-05-22 18:38:53 +03:00
committed by GitHub
parent 28d9500eca
commit 9f37450178
8 changed files with 51 additions and 55 deletions
+3 -3
View File
@@ -54,7 +54,7 @@ AddEntityPacket::AddEntityPacket(shared_ptr<Entity> e, int type, int data, int y
void AddEntityPacket::read(DataInputStream *dis) // throws IOException TODO 4J JEV add throws statement
{
id = dis->readShort();
id = dis->readInt();
type = dis->readByte();
#ifdef _LARGE_WORLDS
x = dis->readInt();
@@ -78,7 +78,7 @@ void AddEntityPacket::read(DataInputStream *dis) // throws IOException TODO 4J
void AddEntityPacket::write(DataOutputStream *dos) // throws IOException TODO 4J JEV add throws statement
{
dos->writeShort(id);
dos->writeInt(id);
dos->writeByte(type);
#ifdef _LARGE_WORLDS
dos->writeInt(x);
@@ -107,5 +107,5 @@ void AddEntityPacket::handle(PacketListener *listener)
int AddEntityPacket::getEstimatedSize()
{
return 11 + data > -1 ? 6 : 0;
return (11 + data > -1 ? 6 : 0) + 2;
}