Some code updates

This commit is contained in:
GabsPuNs
2026-04-09 00:57:05 -04:00
parent fb12bc0860
commit abd2d848cf
59 changed files with 241 additions and 257 deletions

View File

@@ -795,7 +795,7 @@ void ClientConnection::handleSetEntityMotion(shared_ptr<SetEntityMotionPacket> p
{
if (!shouldProcessForEntity(packet->id))
{
if (minecraft->localplayers[m_userIndex] == NULL ||
if (minecraft->localplayers[m_userIndex] == nullptr ||
packet->id != minecraft->localplayers[m_userIndex]->entityId)
return;
}
@@ -1186,7 +1186,7 @@ void ClientConnection::handleMovePlayer(shared_ptr<MovePlayerPacket> packet)
// 4J Added
void ClientConnection::handleChunkVisibilityArea(shared_ptr<ChunkVisibilityAreaPacket> packet)
{
if (level == NULL) return;
if (level == nullptr) return;
for(int z = packet->m_minZ; z <= packet->m_maxZ; ++z)
{
for(int x = packet->m_minX; x <= packet->m_maxX; ++x)
@@ -1199,7 +1199,7 @@ void ClientConnection::handleChunkVisibilityArea(shared_ptr<ChunkVisibilityAreaP
void ClientConnection::handleChunkVisibility(shared_ptr<ChunkVisibilityPacket> packet)
{
if (level == NULL) return;
if (level == nullptr) return;
if (packet->visible)
{
m_visibleChunks.insert(chunkKey(packet->x, packet->z));
@@ -2996,7 +2996,7 @@ void ClientConnection::handleExplosion(shared_ptr<ExplodePacket> packet)
// Per-player knockback — each connection applies to its own local player
//app.DebugPrintf("Adding knockback (%f,%f,%f) for player %d\n", packet->getKnockbackX(), packet->getKnockbackY(), packet->getKnockbackZ(), m_userIndex);
if (minecraft->localplayers[m_userIndex] == NULL)
if (minecraft->localplayers[m_userIndex] == nullptr)
return;
minecraft->localplayers[m_userIndex]->xd += packet->getKnockbackX();
minecraft->localplayers[m_userIndex]->yd += packet->getKnockbackY();
@@ -3007,7 +3007,7 @@ void ClientConnection::handleContainerOpen(shared_ptr<ContainerOpenPacket> packe
{
bool failed = false;
shared_ptr<MultiplayerLocalPlayer> player = minecraft->localplayers[m_userIndex];
if (player == NULL)
if (player == nullptr)
return;
switch(packet->type)
{