aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/TntTile.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.World/TntTile.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.World/TntTile.cpp')
-rw-r--r--Minecraft.World/TntTile.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/Minecraft.World/TntTile.cpp b/Minecraft.World/TntTile.cpp
index b422959c..5d47a2ac 100644
--- a/Minecraft.World/TntTile.cpp
+++ b/Minecraft.World/TntTile.cpp
@@ -53,13 +53,13 @@ void TntTile::wasExploded(Level *level, int x, int y, int z)
{
// 4J - added - don't every create on the client, I think this must be the cause of a bug reported in the java
// version where white tnts are created in the network game
- if (level->isClientSide) return;
+ if (level->isClientSide) return;
// 4J - added condition to have finite limit of these
// 4J-JEV: Fix for #90934 - Customer Encountered: TU11: Content: Gameplay: TNT blocks are triggered by explosions even though "TNT explodes" option is unchecked.
if( level->newPrimedTntAllowed() && app.GetGameHostOption(eGameHostOption_TNT) )
{
- shared_ptr<PrimedTnt> primed = shared_ptr<PrimedTnt>( new PrimedTnt(level, x + 0.5f, y + 0.5f, z + 0.5f) );
+ std::shared_ptr<PrimedTnt> primed = std::shared_ptr<PrimedTnt>( new PrimedTnt(level, x + 0.5f, y + 0.5f, z + 0.5f) );
primed->life = level->random->nextInt(primed->life / 4) + primed->life / 8;
level->addEntity(primed);
}
@@ -74,14 +74,14 @@ void TntTile::destroy(Level *level, int x, int y, int z, int data)
// 4J - added condition to have finite limit of these
if( level->newPrimedTntAllowed() && app.GetGameHostOption(eGameHostOption_TNT) )
{
- shared_ptr<PrimedTnt> tnt = shared_ptr<PrimedTnt>( new PrimedTnt(level, x + 0.5f, y + 0.5f, z + 0.5f) );
+ std::shared_ptr<PrimedTnt> tnt = std::shared_ptr<PrimedTnt>( new PrimedTnt(level, x + 0.5f, y + 0.5f, z + 0.5f) );
level->addEntity(tnt);
level->playSound(tnt, eSoundType_RANDOM_FUSE, 1, 1.0f);
}
}
}
-bool TntTile::use(Level *level, int x, int y, int z, shared_ptr<Player> player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param
+bool TntTile::use(Level *level, int x, int y, int z, std::shared_ptr<Player> player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param
{
if (soundOnly) return false;
if (player->getSelectedItem() != NULL && player->getSelectedItem()->id == Item::flintAndSteel_Id)
@@ -93,12 +93,12 @@ bool TntTile::use(Level *level, int x, int y, int z, shared_ptr<Player> player,
return Tile::use(level, x, y, z, player, clickedFace, clickX, clickY, clickZ);
}
-void TntTile::entityInside(Level *level, int x, int y, int z, shared_ptr<Entity> entity)
+void TntTile::entityInside(Level *level, int x, int y, int z, std::shared_ptr<Entity> entity)
{
if (entity->GetType() == eTYPE_ARROW && !level->isClientSide)
{
// 4J Stu - Don't need to cast this
- //shared_ptr<Arrow> arrow = dynamic_pointer_cast<Arrow>(entity);
+ //std::shared_ptr<Arrow> arrow = dynamic_pointer_cast<Arrow>(entity);
if (entity->isOnFire())
{
destroy(level, x, y, z, EXPLODE_BIT);
@@ -107,12 +107,12 @@ void TntTile::entityInside(Level *level, int x, int y, int z, shared_ptr<Entity>
}
}
-shared_ptr<ItemInstance> TntTile::getSilkTouchItemInstance(int data)
+std::shared_ptr<ItemInstance> TntTile::getSilkTouchItemInstance(int data)
{
return nullptr;
}
-void TntTile::registerIcons(IconRegister *iconRegister)
+void TntTile::registerIcons(IconRegister *iconRegister)
{
icon = iconRegister->registerIcon(L"tnt_side");
iconTop = iconRegister->registerIcon(L"tnt_top");