mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-24 22:04:54 +00:00
chore: format Minecraft.World
This commit is contained in:
@@ -4,45 +4,37 @@
|
||||
#include "PacketListener.h"
|
||||
#include "InteractPacket.h"
|
||||
|
||||
|
||||
|
||||
const int InteractPacket::INTERACT = 0;
|
||||
const int InteractPacket::ATTACK = 1;
|
||||
|
||||
InteractPacket::InteractPacket()
|
||||
{
|
||||
source = 0;
|
||||
target = 0;
|
||||
action = 0;
|
||||
InteractPacket::InteractPacket() {
|
||||
source = 0;
|
||||
target = 0;
|
||||
action = 0;
|
||||
}
|
||||
|
||||
InteractPacket::InteractPacket(int source, int target, int action)
|
||||
{
|
||||
this->source = source;
|
||||
this->target = target;
|
||||
this->action = action;
|
||||
InteractPacket::InteractPacket(int source, int target, int action) {
|
||||
this->source = source;
|
||||
this->target = target;
|
||||
this->action = action;
|
||||
}
|
||||
|
||||
void InteractPacket::read(DataInputStream *dis) //throws IOException
|
||||
void InteractPacket::read(DataInputStream* dis) // throws IOException
|
||||
{
|
||||
source = dis->readInt();
|
||||
target = dis->readInt();
|
||||
action = (int)dis->readByte();
|
||||
source = dis->readInt();
|
||||
target = dis->readInt();
|
||||
action = (int)dis->readByte();
|
||||
}
|
||||
|
||||
void InteractPacket::write(DataOutputStream *dos) // throws IOException
|
||||
void InteractPacket::write(DataOutputStream* dos) // throws IOException
|
||||
{
|
||||
dos->writeInt(source);
|
||||
dos->writeInt(target);
|
||||
dos->writeByte((uint8_t)action);
|
||||
dos->writeInt(source);
|
||||
dos->writeInt(target);
|
||||
dos->writeByte((uint8_t)action);
|
||||
}
|
||||
|
||||
void InteractPacket::handle(PacketListener *listener)
|
||||
{
|
||||
listener->handleInteract(shared_from_this());
|
||||
void InteractPacket::handle(PacketListener* listener) {
|
||||
listener->handleInteract(shared_from_this());
|
||||
}
|
||||
|
||||
int InteractPacket::getEstimatedSize()
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
int InteractPacket::getEstimatedSize() { return 9; }
|
||||
|
||||
Reference in New Issue
Block a user