From 7074f35e4ba831e358117842b99ee35b87f85ae5 Mon Sep 17 00:00:00 2001 From: void_17 Date: Mon, 2 Mar 2026 15:58:20 +0700 Subject: 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. --- Minecraft.World/LeafTile.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Minecraft.World/LeafTile.cpp') diff --git a/Minecraft.World/LeafTile.cpp b/Minecraft.World/LeafTile.cpp index 8b7d381c..bed4a7ca 100644 --- a/Minecraft.World/LeafTile.cpp +++ b/Minecraft.World/LeafTile.cpp @@ -241,17 +241,17 @@ void LeafTile::spawnResources(Level *level, int x, int y, int z, int data, float if (level->random->nextInt(chance) == 0) { int type = getResource(data, level->random,playerBonusLevel); - popResource(level, x, y, z, shared_ptr( new ItemInstance(type, 1, getSpawnResourcesAuxValue(data)))); + popResource(level, x, y, z, std::shared_ptr( new ItemInstance(type, 1, getSpawnResourcesAuxValue(data)))); } if ((data & LEAF_TYPE_MASK) == NORMAL_LEAF && level->random->nextInt(200) == 0) { - popResource(level, x, y, z, shared_ptr(new ItemInstance(Item::apple_Id, 1, 0))); + popResource(level, x, y, z, std::shared_ptr(new ItemInstance(Item::apple_Id, 1, 0))); } } } -void LeafTile::playerDestroy(Level *level, shared_ptr player, int x, int y, int z, int data) +void LeafTile::playerDestroy(Level *level, std::shared_ptr player, int x, int y, int z, int data) { if (!level->isClientSide && player->getSelectedItem() != NULL && player->getSelectedItem()->id == Item::shears->id) { @@ -261,7 +261,7 @@ void LeafTile::playerDestroy(Level *level, shared_ptr player, int x, int ); // drop leaf block instead of sapling - popResource(level, x, y, z, shared_ptr(new ItemInstance(Tile::leaves_Id, 1, data & LEAF_TYPE_MASK))); + popResource(level, x, y, z, std::shared_ptr(new ItemInstance(Tile::leaves_Id, 1, data & LEAF_TYPE_MASK))); } else { @@ -301,12 +301,12 @@ void LeafTile::setFancy(bool fancyGraphics) fancyTextureSet = (fancyGraphics ? 0 : 1); } -shared_ptr LeafTile::getSilkTouchItemInstance(int data) +std::shared_ptr LeafTile::getSilkTouchItemInstance(int data) { - return shared_ptr( new ItemInstance(id, 1, data & LEAF_TYPE_MASK) ); + return std::shared_ptr( new ItemInstance(id, 1, data & LEAF_TYPE_MASK) ); } -void LeafTile::stepOn(Level *level, int x, int y, int z, shared_ptr entity) +void LeafTile::stepOn(Level *level, int x, int y, int z, std::shared_ptr entity) { TransparentTile::stepOn(level, x, y, z, entity); } -- cgit v1.2.3