mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-20 23:52:54 +00:00
Merge pull request #3 from 4jcraft/leahs-dev-branch
more casting errors fixed
This commit is contained in:
commit
60b954cda3
|
|
@ -30,18 +30,18 @@ EntityActionAtPositionPacket::EntityActionAtPositionPacket(shared_ptr<Entity> e,
|
|||
void EntityActionAtPositionPacket::read(DataInputStream *dis) //throws IOException
|
||||
{
|
||||
id = dis->readInt();
|
||||
action = dis->readByte();
|
||||
action = (int)dis->readByte();
|
||||
x = dis->readInt();
|
||||
y = dis->readByte();
|
||||
y = (int)dis->readByte();
|
||||
z = dis->readInt();
|
||||
}
|
||||
|
||||
void EntityActionAtPositionPacket::write(DataOutputStream *dos) //throws IOException
|
||||
{
|
||||
dos->writeInt(id);
|
||||
dos->writeByte(action);
|
||||
dos->writeByte((std::byte)action);
|
||||
dos->writeInt(x);
|
||||
dos->writeByte(y);
|
||||
dos->writeByte((std::byte)y);
|
||||
dos->writeInt(z);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
EntityEventPacket::EntityEventPacket()
|
||||
{
|
||||
entityId = 0;
|
||||
eventId = 0;
|
||||
eventId = (std::byte)0;
|
||||
}
|
||||
|
||||
EntityEventPacket::EntityEventPacket(int entityId, byte eventId)
|
||||
|
|
|
|||
|
|
@ -99,9 +99,9 @@ void ExplodePacket::write(DataOutputStream *dos) //throws IOException
|
|||
int xx = tp.x-xp;
|
||||
int yy = tp.y-yp;
|
||||
int zz = tp.z-zp;
|
||||
dos->writeByte(xx);
|
||||
dos->writeByte(yy);
|
||||
dos->writeByte(zz);
|
||||
dos->writeByte((std::byte)xx);
|
||||
dos->writeByte((std::byte)yy);
|
||||
dos->writeByte((std::byte)zz);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -133,4 +133,4 @@ float ExplodePacket::getKnockbackY()
|
|||
float ExplodePacket::getKnockbackZ()
|
||||
{
|
||||
return knockbackZ;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
#include "PacketListener.h"
|
||||
#include "BasicTypeContainers.h"
|
||||
#include "GameCommandPacket.h"
|
||||
#include "../Minecraft.Client/Windows64/Windows64_App.h"
|
||||
|
||||
GameCommandPacket::GameCommandPacket()
|
||||
{
|
||||
|
|
@ -69,4 +70,4 @@ void GameCommandPacket::handle(PacketListener *listener)
|
|||
int GameCommandPacket::getEstimatedSize()
|
||||
{
|
||||
return 2 + 2 + length;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,14 +38,14 @@ GameEventPacket::GameEventPacket(int _event, int param)
|
|||
|
||||
void GameEventPacket::read(DataInputStream *dis) //throws IOException
|
||||
{
|
||||
_event = dis->readByte();
|
||||
param = dis->readByte();
|
||||
_event = (int)dis->readByte();
|
||||
param = (int)dis->readByte();
|
||||
}
|
||||
|
||||
void GameEventPacket::write(DataOutputStream *dos) //throws IOException
|
||||
{
|
||||
dos->writeByte(_event);
|
||||
dos->writeByte(param);
|
||||
dos->writeByte((std::byte)_event);
|
||||
dos->writeByte((std::byte)param);
|
||||
}
|
||||
|
||||
void GameEventPacket::handle(PacketListener *listener)
|
||||
|
|
|
|||
Loading…
Reference in a new issue