mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-26 03:46:28 +00:00
chore: format Minecraft.World
This commit is contained in:
@@ -5,49 +5,44 @@
|
||||
#include "PacketListener.h"
|
||||
#include "TextureAndGeometryChangePacket.h"
|
||||
|
||||
|
||||
|
||||
|
||||
TextureAndGeometryChangePacket::TextureAndGeometryChangePacket()
|
||||
{
|
||||
id = -1;
|
||||
path = L"";
|
||||
dwSkinID = 0;
|
||||
TextureAndGeometryChangePacket::TextureAndGeometryChangePacket() {
|
||||
id = -1;
|
||||
path = L"";
|
||||
dwSkinID = 0;
|
||||
}
|
||||
|
||||
TextureAndGeometryChangePacket::TextureAndGeometryChangePacket(std::shared_ptr<Entity> e, const std::wstring &path)
|
||||
{
|
||||
id = e->entityId;
|
||||
this->path = path;
|
||||
std::wstring skinValue = path.substr(7,path.size());
|
||||
skinValue = skinValue.substr(0,skinValue.find_first_of(L'.'));
|
||||
std::wstringstream ss;
|
||||
ss << std::dec << skinValue.c_str();
|
||||
ss >> dwSkinID;
|
||||
dwSkinID = MAKE_SKIN_BITMASK(true, dwSkinID);
|
||||
|
||||
TextureAndGeometryChangePacket::TextureAndGeometryChangePacket(
|
||||
std::shared_ptr<Entity> e, const std::wstring& path) {
|
||||
id = e->entityId;
|
||||
this->path = path;
|
||||
std::wstring skinValue = path.substr(7, path.size());
|
||||
skinValue = skinValue.substr(0, skinValue.find_first_of(L'.'));
|
||||
std::wstringstream ss;
|
||||
ss << std::dec << skinValue.c_str();
|
||||
ss >> dwSkinID;
|
||||
dwSkinID = MAKE_SKIN_BITMASK(true, dwSkinID);
|
||||
}
|
||||
|
||||
void TextureAndGeometryChangePacket::read(DataInputStream *dis) //throws IOException
|
||||
void TextureAndGeometryChangePacket::read(
|
||||
DataInputStream* dis) // throws IOException
|
||||
{
|
||||
id = dis->readInt();
|
||||
dwSkinID = static_cast<std::uint32_t>(dis->readInt());
|
||||
path = dis->readUTF();
|
||||
id = dis->readInt();
|
||||
dwSkinID = static_cast<std::uint32_t>(dis->readInt());
|
||||
path = dis->readUTF();
|
||||
}
|
||||
|
||||
void TextureAndGeometryChangePacket::write(DataOutputStream *dos) //throws IOException
|
||||
void TextureAndGeometryChangePacket::write(
|
||||
DataOutputStream* dos) // throws IOException
|
||||
{
|
||||
dos->writeInt(id);
|
||||
dos->writeInt(static_cast<int>(dwSkinID));
|
||||
dos->writeUTF(path);
|
||||
dos->writeInt(id);
|
||||
dos->writeInt(static_cast<int>(dwSkinID));
|
||||
dos->writeUTF(path);
|
||||
}
|
||||
|
||||
void TextureAndGeometryChangePacket::handle(PacketListener *listener)
|
||||
{
|
||||
listener->handleTextureAndGeometryChange(shared_from_this());
|
||||
void TextureAndGeometryChangePacket::handle(PacketListener* listener) {
|
||||
listener->handleTextureAndGeometryChange(shared_from_this());
|
||||
}
|
||||
|
||||
int TextureAndGeometryChangePacket::getEstimatedSize()
|
||||
{
|
||||
return 8 + (int)path.size();
|
||||
int TextureAndGeometryChangePacket::getEstimatedSize() {
|
||||
return 8 + (int)path.size();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user