Support for TU24 has been extended.

Since the TU25 update still requires a lot of work and the TU24 version does not yet include all the features, I have decided to continue working with the TU24 version for now.

Merge latest changes from Minecraft Consoles:
* Added support for Big-Endian DLCs.
* Fix redstone tick persistence on chunk unload.
* Fix pistons permanently breaking server-wide on dedicated servers.
* Fix Ender Dragon damage and End Poem crash.
* Disable font mipmapping to get rid of artifacts on signs.

Other:
* Music Fixes.
* Added missing sounds (Caves, Horse Eat, Sheep Shear, Water Swim, Thorns)
* Remove duplicated sounds.
* Added High Quality ver of "The End Dragon Alive" music.
* Fix Mobs sounds volume.
* Added Old Swing Animation Option.
* Added Graphics Mode (Potato, Fast, Fancy and Extra)
* Fix a small memory leak with signs.
* Fixed Pig Zombies attacking creative players.
This commit is contained in:
GabsPuNs
2026-03-28 06:27:19 -04:00
parent 9e99b47c9a
commit f79ca9e411
301 changed files with 407 additions and 362 deletions

View File

@@ -80,31 +80,55 @@ vector<LevelChunk *> *ServerChunkCache::getLoadedChunkList()
return &m_loadedChunkList;
}
void ServerChunkCache::drop(const int x, const int z)
void ServerChunkCache::drop(int x, int z)
{
const int ix = x + XZOFFSET;
const int iz = z + XZOFFSET;
if ((ix < 0) || (ix >= XZSIZE)) return;
if ((iz < 0) || (iz >= XZSIZE)) return;
const int idx = ix * XZSIZE + iz;
LevelChunk* chunk = cache[idx];
if (chunk != nullptr)
// 4J - we're not dropping things anymore now that we have a fixed sized cache
#ifdef _LARGE_WORLDS
bool canDrop = false;
/*
if (level->dimension->mayRespawn())
{
const auto it = std::find(m_loadedChunkList.begin(), m_loadedChunkList.end(), chunk);
if (it != m_loadedChunkList.end()) m_loadedChunkList.erase(it);
cache[idx] = nullptr;
chunk->loaded = false;
Pos *spawnPos = level->getSharedSpawnPos();
int xd = x * 16 + 8 - spawnPos->x;
int zd = z * 16 + 8 - spawnPos->z;
delete spawnPos;
int r = 128;
if (xd < -r || xd > r || zd < -r || zd > r)
{
canDrop = true;
}
}
*/
// else
// {
canDrop = true;
// }
if(canDrop)
{
int ix = x + XZOFFSET;
int iz = z + XZOFFSET;
// Check we're in range of the stored level
if( ( ix < 0 ) || ( ix >= XZSIZE ) ) return;
if( ( iz < 0 ) || ( iz >= XZSIZE ) ) return;
int idx = ix * XZSIZE + iz;
LevelChunk *chunk = cache[idx];
if(chunk)
{
m_toDrop.push_back(chunk);
}
}
#endif
}
void ServerChunkCache::dropAll()
{
#ifdef _LARGE_WORLDS
for (LevelChunk *chunk : m_loadedChunkList)
{
drop(chunk->x, chunk->z);
}
#endif
}
// 4J - this is the original (and virtual) interface to create
@@ -934,10 +958,6 @@ bool ServerChunkCache::tick()
m_unloadedCache[idx] = chunk;
cache[idx] = nullptr;
}
else
{
continue;
}
}
m_toDrop.pop_front();
}