aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/PistonBaseTile.cpp
diff options
context:
space:
mode:
authorvoid_17 <heroerror3@gmail.com>2026-03-02 17:37:16 +0700
committervoid_17 <heroerror3@gmail.com>2026-03-02 17:37:16 +0700
commit119bff351450ea16ffda550b6e0f67379b29f708 (patch)
treed9f28714afd516bc2450f33b0a77c5e05ff4de90 /Minecraft.World/PistonBaseTile.cpp
parent8a2a62ea1d47364f802cf9aae97668bc4a7007b5 (diff)
Revert "shared_ptr -> std::shared_ptr"
This reverts commit 7074f35e4ba831e358117842b99ee35b87f85ae5.
Diffstat (limited to 'Minecraft.World/PistonBaseTile.cpp')
-rw-r--r--Minecraft.World/PistonBaseTile.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/Minecraft.World/PistonBaseTile.cpp b/Minecraft.World/PistonBaseTile.cpp
index ab8199c3..cbad5cec 100644
--- a/Minecraft.World/PistonBaseTile.cpp
+++ b/Minecraft.World/PistonBaseTile.cpp
@@ -119,12 +119,12 @@ bool PistonBaseTile::isSolidRender(bool isServerLevel)
return false;
}
-bool PistonBaseTile::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
+bool PistonBaseTile::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
{
return false;
}
-void PistonBaseTile::setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr<Mob> by)
+void PistonBaseTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr<Mob> by)
{
int targetData = getNewFacing(level, x, y, z, dynamic_pointer_cast<Player>(by) );
level->setData(x, y, z, targetData);
@@ -180,7 +180,7 @@ void PistonBaseTile::checkIfExtend(Level *level, int x, int y, int z)
* This method checks neighbor signals for this block and the block above,
* and directly beneath. However, it avoids checking blocks that would be
* pushed by this block.
- *
+ *
* @param level
* @param x
* @param y
@@ -249,7 +249,7 @@ void PistonBaseTile::triggerEvent(Level *level, int x, int y, int z, int param1,
else if (param1 == TRIGGER_CONTRACT)
{
PIXBeginNamedEvent(0,"Contract phase A\n");
- std::shared_ptr<TileEntity> prevTileEntity = level->getTileEntity(x + Facing::STEP_X[facing], y + Facing::STEP_Y[facing], z + Facing::STEP_Z[facing]);
+ shared_ptr<TileEntity> prevTileEntity = level->getTileEntity(x + Facing::STEP_X[facing], y + Facing::STEP_Y[facing], z + Facing::STEP_Z[facing]);
if (prevTileEntity != NULL && dynamic_pointer_cast<PistonPieceEntity>(prevTileEntity) != NULL)
{
dynamic_pointer_cast<PistonPieceEntity>(prevTileEntity)->finalTick();
@@ -280,10 +280,10 @@ void PistonBaseTile::triggerEvent(Level *level, int x, int y, int z, int param1,
// the block two steps away is a moving piston block piece,
// so replace it with the real data, since it's probably
// this piston which is changing too fast
- std::shared_ptr<TileEntity> tileEntity = level->getTileEntity(twoX, twoY, twoZ);
+ shared_ptr<TileEntity> tileEntity = level->getTileEntity(twoX, twoY, twoZ);
if (tileEntity != NULL && dynamic_pointer_cast<PistonPieceEntity>(tileEntity) != NULL )
{
- std::shared_ptr<PistonPieceEntity> ppe = dynamic_pointer_cast<PistonPieceEntity>(tileEntity);
+ shared_ptr<PistonPieceEntity> ppe = dynamic_pointer_cast<PistonPieceEntity>(tileEntity);
if (ppe->getFacing() == facing && ppe->isExtending())
{
@@ -337,7 +337,7 @@ void PistonBaseTile::triggerEvent(Level *level, int x, int y, int z, int param1,
ignoreUpdate(false);
}
-void PistonBaseTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr<TileEntity> forceEntity) // 4J added forceData, forceEntity param
+void PistonBaseTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr<TileEntity> forceEntity) // 4J added forceData, forceEntity param
{
int data = (forceData == -1 ) ? level->getData(x, y, z) : forceData;
@@ -377,7 +377,7 @@ void PistonBaseTile::updateDefaultShape()
setShape(0, 0, 0, 1, 1, 1);
}
-void PistonBaseTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr<Entity> source)
+void PistonBaseTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr<Entity> source)
{
setShape(0, 0, 0, 1, 1, 1);
Tile::addAABBs(level, x, y, z, box, boxes, source);
@@ -404,9 +404,9 @@ bool PistonBaseTile::isExtended(int data)
return (data & EXTENDED_BIT) != 0;
}
-int PistonBaseTile::getNewFacing(Level *level, int x, int y, int z, std::shared_ptr<Player> player)
+int PistonBaseTile::getNewFacing(Level *level, int x, int y, int z, shared_ptr<Player> player)
{
- if (Mth::abs((float) player->x - x) < 2 && Mth::abs((float) player->z - z) < 2)
+ if (Mth::abs((float) player->x - x) < 2 && Mth::abs((float) player->z - z) < 2)
{
// If the player is above the block, the slot is on the top
double py = player->y + 1.82 - player->heightOffset;
@@ -456,7 +456,7 @@ bool PistonBaseTile::isPushable(int block, Level *level, int cx, int cy, int cz,
{
return false;
}
-
+
if (!allowDestroyable && Tile::tiles[block]->getPistonPushReaction() == Material::PUSH_DESTROY)
{
return false;
@@ -486,7 +486,7 @@ bool PistonBaseTile::canPush(Level *level, int sx, int sy, int sz, int facing)
// out of bounds
return false;
}
-
+
// 4J - added to also check for out of bounds in x/z for our finite world
int minXZ = - (level->dimension->getXZSize() * 16 ) / 2;
int maxXZ = (level->dimension->getXZSize() * 16 ) / 2 - 1;
@@ -529,7 +529,7 @@ bool PistonBaseTile::canPush(Level *level, int sx, int sy, int sz, int facing)
void PistonBaseTile::stopSharingIfServer(Level *level, int x, int y, int z)
{
if( !level->isClientSide )
- {
+ {
MultiPlayerLevel *clientLevel = Minecraft::GetInstance()->getLevel(level->dimension->id);
if( clientLevel )
{
@@ -552,7 +552,7 @@ bool PistonBaseTile::createPush(Level *level, int sx, int sy, int sz, int facing
// out of bounds
return false;
}
-
+
// 4J - added to also check for out of bounds in x/z for our finite world
int minXZ = - (level->dimension->getXZSize() * 16 ) / 2;
int maxXZ = (level->dimension->getXZSize() * 16 ) / 2 - 1;