aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/StructurePiece.cpp
diff options
context:
space:
mode:
authorLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
committerLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
commit087b7e7abfe81dd7f0fdcdea36ac9f245950df1a (patch)
tree69454763e73ca764af4e682d3573080b13138a0e /Minecraft.World/StructurePiece.cpp
parenta9be52c41a02d207233199e98898fe7483d7e817 (diff)
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.
Diffstat (limited to 'Minecraft.World/StructurePiece.cpp')
-rw-r--r--Minecraft.World/StructurePiece.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/Minecraft.World/StructurePiece.cpp b/Minecraft.World/StructurePiece.cpp
index bb3887c0..85a19ab4 100644
--- a/Minecraft.World/StructurePiece.cpp
+++ b/Minecraft.World/StructurePiece.cpp
@@ -44,7 +44,7 @@
StructurePiece::StructurePiece()
{
- boundingBox = nullptr;
+ boundingBox = NULL;
orientation = 0;
genDepth = 0;
// for reflection
@@ -52,14 +52,14 @@ StructurePiece::StructurePiece()
StructurePiece::StructurePiece( int genDepth )
{
- boundingBox = nullptr;
+ boundingBox = NULL;
this->genDepth = genDepth;
orientation = Direction::UNDEFINED;
}
StructurePiece::~StructurePiece()
{
- if(boundingBox != nullptr) delete boundingBox;
+ if(boundingBox != NULL) delete boundingBox;
}
CompoundTag *StructurePiece::createTag()
@@ -120,7 +120,7 @@ StructurePiece* StructurePiece::findCollisionPiece( list< StructurePiece* > *pie
return piece;
}
}
- return nullptr;
+ return NULL;
}
// 4J-PB - Added from 1.2.3
@@ -437,7 +437,7 @@ int StructurePiece::getOrientationData( int tile, int data )
}
}
}
- else if (tile == Tile::tripWireSource_Id || (Tile::tiles[tile] != nullptr && dynamic_cast<DirectionalTile *>(Tile::tiles[tile])))
+ else if (tile == Tile::tripWireSource_Id || (Tile::tiles[tile] != NULL && dynamic_cast<DirectionalTile *>(Tile::tiles[tile])))
{
if (orientation == Direction::SOUTH)
{
@@ -730,15 +730,15 @@ void StructurePiece::maybeGenerateBlock( Level* level, BoundingBox* chunkBB, Ran
void StructurePiece::generateUpperHalfSphere( Level* level, BoundingBox* chunkBB, int x0, int y0, int z0, int x1,
int y1, int z1, int fillTile, bool skipAir )
{
- float diagX = static_cast<float>(x1 - x0 + 1);
- float diagY = static_cast<float>(y1 - y0 + 1);
- float diagZ = static_cast<float>(z1 - z0 + 1);
+ float diagX = (float)( x1 - x0 + 1 );
+ float diagY = (float)( y1 - y0 + 1 );
+ float diagZ = (float)( z1 - z0 + 1 );
float cx = x0 + diagX / 2;
float cz = z0 + diagZ / 2;
for ( int y = y0; y <= y1; y++ )
{
- float normalizedYDistance = static_cast<float>(y - y0) / diagY;
+ float normalizedYDistance = ( float )( y - y0 ) / diagY;
for ( int x = x0; x <= x1; x++ )
{
@@ -816,7 +816,7 @@ bool StructurePiece::createChest( Level* level, BoundingBox* chunkBB, Random* ra
{
level->setTileAndData( worldX, worldY, worldZ, Tile::chest->id, 0, Tile::UPDATE_CLIENTS );
shared_ptr<ChestTileEntity> chest = dynamic_pointer_cast<ChestTileEntity>(level->getTileEntity( worldX, worldY, worldZ ));
- if ( chest != nullptr ) WeighedTreasure::addChestItems( random, treasure, chest, numRolls );
+ if ( chest != NULL ) WeighedTreasure::addChestItems( random, treasure, chest, numRolls );
return true;
}
}
@@ -835,7 +835,7 @@ bool StructurePiece::createDispenser(Level *level, BoundingBox *chunkBB, Random
{
level->setTileAndData(worldX, worldY, worldZ, Tile::dispenser_Id, getOrientationData(Tile::dispenser_Id, facing), Tile::UPDATE_CLIENTS);
shared_ptr<DispenserTileEntity> dispenser = dynamic_pointer_cast<DispenserTileEntity>(level->getTileEntity(worldX, worldY, worldZ));
- if (dispenser != nullptr) WeighedTreasure::addDispenserItems(random, items, dispenser, numRolls);
+ if (dispenser != NULL) WeighedTreasure::addDispenserItems(random, items, dispenser, numRolls);
return true;
}
}