mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-26 00:17:15 +00:00
chore: format Minecraft.World
This commit is contained in:
@@ -4,84 +4,60 @@
|
||||
#include "PacketListener.h"
|
||||
#include "PlayerInputPacket.h"
|
||||
|
||||
|
||||
|
||||
PlayerInputPacket::PlayerInputPacket()
|
||||
{
|
||||
xa = 0.0f;
|
||||
ya = 0.0f;
|
||||
isJumpingVar = false;
|
||||
isSneakingVar = false;
|
||||
xRot = 0.0f;
|
||||
yRot = 0.0f;
|
||||
PlayerInputPacket::PlayerInputPacket() {
|
||||
xa = 0.0f;
|
||||
ya = 0.0f;
|
||||
isJumpingVar = false;
|
||||
isSneakingVar = false;
|
||||
xRot = 0.0f;
|
||||
yRot = 0.0f;
|
||||
}
|
||||
|
||||
PlayerInputPacket::PlayerInputPacket(float xa, float ya, bool isJumpingVar, bool isSneakingVar, float xRot, float yRot)
|
||||
{
|
||||
this->xa = xa;
|
||||
this->ya = ya;
|
||||
this->isJumpingVar = isJumpingVar;
|
||||
this->isSneakingVar = isSneakingVar;
|
||||
this->xRot = xRot;
|
||||
this->yRot = yRot;
|
||||
PlayerInputPacket::PlayerInputPacket(float xa, float ya, bool isJumpingVar,
|
||||
bool isSneakingVar, float xRot,
|
||||
float yRot) {
|
||||
this->xa = xa;
|
||||
this->ya = ya;
|
||||
this->isJumpingVar = isJumpingVar;
|
||||
this->isSneakingVar = isSneakingVar;
|
||||
this->xRot = xRot;
|
||||
this->yRot = yRot;
|
||||
}
|
||||
|
||||
void PlayerInputPacket::read(DataInputStream *dis) //throws IOException
|
||||
void PlayerInputPacket::read(DataInputStream* dis) // throws IOException
|
||||
{
|
||||
xa = dis->readFloat();
|
||||
ya = dis->readFloat();
|
||||
xRot = dis->readFloat();
|
||||
yRot = dis->readFloat();
|
||||
isJumpingVar = dis->readBoolean();
|
||||
isSneakingVar = dis->readBoolean();
|
||||
xa = dis->readFloat();
|
||||
ya = dis->readFloat();
|
||||
xRot = dis->readFloat();
|
||||
yRot = dis->readFloat();
|
||||
isJumpingVar = dis->readBoolean();
|
||||
isSneakingVar = dis->readBoolean();
|
||||
}
|
||||
|
||||
void PlayerInputPacket::write(DataOutputStream *dos) //throws IOException
|
||||
void PlayerInputPacket::write(DataOutputStream* dos) // throws IOException
|
||||
{
|
||||
dos->writeFloat(xa);
|
||||
dos->writeFloat(ya);
|
||||
dos->writeFloat(xRot);
|
||||
dos->writeFloat(yRot);
|
||||
dos->writeBoolean(isJumpingVar);
|
||||
dos->writeBoolean(isSneakingVar);
|
||||
dos->writeFloat(xa);
|
||||
dos->writeFloat(ya);
|
||||
dos->writeFloat(xRot);
|
||||
dos->writeFloat(yRot);
|
||||
dos->writeBoolean(isJumpingVar);
|
||||
dos->writeBoolean(isSneakingVar);
|
||||
}
|
||||
|
||||
void PlayerInputPacket::handle(PacketListener *listener)
|
||||
{
|
||||
listener->handlePlayerInput(shared_from_this());
|
||||
void PlayerInputPacket::handle(PacketListener* listener) {
|
||||
listener->handlePlayerInput(shared_from_this());
|
||||
}
|
||||
|
||||
int PlayerInputPacket::getEstimatedSize()
|
||||
{
|
||||
return 18;
|
||||
}
|
||||
int PlayerInputPacket::getEstimatedSize() { return 18; }
|
||||
|
||||
float PlayerInputPacket::getXa()
|
||||
{
|
||||
return xa;
|
||||
}
|
||||
float PlayerInputPacket::getXa() { return xa; }
|
||||
|
||||
float PlayerInputPacket::getXRot()
|
||||
{
|
||||
return xRot;
|
||||
}
|
||||
float PlayerInputPacket::getXRot() { return xRot; }
|
||||
|
||||
float PlayerInputPacket::getYa()
|
||||
{
|
||||
return ya;
|
||||
}
|
||||
float PlayerInputPacket::getYa() { return ya; }
|
||||
|
||||
float PlayerInputPacket::getYRot()
|
||||
{
|
||||
return yRot;
|
||||
}
|
||||
float PlayerInputPacket::getYRot() { return yRot; }
|
||||
|
||||
bool PlayerInputPacket::isJumping()
|
||||
{
|
||||
return isJumpingVar;
|
||||
}
|
||||
bool PlayerInputPacket::isJumping() { return isJumpingVar; }
|
||||
|
||||
bool PlayerInputPacket::isSneaking()
|
||||
{
|
||||
return isSneakingVar;
|
||||
}
|
||||
bool PlayerInputPacket::isSneaking() { return isSneakingVar; }
|
||||
|
||||
Reference in New Issue
Block a user