diff options
| author | void_17 <heroerror3@gmail.com> | 2026-03-02 15:58:20 +0700 |
|---|---|---|
| committer | void_17 <heroerror3@gmail.com> | 2026-03-02 15:58:20 +0700 |
| commit | 7074f35e4ba831e358117842b99ee35b87f85ae5 (patch) | |
| tree | 7d440d23473196af3056bf2ff4c59d9e740a06f5 /Minecraft.World/SkullItem.cpp | |
| parent | d63f79325f85e014361eb8cf1e41eaebedb1ae71 (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.World/SkullItem.cpp')
| -rw-r--r-- | Minecraft.World/SkullItem.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Minecraft.World/SkullItem.cpp b/Minecraft.World/SkullItem.cpp index 643021dc..36825d9f 100644 --- a/Minecraft.World/SkullItem.cpp +++ b/Minecraft.World/SkullItem.cpp @@ -18,7 +18,7 @@ SkullItem::SkullItem(int id) : Item(id) setStackedByData(true); } -bool SkullItem::useOn(shared_ptr<ItemInstance> instance, shared_ptr<Player> player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) //float clickX, float clickY, float clickZ) +bool SkullItem::useOn(std::shared_ptr<ItemInstance> instance, std::shared_ptr<Player> player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) //float clickX, float clickY, float clickZ) { if (face == 0) return false; if (!level->getMaterial(x, y, z)->isSolid()) return false; @@ -45,8 +45,8 @@ bool SkullItem::useOn(shared_ptr<ItemInstance> instance, shared_ptr<Player> play rot = Mth::floor(((player->yRot) * 16) / 360 + 0.5) & 15; } - shared_ptr<TileEntity> skullTE = level->getTileEntity(x, y, z); - shared_ptr<SkullTileEntity> skull = dynamic_pointer_cast<SkullTileEntity>(skullTE); + std::shared_ptr<TileEntity> skullTE = level->getTileEntity(x, y, z); + std::shared_ptr<SkullTileEntity> skull = dynamic_pointer_cast<SkullTileEntity>(skullTE); if (skull != NULL) { @@ -65,7 +65,7 @@ bool SkullItem::useOn(shared_ptr<ItemInstance> instance, shared_ptr<Player> play return true; } -bool SkullItem::mayPlace(Level *level, int x, int y, int z, int face, shared_ptr<Player> player, shared_ptr<ItemInstance> item) +bool SkullItem::mayPlace(Level *level, int x, int y, int z, int face, std::shared_ptr<Player> player, std::shared_ptr<ItemInstance> item) { int currentTile = level->getTile(x, y, z); if (currentTile == Tile::topSnow_Id) @@ -108,7 +108,7 @@ unsigned int SkullItem::getDescriptionId(int iData) return NAMES[iData]; } -unsigned int SkullItem::getDescriptionId(shared_ptr<ItemInstance> instance) +unsigned int SkullItem::getDescriptionId(std::shared_ptr<ItemInstance> instance) { int auxValue = instance->getAuxValue(); if (auxValue < 0 || auxValue >= SKULL_COUNT) @@ -118,7 +118,7 @@ unsigned int SkullItem::getDescriptionId(shared_ptr<ItemInstance> instance) return NAMES[auxValue]; } -wstring SkullItem::getHoverName(shared_ptr<ItemInstance> itemInstance) +wstring SkullItem::getHoverName(std::shared_ptr<ItemInstance> itemInstance) { #if 0 if (itemInstance->getAuxValue() == SkullTileEntity::TYPE_CHAR && itemInstance->hasTag() && itemInstance->getTag()->contains(L"SkullOwner")) |
