giant batch BOOOOM

This commit is contained in:
Nikita Edel
2026-03-11 17:28:13 +01:00
parent ed13020cf3
commit 69a8ce84b9
8 changed files with 31 additions and 19 deletions

View File

@@ -475,7 +475,8 @@ void ServerLevel::tickTiles()
// 4J - changes here brought forrward from 1.2.3
if (random->nextInt(16) == 0)
{
randValue = randValue * 3 + addend;
//4jcraft added cast to unsigned
randValue = (unsigned)randValue * 3 + (unsigned)addend;
int val = (randValue >> 2);
int x = (val & 15);
int z = ((val >> 8) & 15);
@@ -1414,7 +1415,8 @@ int ServerLevel::runUpdate(void* lpParam)
for (int j = 0; j < 80; j++)
{
m_randValue[iLev] = m_randValue[iLev] * 3 + m_level[iLev]->addend;
// 4jcraft added cast to unsigned
m_randValue[iLev] = (unsigned) m_randValue[iLev] * 3 + (unsigned) m_level[iLev]->addend;
int val = (m_randValue[iLev] >> 2);
int x = (val & 15);
if( ( x < minx ) || ( x > maxx ) ) continue;