the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2#include <iostream>
3#include "InputOutputStream.h"
4#include "net.minecraft.world.entity.h"
5#include "PacketListener.h"
6#include "TextureAndGeometryChangePacket.h"
7
8
9
10
11TextureAndGeometryChangePacket::TextureAndGeometryChangePacket()
12{
13 id = -1;
14 path = L"";
15 dwSkinID = 0;
16}
17
18TextureAndGeometryChangePacket::TextureAndGeometryChangePacket(shared_ptr<Entity> e, const wstring &path)
19{
20 id = e->entityId;
21 this->path = path;
22 wstring skinValue = path.substr(7,path.size());
23 skinValue = skinValue.substr(0,skinValue.find_first_of(L'.'));
24 std::wstringstream ss;
25 ss << std::dec << skinValue.c_str();
26 ss >> dwSkinID;
27 dwSkinID = MAKE_SKIN_BITMASK(true, dwSkinID);
28
29}
30
31void TextureAndGeometryChangePacket::read(DataInputStream *dis) //throws IOException
32{
33 id = dis->readInt();
34 dwSkinID = dis->readInt();
35 path = dis->readUTF();
36}
37
38void TextureAndGeometryChangePacket::write(DataOutputStream *dos) //throws IOException
39{
40 dos->writeInt(id);
41 dos->writeInt(dwSkinID);
42 dos->writeUTF(path);
43}
44
45void TextureAndGeometryChangePacket::handle(PacketListener *listener)
46{
47 listener->handleTextureAndGeometryChange(shared_from_this());
48}
49
50int TextureAndGeometryChangePacket::getEstimatedSize()
51{
52 return 8 + (int)path.size();
53}