Final Update for TU24 2/3

LCE Renewed
- Merged some fixes and code updates from TU25.
* Fixed transparent items in hand.
* Beacon beams fixes.
- Fixed a crash when a dispenser is dispensing water or lava when the dispenser is blocked.

Minecraft Consoles
- Merged Asynchronous server joining
- Memory leak fix: Make chunks unload properly

Other
- Fixed Server Menu and Rename World Menu in 720p Res
This commit is contained in:
GabsPuNs
2026-03-25 05:00:44 -04:00
parent 3edf3c0782
commit 7deba3acb2
26 changed files with 863 additions and 175 deletions

View File

@@ -139,19 +139,26 @@ bool MultiPlayerChunkCache::reallyHasChunk(int x, int z)
return hasData[idx];
}
void MultiPlayerChunkCache::drop(int x, int z)
void MultiPlayerChunkCache::drop(const int x, const int z)
{
// 4J Stu - We do want to drop any entities in the chunks, especially for the case when a player is dead as they will
// not get the RemoveEntity packet if an entity is removed.
LevelChunk *chunk = getChunk(x, z);
if (!chunk->isEmpty())
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 && !chunk->isEmpty())
{
// Added parameter here specifies that we don't want to delete tile entities, as they won't get recreated unless they've got update packets
// The tile entities are in general only created on the client by virtue of the chunk rebuild
// Unload chunk but keep tile entities
chunk->unload(false);
// 4J - We just want to clear out the entities in the chunk, but everything else should be valid
chunk->loaded = true;
const auto it = std::find(loadedChunkList.begin(), loadedChunkList.end(), chunk);
if (it != loadedChunkList.end()) loadedChunkList.erase(it);
cache[idx] = nullptr;
hasData[idx] = false;
chunk->loaded = false;
}
}