Merge remote-tracking branch 'origin/main' into feat/minigames

This commit is contained in:
github-actions 2026-05-25 15:57:08 +00:00
commit 9d4ef38315
5 changed files with 17 additions and 34 deletions

2
BUMP
View file

@ -1 +1 @@
1.0.5b
1.0.6b

View file

@ -15,8 +15,8 @@ MultiPlayerChunkCache::MultiPlayerChunkCache(Level *level)
XZSIZE = level->dimension->getXZSize(); // 4J Added
XZOFFSET = XZSIZE/2; // 4J Added
m_XZSize = XZSIZE;
hasData = new bool[LEVEL_MIN_WIDTH * LEVEL_MIN_WIDTH];
memset(hasData, 0, sizeof(bool) * LEVEL_MIN_WIDTH * LEVEL_MIN_WIDTH);
hasData = new bool[XZSIZE * XZSIZE];
memset(hasData, 0, sizeof(bool) * XZSIZE * XZSIZE);
emptyChunk = new EmptyLevelChunk(level, byteArray(16 * 16 * Level::maxBuildHeight), 0, 0);
@ -93,8 +93,8 @@ MultiPlayerChunkCache::MultiPlayerChunkCache(Level *level)
this->level = level;
this->cache = new LevelChunk *[LEVEL_MIN_WIDTH * LEVEL_MIN_WIDTH];
memset(this->cache, 0, sizeof(LevelChunk*) * LEVEL_MIN_WIDTH * LEVEL_MIN_WIDTH);
this->cache = new LevelChunk *[XZSIZE * XZSIZE];
memset(this->cache, 0, sizeof(LevelChunk*) * XZSIZE * XZSIZE);
InitializeCriticalSectionAndSpinCount(&m_csLoadCreate,4000);
}
@ -129,11 +129,10 @@ bool MultiPlayerChunkCache::reallyHasChunk(int x, int z)
// Check we're in range of the stored level - if we aren't, then consider that we do have that chunk as we'll be able to use the water chunk there
if( ( ix < 0 ) || ( ix >= XZSIZE ) ) return true;
if( ( iz < 0 ) || ( iz >= XZSIZE ) ) return true;
int idx = wrapCoord(x, LEVEL_MIN_WIDTH) * LEVEL_MIN_WIDTH + wrapCoord(z, LEVEL_MIN_WIDTH);
int idx = ix * XZSIZE + iz;
LevelChunk *chunk = cache[idx];
if (chunk == nullptr || chunk->x != x || chunk->z != z)
if (chunk == nullptr)
{
return false;
}
@ -147,10 +146,10 @@ void MultiPlayerChunkCache::drop(const int x, const int z)
if ((ix < 0) || (ix >= XZSIZE)) return;
if ((iz < 0) || (iz >= XZSIZE)) return;
int idx = wrapCoord(x, LEVEL_MIN_WIDTH) * LEVEL_MIN_WIDTH + wrapCoord(z, LEVEL_MIN_WIDTH);
int idx = ix * XZSIZE + iz;
LevelChunk* chunk = cache[idx];
if (chunk != nullptr && !chunk->isEmpty() && chunk->x == x && chunk->z == z)
if (chunk != nullptr && !chunk->isEmpty())
{
// Drop 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.
@ -170,12 +169,12 @@ LevelChunk *MultiPlayerChunkCache::create(int x, int z)
// Check we're in range of the stored level
if( ( ix < 0 ) || ( ix >= XZSIZE ) ) return ( waterChunk ? waterChunk : emptyChunk );
if( ( iz < 0 ) || ( iz >= XZSIZE ) ) return ( waterChunk ? waterChunk : emptyChunk );
int idx = wrapCoord(x, LEVEL_MIN_WIDTH) * LEVEL_MIN_WIDTH + wrapCoord(z, LEVEL_MIN_WIDTH);
int idx = ix * XZSIZE + iz;
LevelChunk *chunk = cache[idx];
LevelChunk *lastChunk = chunk;
if( chunk == nullptr || chunk->x != x || chunk->z != z )
if( chunk == nullptr )
{
EnterCriticalSection(&m_csLoadCreate);
@ -254,10 +253,10 @@ LevelChunk *MultiPlayerChunkCache::getChunk(int x, int z)
// Check we're in range of the stored level
if( ( ix < 0 ) || ( ix >= XZSIZE ) ) return ( waterChunk ? waterChunk : emptyChunk );
if( ( iz < 0 ) || ( iz >= XZSIZE ) ) return ( waterChunk ? waterChunk : emptyChunk );
int idx = wrapCoord(x, LEVEL_MIN_WIDTH) * LEVEL_MIN_WIDTH + wrapCoord(z, LEVEL_MIN_WIDTH);
int idx = ix * XZSIZE + iz;
LevelChunk *chunk = cache[idx];
if( chunk == nullptr || chunk->x != x || chunk->z != z )
if( chunk == nullptr )
{
return emptyChunk;
}
@ -316,6 +315,6 @@ void MultiPlayerChunkCache::dataReceived(int x, int z)
// Check we're in range of the stored level
if( ( ix < 0 ) || ( ix >= XZSIZE ) ) return;
if( ( iz < 0 ) || ( iz >= XZSIZE ) ) return;
int idx = wrapCoord(x, LEVEL_MIN_WIDTH) * LEVEL_MIN_WIDTH + wrapCoord(z, LEVEL_MIN_WIDTH);
int idx = ix * XZSIZE + iz;
hasData[idx] = true;
}

View file

@ -45,9 +45,4 @@ public:
virtual void dataReceived(int x, int z); // 4J added
virtual LevelChunk **getCache() { return cache; } // 4J added
static inline int wrapCoord(int v, int size) {
int r = v % size;
return (r < 0) ? r + size : r;
}
};

View file

@ -1333,7 +1333,7 @@ int Level::getBrightness(LightLayer::variety layer, int x, int y, int z)
if( ( ix < 0 ) || ( ix >= chunkSourceXZSize ) ) return 0;
if( ( iz < 0 ) || ( iz >= chunkSourceXZSize ) ) return 0;
int idx = MultiPlayerChunkCache::wrapCoord(ix, LEVEL_MIN_WIDTH) * LEVEL_MIN_WIDTH + MultiPlayerChunkCache::wrapCoord(iz, LEVEL_MIN_WIDTH);
int idx = ix * chunkSourceXZSize + iz;
LevelChunk *c = chunkSourceCache[idx];
if( c == nullptr) return (int)layer;
@ -1382,7 +1382,7 @@ void Level::getNeighbourBrightnesses(int *brightnesses, LightLayer::variety laye
return;
}
int idx = MultiPlayerChunkCache::wrapCoord(ix, LEVEL_MIN_WIDTH) * LEVEL_MIN_WIDTH + MultiPlayerChunkCache::wrapCoord(iz, LEVEL_MIN_WIDTH);
int idx = ix * chunkSourceXZSize + iz;
LevelChunk *c = chunkSourceCache[idx];
// 4J Stu - The java LightLayer was an enum class type with a member "surrounding" which is what we

View file

@ -1,18 +1,7 @@
# neoLegacy v1.0.5b
### Bug Fixes
- Fixed blue flashing when clicking on a server.
- Added crafting recipes for andesite, diorite and granite**.**
- Fixed incorrect Rabbit Stew strings**.**
- Fixed breaking the top half of tall blocks failing to destroy the entire block.
- Fixed damage still occurring when the gameis paused.
- Poison can no longer kill players, only damaging them to 1 HP.
### Changes
- Added TU31 parity changes which include:
- Item Frames can now rotate in 8 directions.
- Comparators can now detect item frame rotations.
- Pistons no longer ignore block updates.
- Fixed crashing, lagging, and lighting issues caused by expanded world generation.
<img width="784" height="410" alt="roadmap" src="https://github.com/user-attachments/assets/134856ae-b151-4003-aa97-7ecf19ccd278" />