Project modernization (#630)

* Fixed boats falling and a TP glitch #266

* Replaced every C-style cast with C++ ones

* Replaced every C-style cast with C++ ones

* Fixed boats falling and a TP glitch #266

* Updated NULL to nullptr and fixing some type issues

* Modernized and fixed a few bugs

- Replaced most instances of `NULL` with `nullptr`.
- Replaced most `shared_ptr(new ...)` with `make_shared`.
- Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances.

* Fixing more conflicts

* Replace int loops with size_t and start work on overrides
This commit is contained in:
ModMaker101
2026-03-07 21:56:03 -05:00
committed by GitHub
parent 1be5faaea7
commit a9be52c41a
1373 changed files with 19903 additions and 19449 deletions

View File

@@ -18,7 +18,7 @@ LevelData::LevelData(CompoundTag *tag)
{
wstring generatorName = tag->getString(L"generatorName");
m_pGenerator = LevelType::getLevelType(generatorName);
if (m_pGenerator == NULL)
if (m_pGenerator == nullptr)
{
m_pGenerator = LevelType::lvl_normal;
}
@@ -188,8 +188,13 @@ LevelData::LevelData(CompoundTag *tag)
dimension = loadedPlayerTag->getInt(L"Dimension");
}
else
<<<<<<< HEAD
{
this->loadedPlayerTag = nullptr;
=======
{
this->loadedPlayerTag = NULL;
>>>>>>> origin/main
}
*/
dimension = 0;
@@ -215,7 +220,7 @@ LevelData::LevelData(LevelSettings *levelSettings, const wstring& levelName)
gameTime = -1;
lastPlayed = 0;
sizeOnDisk = 0;
// this->loadedPlayerTag = NULL; // 4J - we don't store this anymore
// this->loadedPlayerTag = nullptr; // 4J - we don't store this anymore
dimension = 0;
version = 0;
rainTime = 0;
@@ -432,7 +437,7 @@ int64_t LevelData::getSizeOnDisk()
CompoundTag *LevelData::getLoadedPlayerTag()
{
return NULL; // 4J - we don't store this anymore
return nullptr; // 4J - we don't store this anymore
}
// 4J Removed TU9 as it's never accurate due to the dimension never being set
@@ -712,7 +717,7 @@ void LevelData::getMoatFlags(bool* bClassicEdgeMoat, bool* bSmallEdgeMoat, bool*
int LevelData::getXZHellSizeOld()
{
int hellXZSizeOld = ceil((float)m_xzSizeOld / m_hellScaleOld);
int hellXZSizeOld = ceil(static_cast<float>(m_xzSizeOld) / m_hellScaleOld);
while(hellXZSizeOld > HELL_LEVEL_MAX_WIDTH && m_hellScaleOld < HELL_LEVEL_MAX_SCALE)
{