From 087b7e7abfe81dd7f0fdcdea36ac9f245950df1a Mon Sep 17 00:00:00 2001 From: Loki Rautio Date: Sat, 7 Mar 2026 21:12:22 -0600 Subject: Revert "Project modernization (#630)" This code was not tested and breaks in Release builds, reverting to restore functionality of the nightly. All in-game menus do not work and generating a world crashes. This reverts commit a9be52c41a02d207233199e98898fe7483d7e817. --- Minecraft.World/HangingEntity.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'Minecraft.World/HangingEntity.cpp') diff --git a/Minecraft.World/HangingEntity.cpp b/Minecraft.World/HangingEntity.cpp index 67d53114..26261710 100644 --- a/Minecraft.World/HangingEntity.cpp +++ b/Minecraft.World/HangingEntity.cpp @@ -35,16 +35,16 @@ HangingEntity::HangingEntity(Level *level, int xTile, int yTile, int zTile, int void HangingEntity::setDir(int dir) { this->dir = dir; - yRotO = yRot = static_cast(dir * 90); + yRotO = yRot = (float)(dir * 90); - float w = static_cast(getWidth()); - float h = static_cast(getHeight()); - float d = static_cast(getWidth()); + float w = (float)getWidth(); + float h = (float)getHeight(); + float d = (float)getWidth(); if (dir == Direction::NORTH || dir == Direction::SOUTH) { d = 0.5f; - yRot = yRotO = static_cast(Direction::DIRECTION_OPPOSITE[dir] * 90); + yRot = yRotO = (float)(Direction::DIRECTION_OPPOSITE[dir] * 90); } else { @@ -150,7 +150,7 @@ bool HangingEntity::survives() vector > *entities = level->getEntities(shared_from_this(), bb); - if (entities != nullptr && entities->size() > 0) + if (entities != NULL && entities->size() > 0) { for (auto& e : *entities) { @@ -184,11 +184,11 @@ bool HangingEntity::hurt(DamageSource *source, float damage) if (isInvulnerable()) return false; if (!removed && !level->isClientSide) { - if (dynamic_cast(source) != nullptr) + if (dynamic_cast(source) != NULL) { shared_ptr sourceEntity = source->getDirectEntity(); - if ( (sourceEntity != nullptr) && sourceEntity->instanceof(eTYPE_PLAYER) && !dynamic_pointer_cast(sourceEntity)->isAllowedToHurtEntity(shared_from_this()) ) + if ( (sourceEntity != NULL) && sourceEntity->instanceof(eTYPE_PLAYER) && !dynamic_pointer_cast(sourceEntity)->isAllowedToHurtEntity(shared_from_this()) ) { return false; } @@ -199,12 +199,12 @@ bool HangingEntity::hurt(DamageSource *source, float damage) shared_ptr player = nullptr; shared_ptr e = source->getEntity(); - if ( (e!=nullptr) && e->instanceof(eTYPE_PLAYER) ) // check if it's serverplayer or player + if ( (e!=NULL) && e->instanceof(eTYPE_PLAYER) ) // check if it's serverplayer or player { player = dynamic_pointer_cast( e ); } - if (player != nullptr && player->abilities.instabuild) + if (player != NULL && player->abilities.instabuild) { return true; } @@ -235,7 +235,7 @@ void HangingEntity::push(double xa, double ya, double za) void HangingEntity::addAdditonalSaveData(CompoundTag *tag) { - tag->putByte(L"Direction", static_cast(dir)); + tag->putByte(L"Direction", (byte) dir); tag->putInt(L"TileX", xTile); tag->putInt(L"TileY", yTile); tag->putInt(L"TileZ", zTile); -- cgit v1.2.3