Something went wrong. Try again.
the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
Something went wrong. Try again.
1.3 kB · 69 lines
C++
at master
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970#include "stdafx.h"#include <iostream>#include "InputOutputStream.h"#include "PacketListener.h"#include "PlayerInputPacket.h"
PlayerInputPacket::PlayerInputPacket(){ xxa = 0.0f; yya = 0.0f; isJumpingVar = false; isSneakingVar = false;}
PlayerInputPacket::PlayerInputPacket(float xxa, float yya, bool isJumpingVar, bool isSneakingVar) { this->xxa = xxa; this->yya = yya; this->isJumpingVar = isJumpingVar; this->isSneakingVar = isSneakingVar;}
void PlayerInputPacket::read(DataInputStream *dis) //throws IOException { xxa = dis->readFloat(); yya = dis->readFloat(); isJumpingVar = dis->readBoolean(); isSneakingVar = dis->readBoolean();}
void PlayerInputPacket::write(DataOutputStream *dos) //throws IOException { dos->writeFloat(xxa); dos->writeFloat(yya); dos->writeBoolean(isJumpingVar); dos->writeBoolean(isSneakingVar);}
void PlayerInputPacket::handle(PacketListener *listener){ listener->handlePlayerInput(shared_from_this());}
int PlayerInputPacket::getEstimatedSize(){ return 10;}
float PlayerInputPacket::getXxa(){ return xxa;}
float PlayerInputPacket::getYya() { return yya;}
bool PlayerInputPacket::isJumping() { return isJumpingVar;}
bool PlayerInputPacket::isSneaking() { return isSneakingVar;}