aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/SkullTile.cpp
diff options
context:
space:
mode:
authorLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
committerLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
commit087b7e7abfe81dd7f0fdcdea36ac9f245950df1a (patch)
tree69454763e73ca764af4e682d3573080b13138a0e /Minecraft.World/SkullTile.cpp
parenta9be52c41a02d207233199e98898fe7483d7e817 (diff)
Revert "Project modernization (#630)"
This code was not tested and breaks in Release builds, reverting to restore functionality of the nightly. All in-game menus do not work and generating a world crashes. This reverts commit a9be52c41a02d207233199e98898fe7483d7e817.
Diffstat (limited to 'Minecraft.World/SkullTile.cpp')
-rw-r--r--Minecraft.World/SkullTile.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/Minecraft.World/SkullTile.cpp b/Minecraft.World/SkullTile.cpp
index b5eca373..92ce7807 100644
--- a/Minecraft.World/SkullTile.cpp
+++ b/Minecraft.World/SkullTile.cpp
@@ -67,7 +67,7 @@ void SkullTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr<Living
shared_ptr<TileEntity> SkullTile::newTileEntity(Level *level)
{
- return std::make_shared<SkullTileEntity>();
+ return shared_ptr<SkullTileEntity>(new SkullTileEntity());
}
int SkullTile::cloneTileId(Level *level, int x, int y, int z)
@@ -79,7 +79,7 @@ int SkullTile::cloneTileData(Level *level, int x, int y, int z)
{
shared_ptr<TileEntity> tileEntity = level->getTileEntity(x, y, z);
shared_ptr<SkullTileEntity> skull = dynamic_pointer_cast<SkullTileEntity>(tileEntity);
- if (skull != nullptr)
+ if (skull != NULL)
{
return skull->getSkullType();
}
@@ -113,7 +113,7 @@ void SkullTile::onRemove(Level *level, int x, int y, int z, int id, int data)
if (level->isClientSide) return;
if ((data & NO_DROP_BIT) == 0)
{
- shared_ptr<ItemInstance> item = std::make_shared<ItemInstance>(Item::skull_Id, 1, cloneTileData(level, x, y, z));
+ shared_ptr<ItemInstance> item = shared_ptr<ItemInstance>(new ItemInstance(Item::skull_Id, 1, cloneTileData(level, x, y, z)));
shared_ptr<SkullTileEntity> entity = dynamic_pointer_cast<SkullTileEntity>(level->getTileEntity(x, y, z));
if (entity->getSkullType() == SkullTileEntity::TYPE_CHAR && !entity->getExtraType().empty())
@@ -166,7 +166,7 @@ void SkullTile::checkMobSpawn(Level *level, int x, int y, int z, shared_ptr<Skul
if (level->canCreateMore(eTYPE_WITHERBOSS, Level::eSpawnType_Egg))
{
// 4J: Removed !isClientSide check because there's one earlier on
- shared_ptr<WitherBoss> witherBoss = std::make_shared<WitherBoss>(level);
+ shared_ptr<WitherBoss> witherBoss = shared_ptr<WitherBoss>( new WitherBoss(level) );
witherBoss->moveTo(x + 0.5, y - 1.45, z + zo + 1.5, 90, 0);
witherBoss->yBodyRot = 90;
witherBoss->makeInvulnerable();
@@ -180,8 +180,8 @@ void SkullTile::checkMobSpawn(Level *level, int x, int y, int z, shared_ptr<Skul
Tile::tiles[Tile::soulsand_Id]->spawnResources(level, x, y - 2, z + zo + 1, 0, 0);
Tile::tiles[Tile::soulsand_Id]->spawnResources(level, x, y - 1, z + zo + 2, 0, 0);
- shared_ptr<ItemInstance> itemInstance = std::make_shared<ItemInstance>(Item::skull_Id, 3, SkullTileEntity::TYPE_WITHER);
- shared_ptr<ItemEntity> itemEntity = std::make_shared<ItemEntity>(level, x, y, z + zo + 1, itemInstance);
+ shared_ptr<ItemInstance> itemInstance = shared_ptr<ItemInstance>(new ItemInstance(Item::skull_Id, 3, SkullTileEntity::TYPE_WITHER));
+ shared_ptr<ItemEntity> itemEntity = shared_ptr<ItemEntity>(new ItemEntity(level, x, y, z + zo + 1, itemInstance) );
level->addEntity(itemEntity);
}
@@ -229,7 +229,7 @@ void SkullTile::checkMobSpawn(Level *level, int x, int y, int z, shared_ptr<Skul
if (level->canCreateMore(eTYPE_WITHERBOSS, Level::eSpawnType_Egg))
{
// 4J: Removed !isClientSide check because there's one earlier on
- shared_ptr<WitherBoss> witherBoss = std::make_shared<WitherBoss>(level);
+ shared_ptr<WitherBoss> witherBoss = shared_ptr<WitherBoss>( new WitherBoss(level) );
witherBoss->moveTo(x + xo + 1.5, y - 1.45, z + .5, 0, 0);
witherBoss->makeInvulnerable();
level->addEntity(witherBoss);
@@ -242,8 +242,8 @@ void SkullTile::checkMobSpawn(Level *level, int x, int y, int z, shared_ptr<Skul
Tile::tiles[Tile::soulsand_Id]->spawnResources(level, x + xo + 1, y - 2, z, 0, 0);
Tile::tiles[Tile::soulsand_Id]->spawnResources(level, x + xo + 2, y - 1, z, 0, 0);
- shared_ptr<ItemInstance> itemInstance = std::make_shared<ItemInstance>(Item::skull_Id, 3, SkullTileEntity::TYPE_WITHER);
- shared_ptr<ItemEntity> itemEntity = std::make_shared<ItemEntity>(level, x + xo + 1, y, z, itemInstance);
+ shared_ptr<ItemInstance> itemInstance = shared_ptr<ItemInstance>(new ItemInstance(Item::skull_Id, 3, SkullTileEntity::TYPE_WITHER));
+ shared_ptr<ItemEntity> itemEntity = shared_ptr<ItemEntity>(new ItemEntity(level, x + xo + 1, y, z, itemInstance) );
level->addEntity(itemEntity);
}
@@ -274,7 +274,7 @@ bool SkullTile::isSkullAt(Level *level, int x, int y, int z, int skullType)
}
shared_ptr<TileEntity> te = level->getTileEntity(x, y, z);
shared_ptr<SkullTileEntity> skull = dynamic_pointer_cast<SkullTileEntity>(te);
- if (skull == nullptr)
+ if (skull == NULL)
{
return false;
}