Update More Methods!

This commit is contained in:
TheBrokenRail 2024-05-15 05:08:39 -04:00
parent 6ae475785e
commit f25a2adcef
8 changed files with 14 additions and 14 deletions

View File

@ -144,7 +144,7 @@ static Screen *create_chat_screen() {
void _init_chat_ui() {
misc_run_on_game_key_press([](Minecraft *minecraft, int key) {
if (key == 0x54) {
if (Minecraft_isLevelGenerated(minecraft) && minecraft->screen == nullptr) {
if (minecraft->isLevelGenerated() && minecraft->screen == nullptr) {
minecraft->setScreen(create_chat_screen());
}
return true;

View File

@ -213,7 +213,7 @@ static void create_world(Minecraft *minecraft, std::string name, bool is_creativ
if (folder.empty()) {
folder = "World";
}
folder = getUniqueLevelName(Minecraft_getLevelSource(minecraft), folder);
folder = getUniqueLevelName(minecraft->getLevelSource(), folder);
// Settings
LevelSettings settings;

View File

@ -45,7 +45,7 @@ static const char *last_message = nullptr;
static void print_progress(Minecraft *minecraft) {
const char *message = minecraft->getProgressMessage();
int32_t progress = minecraft->progress;
if (Minecraft_isLevelGenerated(minecraft)) {
if (minecraft->isLevelGenerated()) {
message = "Ready";
progress = -1;
}

View File

@ -247,7 +247,7 @@ static void LoginPacket_read_injection(LoginPacket_read_t original, LoginPacket
// formatting functionality.
static RakNet_RakString *RakNet_RakString_injection(RakNet_RakString *rak_string, const char *format, ...) {
// Call Original Method
return rak_string->constructor("%s", format);
return RakNet_RakString_constructor(rak_string, "%s", format);
}
// Print Error Message If RakNet Startup Fails

View File

@ -293,7 +293,7 @@ __attribute__((destructor)) static void _free_stdin_buffer() {
// Handle Commands
static void handle_commands(Minecraft *minecraft) {
// Check If Level Is Generated
if (Minecraft_isLevelGenerated(minecraft) && stdin_buffer_complete) {
if (minecraft->isLevelGenerated() && stdin_buffer_complete) {
// Command Ready; Run It
if (stdin_buffer != nullptr) {
ServerSideNetworkHandler *server_side_network_handler = get_server_side_network_handler(minecraft);

View File

@ -115,7 +115,7 @@ void TextInputBox::tick() {
}
if (m_bFocused) {
if (Common_getTimeMs() > m_lastFlashed + 500) {
if (Common::getTimeMs() > m_lastFlashed + 500) {
m_lastFlashed += 500;
m_bCursorOn ^= 1;
}
@ -167,7 +167,7 @@ void TextInputBox::charPressed(int k) {
static std::string get_rendered_text(Font *font, int width, int scroll_pos, std::string text) {
std::string rendered_text = text.substr(scroll_pos);
int max_width = width - (PADDING * 2);
while (Font_width(font, &rendered_text) > max_width) {
while (font->width(&rendered_text) > max_width) {
rendered_text.pop_back();
}
return rendered_text;

View File

@ -42,8 +42,8 @@ CUSTOM_VTABLE(lava_texture, DynamicTexture) {
for (int x = 0; x < 16; x++) {
for (int y = 0; y < 16; y++) {
float f = 0.0F;
int ax = int(Mth_sin((float(x) * float(M_PI) * 2) / 16.0f) * 1.2f);
int ay = int(Mth_sin((float(y) * float(M_PI) * 2) / 16.0f) * 1.2f);
int ax = int(Mth::sin((float(x) * float(M_PI) * 2) / 16.0f) * 1.2f);
int ay = int(Mth::sin((float(y) * float(M_PI) * 2) / 16.0f) * 1.2f);
for (int bx = x - 1; bx <= x + 1; bx++) {
for (int by = y - 1; by <= y + 1; by++) {
int k2 = (bx + ay) & 0xf;
@ -57,7 +57,7 @@ CUSTOM_VTABLE(lava_texture, DynamicTexture) {
self->m_data3[x + y * 16] = 0.0f;
}
self->m_data4[x + y * 16] -= 0.06f;
if (Mth_random() < 0.005f) {
if (Mth::random() < 0.005f) {
self->m_data4[x + y * 16] = 1.5f;
}
}
@ -106,8 +106,8 @@ CUSTOM_VTABLE(lava_side_texture, DynamicTexture) {
for (int x = 0; x < 16; x++) {
for (int y = 0; y < 16; y++) {
float f = 0.0F;
int ax = int(Mth_sin((float(x) * float(M_PI) * 2) / 16.0f) * 1.2f);
int ay = int(Mth_sin((float(y) * float(M_PI) * 2) / 16.0f) * 1.2f);
int ax = int(Mth::sin((float(x) * float(M_PI) * 2) / 16.0f) * 1.2f);
int ay = int(Mth::sin((float(y) * float(M_PI) * 2) / 16.0f) * 1.2f);
for (int bx = x - 1; bx <= x + 1; bx++) {
for (int by = y - 1; by <= y + 1; by++) {
int k2 = (bx + ay) & 0xf;
@ -121,7 +121,7 @@ CUSTOM_VTABLE(lava_side_texture, DynamicTexture) {
self->m_data3[x + y * 16] = 0.0f;
}
self->m_data4[x + y * 16] -= 0.06f;
if (Mth_random() < 0.005f) {
if (Mth::random() < 0.005f) {
self->m_data4[x + y * 16] = 1.5f;
}
}

View File

@ -100,7 +100,7 @@ static void StartMenuScreen_render_Screen_render_injection(Screen *screen, int x
glRotatef(-20.0f, 0.0f, 0.0f, 1.0f);
// Scale
int textWidth = screen->font->width(&current_splash);
float timeMS = float(Common_getTimeMs() % 1000) / 1000.0f;
float timeMS = float(Common::getTimeMs() % 1000) / 1000.0f;
float scale = max_scale - Mth::abs(0.1f * Mth::sin(2.0f * float(M_PI) * timeMS));
float real_text_width = textWidth * max_scale;
if (real_text_width > max_width) {