diff options
| author | qwasdrizzel <145519042+qwasdrizzel@users.noreply.github.com> | 2026-03-16 21:44:26 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-16 21:44:26 -0500 |
| commit | ce739f6045ec72127491286ea3f3f21e537c1b55 (patch) | |
| tree | f33bd42a47c1b4a7b2153a7fb77127ee3b407db9 /Minecraft.World/RespawnPacket.cpp | |
| parent | 255a18fe8e9b57377975f82e2b227afe2a12eda0 (diff) | |
| parent | 5a59f5d146b43811dde6a5a0245ee9875d7b5cd1 (diff) | |
Merge branch 'smartcmd:main' into main
Diffstat (limited to 'Minecraft.World/RespawnPacket.cpp')
| -rw-r--r-- | Minecraft.World/RespawnPacket.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Minecraft.World/RespawnPacket.cpp b/Minecraft.World/RespawnPacket.cpp index 5c04bbeb..6dbebfac 100644 --- a/Minecraft.World/RespawnPacket.cpp +++ b/Minecraft.World/RespawnPacket.cpp @@ -5,21 +5,21 @@ #include "RespawnPacket.h" #include "LevelType.h" -RespawnPacket::RespawnPacket() +RespawnPacket::RespawnPacket() { this->dimension = 0; this->difficulty = 1; this->mapSeed = 0; this->mapHeight = 0; - this->playerGameType = NULL; + this->playerGameType = nullptr; this->m_newSeaLevel = false; - m_pLevelType = NULL; + m_pLevelType = nullptr; m_newEntityId = 0; m_xzSize = LEVEL_MAX_WIDTH; m_hellScale = HELL_LEVEL_MAX_SCALE; } -RespawnPacket::RespawnPacket(char dimension, __int64 mapSeed, int mapHeight, GameType *playerGameType, char difficulty, LevelType *pLevelType, bool newSeaLevel, int newEntityId, int xzSize, int hellScale) +RespawnPacket::RespawnPacket(char dimension, int64_t mapSeed, int mapHeight, GameType *playerGameType, char difficulty, LevelType *pLevelType, bool newSeaLevel, int newEntityId, int xzSize, int hellScale) { this->dimension = dimension; this->mapSeed = mapSeed; @@ -35,7 +35,7 @@ RespawnPacket::RespawnPacket(char dimension, __int64 mapSeed, int mapHeight, Gam } -void RespawnPacket::handle(PacketListener *listener) +void RespawnPacket::handle(PacketListener *listener) { listener->handleRespawn(shared_from_this()); } @@ -47,7 +47,7 @@ void RespawnPacket::read(DataInputStream *dis) //throws IOException mapHeight = dis->readShort(); wstring typeName = readUtf(dis, 16); m_pLevelType = LevelType::getLevelType(typeName); - if (m_pLevelType == NULL) + if (m_pLevelType == nullptr) { m_pLevelType = LevelType::lvl_normal; } @@ -63,16 +63,16 @@ void RespawnPacket::read(DataInputStream *dis) //throws IOException } -void RespawnPacket::write(DataOutputStream *dos) //throws IOException +void RespawnPacket::write(DataOutputStream *dos) //throws IOException { dos->writeByte(dimension); dos->writeByte(playerGameType->getId()); dos->writeShort(mapHeight); - if (m_pLevelType == NULL) + if (m_pLevelType == nullptr) { writeUtf(L"", dos); - } - else + } + else { writeUtf(m_pLevelType->getGeneratorName(), dos); } @@ -86,12 +86,12 @@ void RespawnPacket::write(DataOutputStream *dos) //throws IOException #endif } -int RespawnPacket::getEstimatedSize() +int RespawnPacket::getEstimatedSize() { int length=0; - if (m_pLevelType != NULL) + if (m_pLevelType != nullptr) { - length = (int)m_pLevelType->getGeneratorName().length(); + length = static_cast<int>(m_pLevelType->getGeneratorName().length()); } return 13+length; } |
