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 a9be52c41a.
This commit is contained in:
Loki Rautio
2026-03-07 21:12:22 -06:00
parent a9be52c41a
commit 087b7e7abf
1373 changed files with 19449 additions and 19903 deletions

View File

@@ -37,8 +37,8 @@ ItemFrame::ItemFrame(Level *level, int xTile, int yTile, int zTile, int dir) : H
void ItemFrame::defineSynchedData()
{
getEntityData()->defineNULL(DATA_ITEM, nullptr);
getEntityData()->define(DATA_ROTATION, static_cast<byte>(0));
getEntityData()->defineNULL(DATA_ITEM, NULL);
getEntityData()->define(DATA_ROTATION, (byte) 0);
}
bool ItemFrame::shouldRenderAtSqrDistance(double distance)
@@ -52,7 +52,7 @@ void ItemFrame::dropItem(shared_ptr<Entity> causedBy)
{
shared_ptr<ItemInstance> item = getItem();
if (causedBy != nullptr && causedBy->instanceof(eTYPE_PLAYER))
if (causedBy != NULL && causedBy->instanceof(eTYPE_PLAYER))
{
if (dynamic_pointer_cast<Player>(causedBy)->abilities.instabuild)
{
@@ -61,8 +61,8 @@ void ItemFrame::dropItem(shared_ptr<Entity> causedBy)
}
}
spawnAtLocation(std::make_shared<ItemInstance>(Item::frame), 0);
if ( (item != nullptr) && (random->nextFloat() < dropChance) )
spawnAtLocation( shared_ptr<ItemInstance>(new ItemInstance(Item::frame) ), 0);
if ( (item != NULL) && (random->nextFloat() < dropChance) )
{
item = item->copy();
removeFramedMap(item);
@@ -72,7 +72,7 @@ void ItemFrame::dropItem(shared_ptr<Entity> causedBy)
void ItemFrame::removeFramedMap(shared_ptr<ItemInstance> item)
{
if (item == nullptr) return;
if (item == NULL) return;
if (item->id == Item::map_Id)
{
shared_ptr<MapItemSavedData> mapItemSavedData = Item::map->getSavedData(item, level);
@@ -89,7 +89,7 @@ shared_ptr<ItemInstance> ItemFrame::getItem()
void ItemFrame::setItem(shared_ptr<ItemInstance> item)
{
if(item != nullptr)
if(item != NULL)
{
item = item->copy();
item->count = 1;
@@ -107,15 +107,15 @@ int ItemFrame::getRotation()
void ItemFrame::setRotation(int rotation)
{
getEntityData()->set(DATA_ROTATION, static_cast<byte>(rotation % 4));
getEntityData()->set(DATA_ROTATION, (byte) (rotation % 4));
}
void ItemFrame::addAdditonalSaveData(CompoundTag *tag)
{
if (getItem() != nullptr)
if (getItem() != NULL)
{
tag->putCompound(L"Item", getItem()->save(new CompoundTag()));
tag->putByte(L"ItemRotation", static_cast<byte>(getRotation()));
tag->putByte(L"ItemRotation", (byte) getRotation());
tag->putFloat(L"ItemDropChance", dropChance);
}
HangingEntity::addAdditonalSaveData(tag);
@@ -124,7 +124,7 @@ void ItemFrame::addAdditonalSaveData(CompoundTag *tag)
void ItemFrame::readAdditionalSaveData(CompoundTag *tag)
{
CompoundTag *itemTag = tag->getCompound(L"Item");
if (itemTag != nullptr && !itemTag->isEmpty())
if (itemTag != NULL && !itemTag->isEmpty())
{
setItem(ItemInstance::fromTag(itemTag));
setRotation(tag->getByte(L"ItemRotation"));
@@ -141,11 +141,11 @@ bool ItemFrame::interact(shared_ptr<Player> player)
return false;
}
if (getItem() == nullptr)
if (getItem() == NULL)
{
shared_ptr<ItemInstance> item = player->getCarriedItem();
if (item != nullptr)
if (item != NULL)
{
if (!level->isClientSide)//isClientSide)
{