mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-25 04:55:12 +00:00
chore: format Minecraft.World
This commit is contained in:
@@ -5,67 +5,60 @@
|
||||
#include "../../Headers/net.minecraft.world.level.tile.entity.h"
|
||||
#include "SignUpdatePacket.h"
|
||||
|
||||
|
||||
|
||||
SignUpdatePacket::SignUpdatePacket()
|
||||
{
|
||||
shouldDelay = true;
|
||||
m_bVerified=false;
|
||||
m_bCensored=false;
|
||||
x = 0;
|
||||
y = 0;
|
||||
z = 0;
|
||||
|
||||
SignUpdatePacket::SignUpdatePacket() {
|
||||
shouldDelay = true;
|
||||
m_bVerified = false;
|
||||
m_bCensored = false;
|
||||
x = 0;
|
||||
y = 0;
|
||||
z = 0;
|
||||
}
|
||||
|
||||
SignUpdatePacket::SignUpdatePacket(int x, int y, int z, bool bVerified, bool bCensored, std::wstring lines[])
|
||||
{
|
||||
shouldDelay = true;
|
||||
this->m_bVerified=bVerified;
|
||||
this->m_bCensored=bCensored;
|
||||
this->x = x;
|
||||
this->y = y;
|
||||
this->z = z;
|
||||
for( int i = 0; i < MAX_SIGN_LINES; i++ ) this->lines[i] = lines[i];
|
||||
SignUpdatePacket::SignUpdatePacket(int x, int y, int z, bool bVerified,
|
||||
bool bCensored, std::wstring lines[]) {
|
||||
shouldDelay = true;
|
||||
this->m_bVerified = bVerified;
|
||||
this->m_bCensored = bCensored;
|
||||
this->x = x;
|
||||
this->y = y;
|
||||
this->z = z;
|
||||
for (int i = 0; i < MAX_SIGN_LINES; i++) this->lines[i] = lines[i];
|
||||
}
|
||||
|
||||
void SignUpdatePacket::read(DataInputStream *dis) //throws IOException
|
||||
void SignUpdatePacket::read(DataInputStream* dis) // throws IOException
|
||||
{
|
||||
x = dis->readInt();
|
||||
y = dis->readShort();
|
||||
z = dis->readInt();
|
||||
this->m_bVerified=dis->readBoolean();
|
||||
this->m_bCensored=dis->readBoolean();;
|
||||
for (int i = 0; i < MAX_SIGN_LINES; i++)
|
||||
lines[i] = readUtf(dis, SignTileEntity::MAX_LINE_LENGTH);
|
||||
x = dis->readInt();
|
||||
y = dis->readShort();
|
||||
z = dis->readInt();
|
||||
this->m_bVerified = dis->readBoolean();
|
||||
this->m_bCensored = dis->readBoolean();
|
||||
;
|
||||
for (int i = 0; i < MAX_SIGN_LINES; i++)
|
||||
lines[i] = readUtf(dis, SignTileEntity::MAX_LINE_LENGTH);
|
||||
}
|
||||
|
||||
void SignUpdatePacket::write(DataOutputStream *dos) //throws IOException
|
||||
void SignUpdatePacket::write(DataOutputStream* dos) // throws IOException
|
||||
{
|
||||
dos->writeInt(x);
|
||||
dos->writeShort(y);
|
||||
dos->writeInt(z);
|
||||
dos->writeBoolean(m_bVerified);
|
||||
dos->writeBoolean(m_bCensored);
|
||||
for (int i = 0; i < MAX_SIGN_LINES; i++)
|
||||
writeUtf(lines[i], dos);
|
||||
dos->writeInt(x);
|
||||
dos->writeShort(y);
|
||||
dos->writeInt(z);
|
||||
dos->writeBoolean(m_bVerified);
|
||||
dos->writeBoolean(m_bCensored);
|
||||
for (int i = 0; i < MAX_SIGN_LINES; i++) writeUtf(lines[i], dos);
|
||||
}
|
||||
|
||||
void SignUpdatePacket::handle(PacketListener *listener)
|
||||
{
|
||||
listener->handleSignUpdate(shared_from_this());
|
||||
void SignUpdatePacket::handle(PacketListener* listener) {
|
||||
listener->handleSignUpdate(shared_from_this());
|
||||
}
|
||||
|
||||
int SignUpdatePacket::getEstimatedSize()
|
||||
{
|
||||
int l = 0;
|
||||
l+=sizeof(int);
|
||||
l+=sizeof(short);
|
||||
l+=sizeof(int);
|
||||
l+=sizeof(uint8_t);
|
||||
l+=sizeof(uint8_t);
|
||||
int SignUpdatePacket::getEstimatedSize() {
|
||||
int l = 0;
|
||||
l += sizeof(int);
|
||||
l += sizeof(short);
|
||||
l += sizeof(int);
|
||||
l += sizeof(uint8_t);
|
||||
l += sizeof(uint8_t);
|
||||
|
||||
for (int i = 0; i < MAX_SIGN_LINES; i++)
|
||||
l += (int)lines[i].length();
|
||||
return l;
|
||||
for (int i = 0; i < MAX_SIGN_LINES; i++) l += (int)lines[i].length();
|
||||
return l;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user