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.1 kB · 65 lines
C++
at main
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465#include "stdafx.h"#include <iostream>#include "InputOutputStream.h"#include "PacketListener.h"#include "TileEntityDataPacket.h"
void TileEntityDataPacket::_init(){ x = y = z = 0; type = TYPE_MOB_SPAWNER; tag = NULL;}
TileEntityDataPacket::TileEntityDataPacket(){ _init(); shouldDelay = true;}
TileEntityDataPacket::TileEntityDataPacket(int x, int y, int z, int type, CompoundTag *tag){ _init(); shouldDelay = true; this->x = x; this->y = y; this->z = z; this->type = type; this->tag = tag;}
TileEntityDataPacket::~TileEntityDataPacket(){ delete tag;}
void TileEntityDataPacket::read(DataInputStream *dis){ x = dis->readInt(); y = dis->readShort(); z = dis->readInt(); type = dis->readByte(); tag = readNbt(dis);}
void TileEntityDataPacket::write(DataOutputStream *dos){ dos->writeInt(x); dos->writeShort(y); dos->writeInt(z); dos->writeByte((byte) type); writeNbt(tag, dos);}
void TileEntityDataPacket::handle(PacketListener *listener){ listener->handleTileEntityData(shared_from_this());}
int TileEntityDataPacket::getEstimatedSize(){ return 6 * 4 + 1;}