the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 47 lines 898 B view raw
1#include "stdafx.h" 2#include <iostream> 3#include "InputOutputStream.h" 4#include "PacketListener.h" 5#include "ChunkVisibilityPacket.h" 6 7 8 9ChunkVisibilityPacket::ChunkVisibilityPacket() 10{ 11 this->shouldDelay = false; 12 x = 0; 13 z = 0; 14 visible = false; 15} 16 17ChunkVisibilityPacket::ChunkVisibilityPacket(int x, int z, bool visible) 18{ 19 this->shouldDelay = false; 20 this->x = x; 21 this->z = z; 22 this->visible = visible; 23} 24 25void ChunkVisibilityPacket::read(DataInputStream *dis) //throws IOException 26{ 27 x = dis->readInt(); 28 z = dis->readInt(); 29 visible = dis->read() != 0; 30} 31 32void ChunkVisibilityPacket::write(DataOutputStream *dos) //throws IOException 33{ 34 dos->writeInt(x); 35 dos->writeInt(z); 36 dos->write(visible ? 1 : 0); 37} 38 39void ChunkVisibilityPacket::handle(PacketListener *listener) 40{ 41 listener->handleChunkVisibility(shared_from_this()); 42} 43 44int ChunkVisibilityPacket::getEstimatedSize() 45{ 46 return 9; 47}