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/PistonMovingPiece.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'Minecraft.World/PistonMovingPiece.cpp') diff --git a/Minecraft.World/PistonMovingPiece.cpp b/Minecraft.World/PistonMovingPiece.cpp index 5ae01007..5fa9a475 100644 --- a/Minecraft.World/PistonMovingPiece.cpp +++ b/Minecraft.World/PistonMovingPiece.cpp @@ -23,7 +23,7 @@ void PistonMovingPiece::onPlace(Level *level, int x, int y, int z) void PistonMovingPiece::onRemove(Level *level, int x, int y, int z, int id, int data) { shared_ptr tileEntity = level->getTileEntity(x, y, z); - if (tileEntity != nullptr && dynamic_pointer_cast(tileEntity) != nullptr) + if (tileEntity != NULL && dynamic_pointer_cast(tileEntity) != NULL) { dynamic_pointer_cast(tileEntity)->finalTick(); } @@ -62,7 +62,7 @@ bool PistonMovingPiece::use(Level *level, int x, int y, int z, shared_ptrisClientSide && level->getTileEntity(x, y, z) == nullptr) + if (!level->isClientSide && level->getTileEntity(x, y, z) == NULL) { // this block is no longer valid level->removeTile(x, y, z); @@ -81,7 +81,7 @@ void PistonMovingPiece::spawnResources(Level *level, int x, int y, int z, int da if (level->isClientSide) return; shared_ptr entity = getEntity(level, x, y, z); - if (entity == nullptr) + if (entity == NULL) { return; } @@ -93,21 +93,21 @@ void PistonMovingPiece::neighborChanged(Level *level, int x, int y, int z, int t { if (!level->isClientSide) { - level->getTileEntity(x, y, z) == nullptr; + level->getTileEntity(x, y, z) == NULL; } } shared_ptr PistonMovingPiece::newMovingPieceEntity(int block, int data, int facing, bool extending, bool isSourcePiston) { - return std::make_shared(block, data, facing, extending, isSourcePiston); + return shared_ptr(new PistonPieceEntity(block, data, facing, extending, isSourcePiston)); } AABB *PistonMovingPiece::getAABB(Level *level, int x, int y, int z) { shared_ptr entity = getEntity(level, x, y, z); - if (entity == nullptr) + if (entity == NULL) { - return nullptr; + return NULL; } // move the aabb depending on the animation @@ -122,11 +122,11 @@ AABB *PistonMovingPiece::getAABB(Level *level, int x, int y, int z) void PistonMovingPiece::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param { shared_ptr entity = dynamic_pointer_cast(forceEntity); - if( entity == nullptr ) entity = getEntity(level, x, y, z); - if (entity != nullptr) + if( entity == NULL ) entity = getEntity(level, x, y, z); + if (entity != NULL) { Tile *tile = Tile::tiles[entity->getId()]; - if (tile == nullptr || tile == this) + if (tile == NULL || tile == this) { return; } @@ -138,7 +138,7 @@ void PistonMovingPiece::updateShape(LevelSource *level, int x, int y, int z, int progress = 1.0f - progress; } int facing = entity->getFacing(); - ThreadStorage *tls = static_cast(TlsGetValue(Tile::tlsIdxShape)); + ThreadStorage *tls = (ThreadStorage *)TlsGetValue(Tile::tlsIdxShape); tls->xx0 = tile->getShapeX0() - Facing::STEP_X[facing] * progress; tls->yy0 = tile->getShapeY0() - Facing::STEP_Y[facing] * progress; tls->zz0 = tile->getShapeZ0() - Facing::STEP_Z[facing] * progress; @@ -152,13 +152,13 @@ AABB *PistonMovingPiece::getAABB(Level *level, int x, int y, int z, int tile, fl { if (tile == 0 || tile == id) { - return nullptr; + return NULL; } AABB *aabb = Tile::tiles[tile]->getAABB(level, x, y, z); - if (aabb == nullptr) + if (aabb == NULL) { - return nullptr; + return NULL; } // move the aabb depending on the animation @@ -192,7 +192,7 @@ AABB *PistonMovingPiece::getAABB(Level *level, int x, int y, int z, int tile, fl shared_ptr PistonMovingPiece::getEntity(LevelSource *level, int x, int y, int z) { shared_ptr tileEntity = level->getTileEntity(x, y, z); - if (tileEntity != nullptr && dynamic_pointer_cast(tileEntity) != nullptr) + if (tileEntity != NULL && dynamic_pointer_cast(tileEntity) != NULL) { return dynamic_pointer_cast(tileEntity); } -- cgit v1.2.3