aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp
diff options
context:
space:
mode:
authorvoid_17 <heroerror3@gmail.com>2026-03-02 15:58:20 +0700
committervoid_17 <heroerror3@gmail.com>2026-03-02 15:58:20 +0700
commit7074f35e4ba831e358117842b99ee35b87f85ae5 (patch)
tree7d440d23473196af3056bf2ff4c59d9e740a06f5 /Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp
parentd63f79325f85e014361eb8cf1e41eaebedb1ae71 (diff)
shared_ptr -> std::shared_ptr
This is one of the first commits in a plan to remove all `using namespace std;` lines in the entire codebase as it is considered anti-pattern today.
Diffstat (limited to 'Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp')
-rw-r--r--Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp b/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp
index 0eef096b..5f4bc737 100644
--- a/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp
+++ b/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp
@@ -116,7 +116,7 @@ void ConsoleSchematicFile::load(DataInputStream *dis)
for (int i = 0; i < tileEntityTags->size(); i++)
{
CompoundTag *teTag = tileEntityTags->get(i);
- shared_ptr<TileEntity> te = TileEntity::loadStatic(teTag);
+ std::shared_ptr<TileEntity> te = TileEntity::loadStatic(teTag);
if(te == NULL)
{
@@ -433,7 +433,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
{
for(AUTO_VAR(it, m_tileEntities.begin()); it != m_tileEntities.end();++it)
{
- shared_ptr<TileEntity> te = *it;
+ std::shared_ptr<TileEntity> te = *it;
double targetX = te->x;
double targetY = te->y + destinationBox->y0;
@@ -444,7 +444,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
Vec3 *pos = Vec3::newTemp(targetX,targetY,targetZ);
if( chunkBox->containsIncludingLowerBound(pos) )
{
- shared_ptr<TileEntity> teCopy = chunk->getTileEntity( (int)targetX & 15, (int)targetY & 15, (int)targetZ & 15 );
+ std::shared_ptr<TileEntity> teCopy = chunk->getTileEntity( (int)targetX & 15, (int)targetY & 15, (int)targetZ & 15 );
if ( teCopy != NULL )
{
@@ -495,11 +495,11 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
}
CompoundTag *eTag = it->second;
- shared_ptr<Entity> e = EntityIO::loadStatic(eTag, NULL);
+ std::shared_ptr<Entity> e = EntityIO::loadStatic(eTag, NULL);
if( e->GetType() == eTYPE_PAINTING )
{
- shared_ptr<Painting> painting = dynamic_pointer_cast<Painting>(e);
+ std::shared_ptr<Painting> painting = dynamic_pointer_cast<Painting>(e);
double tileX = painting->xTile;
double tileZ = painting->zTile;
@@ -512,7 +512,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
}
else if( e->GetType() == eTYPE_ITEM_FRAME )
{
- shared_ptr<ItemFrame> frame = dynamic_pointer_cast<ItemFrame>(e);
+ std::shared_ptr<ItemFrame> frame = dynamic_pointer_cast<ItemFrame>(e);
double tileX = frame->xTile;
double tileZ = frame->zTile;
@@ -678,12 +678,12 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
{
for (int zc = zc0; zc <= zc1; zc++)
{
- vector<shared_ptr<TileEntity> > *tileEntities = getTileEntitiesInRegion(level->getChunk(xc, zc), xStart, yStart, zStart, xStart + xSize, yStart + ySize, zStart + zSize);
+ vector<std::shared_ptr<TileEntity> > *tileEntities = getTileEntitiesInRegion(level->getChunk(xc, zc), xStart, yStart, zStart, xStart + xSize, yStart + ySize, zStart + zSize);
for(AUTO_VAR(it, tileEntities->begin()); it != tileEntities->end(); ++it)
{
- shared_ptr<TileEntity> te = *it;
+ std::shared_ptr<TileEntity> te = *it;
CompoundTag *teTag = new CompoundTag();
- shared_ptr<TileEntity> teCopy = te->clone();
+ std::shared_ptr<TileEntity> teCopy = te->clone();
// Adjust the tileEntity position to schematic coords from world co-ords
teCopy->x -= xStart;
@@ -698,12 +698,12 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
tag.put(L"TileEntities", tileEntitiesTag);
AABB *bb = AABB::newTemp(xStart,yStart,zStart,xEnd,yEnd,zEnd);
- vector<shared_ptr<Entity> > *entities = level->getEntities(nullptr, bb);
+ vector<std::shared_ptr<Entity> > *entities = level->getEntities(nullptr, bb);
ListTag<CompoundTag> *entitiesTag = new ListTag<CompoundTag>(L"entities");
for(AUTO_VAR(it, entities->begin()); it != entities->end(); ++it)
{
- shared_ptr<Entity> e = *it;
+ std::shared_ptr<Entity> e = *it;
bool mobCanBeSaved = false;
if(bSaveMobs)
@@ -1005,12 +1005,12 @@ void ConsoleSchematicFile::setBlocksAndData(LevelChunk *chunk, byteArray blockDa
}
}
-vector<shared_ptr<TileEntity> > *ConsoleSchematicFile::getTileEntitiesInRegion(LevelChunk *chunk, int x0, int y0, int z0, int x1, int y1, int z1)
+vector<std::shared_ptr<TileEntity> > *ConsoleSchematicFile::getTileEntitiesInRegion(LevelChunk *chunk, int x0, int y0, int z0, int x1, int y1, int z1)
{
- vector<shared_ptr<TileEntity> > *result = new vector<shared_ptr<TileEntity> >;
+ vector<std::shared_ptr<TileEntity> > *result = new vector<std::shared_ptr<TileEntity> >;
for (AUTO_VAR(it, chunk->tileEntities.begin()); it != chunk->tileEntities.end(); ++it)
{
- shared_ptr<TileEntity> te = it->second;
+ std::shared_ptr<TileEntity> te = it->second;
if (te->x >= x0 && te->y >= y0 && te->z >= z0 && te->x < x1 && te->y < y1 && te->z < z1)
{
result->push_back(te);