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/PistonBaseTile.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Minecraft.World/PistonBaseTile.cpp') diff --git a/Minecraft.World/PistonBaseTile.cpp b/Minecraft.World/PistonBaseTile.cpp index e8e2a713..c71bbf95 100644 --- a/Minecraft.World/PistonBaseTile.cpp +++ b/Minecraft.World/PistonBaseTile.cpp @@ -28,7 +28,7 @@ DWORD PistonBaseTile::tlsIdx = TlsAlloc(); // 4J - ignoreUpdate is a static in java, implementing as TLS here to make thread safe bool PistonBaseTile::ignoreUpdate() { - return (TlsGetValue(tlsIdx) != nullptr); + return (TlsGetValue(tlsIdx) != NULL); } void PistonBaseTile::ignoreUpdate(bool set) @@ -45,9 +45,9 @@ PistonBaseTile::PistonBaseTile(int id, bool isSticky) : Tile(id, Material::pisto setSoundType(SOUND_STONE); setDestroyTime(0.5f); - iconInside = nullptr; - iconBack = nullptr; - iconPlatform = nullptr; + iconInside = NULL; + iconBack = NULL; + iconPlatform = NULL; } Icon *PistonBaseTile::getPlatformTexture() @@ -75,7 +75,7 @@ Icon *PistonBaseTile::getTexture(int face, int data) // when the piston is extended, either normally // or because a piston arm animation, the top // texture is the furnace bottom - ThreadStorage *tls = static_cast(TlsGetValue(Tile::tlsIdxShape)); + ThreadStorage *tls = (ThreadStorage *)TlsGetValue(Tile::tlsIdxShape); if (isExtended(data) || tls->xx0 > 0 || tls->yy0 > 0 || tls->zz0 > 0 || tls->xx1 < 1 || tls->yy1 < 1 || tls->zz1 < 1) { return iconInside; @@ -97,7 +97,7 @@ Icon *PistonBaseTile::getTexture(const wstring &name) if (name.compare(PLATFORM_STICKY_TEX) == 0) return Tile::pistonStickyBase->iconPlatform; if (name.compare(INSIDE_TEX) == 0) return Tile::pistonBase->iconInside; - return nullptr; + return NULL; } //@Override @@ -144,7 +144,7 @@ void PistonBaseTile::neighborChanged(Level *level, int x, int y, int z, int type void PistonBaseTile::onPlace(Level *level, int x, int y, int z) { - if (!level->isClientSide && level->getTileEntity(x, y, z) == nullptr && !ignoreUpdate()) + if (!level->isClientSide && level->getTileEntity(x, y, z) == NULL && !ignoreUpdate()) { checkIfExtend(level, x, y, z); } @@ -255,7 +255,7 @@ bool PistonBaseTile::triggerEvent(Level *level, int x, int y, int z, int param1, { PIXBeginNamedEvent(0,"Contract phase A\n"); shared_ptr prevTileEntity = level->getTileEntity(x + Facing::STEP_X[facing], y + Facing::STEP_Y[facing], z + Facing::STEP_Z[facing]); - if (prevTileEntity != nullptr && dynamic_pointer_cast(prevTileEntity) != nullptr) + if (prevTileEntity != NULL && dynamic_pointer_cast(prevTileEntity) != NULL) { dynamic_pointer_cast(prevTileEntity)->finalTick(); } @@ -285,7 +285,7 @@ bool PistonBaseTile::triggerEvent(Level *level, int x, int y, int z, int param1, // the block two steps away is a moving piston block piece, so replace it with the real data, // since it's probably this piston which is changing too fast shared_ptr tileEntity = level->getTileEntity(twoX, twoY, twoZ); - if (tileEntity != nullptr && dynamic_pointer_cast(tileEntity) != nullptr ) + if (tileEntity != NULL && dynamic_pointer_cast(tileEntity) != NULL ) { shared_ptr ppe = dynamic_pointer_cast(tileEntity); @@ -412,7 +412,7 @@ bool PistonBaseTile::isExtended(int data) int PistonBaseTile::getNewFacing(Level *level, int x, int y, int z, shared_ptr player) { - if (Mth::abs(static_cast(player->x) - x) < 2 && Mth::abs(static_cast(player->z) - z) < 2) + if (Mth::abs((float) player->x - x) < 2 && Mth::abs((float) player->z - z) < 2) { // If the player is above the block, the slot is on the top double py = player->y + 1.82 - player->heightOffset; -- cgit v1.2.3