aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/StructurePiece.cpp
diff options
context:
space:
mode:
authorqwasdrizzel <145519042+qwasdrizzel@users.noreply.github.com>2026-03-05 17:17:45 -0600
committerGitHub <noreply@github.com>2026-03-05 17:17:45 -0600
commit0666959d312dc74903f55d1071488a90239330f1 (patch)
tree5c6886f7ec65a7828bc6e34a469514e418bcf78b /Minecraft.World/StructurePiece.cpp
parent9370cbc7d878df1615d8ce76bc459e8b414d0f19 (diff)
parenteed770b121aa4ce38f002db042d0137c24c6d344 (diff)
Merge branch 'smartcmd:main' into main
Diffstat (limited to 'Minecraft.World/StructurePiece.cpp')
-rw-r--r--Minecraft.World/StructurePiece.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/Minecraft.World/StructurePiece.cpp b/Minecraft.World/StructurePiece.cpp
index cd483a6e..85a19ab4 100644
--- a/Minecraft.World/StructurePiece.cpp
+++ b/Minecraft.World/StructurePiece.cpp
@@ -14,7 +14,7 @@
#include "DoorItem.h"
/**
-*
+*
* A structure piece is a construction or room, located somewhere in the world
* with a given orientatino (out of Direction.java). Structure pieces have a
* bounding box that says where the piece is located and its bounds, and the
@@ -113,10 +113,9 @@ bool StructurePiece::isInChunk( ChunkPos* pos )
StructurePiece* StructurePiece::findCollisionPiece( list< StructurePiece* > *pieces, BoundingBox* box )
{
- for ( AUTO_VAR(it, pieces->begin()); it != pieces->end(); it++ )
+ for (auto& piece : *pieces)
{
- StructurePiece* piece = *it;
- if ( piece->getBoundingBox() != NULL && piece->getBoundingBox()->intersects( box ) )
+ if ( piece && piece->getBoundingBox() && piece->getBoundingBox()->intersects( box ) )
{
return piece;
}
@@ -125,7 +124,7 @@ StructurePiece* StructurePiece::findCollisionPiece( list< StructurePiece* > *pie
}
// 4J-PB - Added from 1.2.3
-TilePos *StructurePiece::getLocatorPosition()
+TilePos *StructurePiece::getLocatorPosition()
{
return new TilePos(boundingBox->getXCenter(), boundingBox->getYCenter(), boundingBox->getZCenter());
}
@@ -559,7 +558,7 @@ void StructurePiece::placeBlock( Level* level, int block, int data, int x, int y
* The purpose of this method is to wrap the getTile call on Level, in order
* to prevent the level from generating chunks that shouldn't be loaded yet.
* Returns 0 if the call is out of bounds.
-*
+*
* @param level
* @param x
* @param y