aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/XZPacket.cpp
blob: 92a934f444eb5c0e3b4ec5718603ab7589a10bf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "stdafx.h"
#include <iostream>
#include "InputOutputStream.h"
#include "net.minecraft.world.item.h"
#include "PacketListener.h"
#include "XZPacket.h"



const int XZPacket::STRONGHOLD	= 0;

XZPacket::~XZPacket()
{
}

XZPacket::XZPacket()
{
	action	= 	STRONGHOLD;
	x =	0;
	z = 0;
}

XZPacket::XZPacket(char action, int x, int z)
{
	this->action = action;
	this->x = x;
	this->z = z;
}

void XZPacket::handle(PacketListener *listener)
{
	listener->handleXZ(shared_from_this());
}

void XZPacket::read(DataInputStream *dis) //throws IOException
{
	action = dis->read();
	x = dis->readInt();
	z = dis->readInt();
}

void XZPacket::write(DataOutputStream *dos) // throws IOException
{
	dos->write(action);
	dos->writeInt(x);
	dos->writeInt(z);
}

int XZPacket::getEstimatedSize() 
{
	return 10;
}