This commit is contained in:
Nikita Edel 2026-03-11 18:49:36 +01:00
parent cc65f7ee29
commit faa4a989ce
6 changed files with 19 additions and 10 deletions

View file

@ -809,7 +809,8 @@ enum EControllerActions
ACTION_MENU_OK,
ACTION_MENU_CANCEL,
ACTION_MAX_MENU = ACTION_MENU_CANCEL,
// 4jcraft added, off by one
ACTION_MAX_MENU = ACTION_MENU_CANCEL + 1,
MINECRAFT_ACTION_JUMP,
MINECRAFT_ACTION_FORWARD,
@ -911,4 +912,4 @@ enum eMCLang
eMCLang_elGR,
eMCLang_nnNO,
eMCLang_skSK,
};
};

View file

@ -23,6 +23,9 @@ UIComponent_TutorialPopup::UIComponent_TutorialPopup(int iPad, void *initData, U
m_bSplitscreenGamertagVisible = false;
m_labelDescription.init(L"");
// 4jcraft added
m_tutorial = NULL;
}
std::wstring UIComponent_TutorialPopup::getMoviePath()
@ -69,6 +72,9 @@ void UIComponent_TutorialPopup::SetTutorialDescription(TutorialPopupInfo *info)
{
m_interactScene = info->interactScene;
// 4jcraft added
m_tutorial = info->tutorial;
std::wstring parsed = _SetIcon(info->icon, info->iAuxVal, info->isFoil, info->desc);
parsed = _SetImage( parsed );
parsed = ParseDescription(m_iPad, parsed);

View file

@ -17,8 +17,9 @@ void MinecartRenderer::render(std::shared_ptr<Entity> _cart, double x, double y,
glPushMatrix();
__int64 seed = cart->entityId * 493286711l;
seed = seed * seed * 4392167121l + seed * 98761;
// 4jcraft added a bunch of casts to prever overflow
int64_t seed = (int64_t)((uint64_t)cart->entityId * 493286711ULL);
seed = (int64_t)(((uint64_t)seed * (uint64_t)seed * 4392167121ULL) + ((uint64_t)seed * 98761ULL));
float xo = ((((seed >> 16) & 0x7) + 0.5f) / 8.0f - 0.5f) * 0.004f;
float yo = ((((seed >> 20) & 0x7) + 0.5f) / 8.0f - 0.5f) * 0.004f;
@ -103,4 +104,4 @@ void MinecartRenderer::render(std::shared_ptr<Entity> _cart, double x, double y,
model->render(cart, 0, 0, -0.1f, 0, 0, 1 / 16.0f, true);
glPopMatrix();
}
}

View file

@ -3822,9 +3822,9 @@ bool TileRenderer::tesselateLilypadInWorld(Tile *tt, int x, int y, int z)
float u1 = tex->getU1(true);
float v1 = tex->getV1(true);
__int64 seed = (x * 3129871) ^ (z * 116129781l) ^ (y);
seed = seed * seed * 42317861 + seed * 11;
// 4jcraft add a bunch of casts to prevent overflow (i pray to god)
int64_t seed = ((int64_t)x * 3129871) ^ ((int64_t)z * 116129781L) ^ ((int64_t)y);
seed = (int64_t)(((uint64_t)seed * (uint64_t)seed * 42317861ULL) + ((uint64_t)seed * 11ULL));
int dir = (int) ((seed >> 16) & 0x3);

View file

@ -258,7 +258,8 @@ void Font::draw(const std::wstring& str, int x, int y, int color, bool dropShado
// if not set
if (dropShadow) // divide RGB by 4, preserve alpha
color = (color & 0xfcfcfc) >> 2 | (color & (-1 << 24));
// 4jcraft changed -1 << 24 to the value of 1 (0xFF FF FF FF)
color = (color & 0xfcfcfc) >> 2 | (color & (0xFFFFFFFF << 24));
glColor4f((color >> 16 & 255) / 255.0F, (color >> 8 & 255) / 255.0F, (color & 255) / 255.0F, (color >> 24 & 255) / 255.0F);

View file

@ -3228,7 +3228,7 @@ void Level::tickClientSideTiles(int xo, int zo, LevelChunk *lc)
if (delayUntilNextMoodSound == 0)
{
randValue = randValue * 3 + addend;
randValue = (unsigned) randValue * 3 + (unsigned) addend;
int val = (randValue >> 2);
int x = (val & 15);
int z = ((val >> 8) & 15);