diff --git a/mods/src/chat/ui.cpp b/mods/src/chat/ui.cpp index 4fea149..a6c69e0 100644 --- a/mods/src/chat/ui.cpp +++ b/mods/src/chat/ui.cpp @@ -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; diff --git a/mods/src/game-mode/ui.cpp b/mods/src/game-mode/ui.cpp index 3190f06..2e8828b 100644 --- a/mods/src/game-mode/ui.cpp +++ b/mods/src/game-mode/ui.cpp @@ -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; diff --git a/mods/src/misc/logging.cpp b/mods/src/misc/logging.cpp index 9bfac0c..c30289d 100644 --- a/mods/src/misc/logging.cpp +++ b/mods/src/misc/logging.cpp @@ -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; } diff --git a/mods/src/misc/misc.cpp b/mods/src/misc/misc.cpp index 9ae12b2..9f7d801 100644 --- a/mods/src/misc/misc.cpp +++ b/mods/src/misc/misc.cpp @@ -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 diff --git a/mods/src/server/server.cpp b/mods/src/server/server.cpp index ef97b24..6ea33bb 100644 --- a/mods/src/server/server.cpp +++ b/mods/src/server/server.cpp @@ -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); diff --git a/mods/src/text-input-box/TextInputBox.cpp b/mods/src/text-input-box/TextInputBox.cpp index c8c6515..b8d6dea 100644 --- a/mods/src/text-input-box/TextInputBox.cpp +++ b/mods/src/text-input-box/TextInputBox.cpp @@ -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; diff --git a/mods/src/textures/lava.cpp b/mods/src/textures/lava.cpp index 9cecc6f..a749b9d 100644 --- a/mods/src/textures/lava.cpp +++ b/mods/src/textures/lava.cpp @@ -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; } } diff --git a/mods/src/title-screen/title-screen.cpp b/mods/src/title-screen/title-screen.cpp index a26c60f..3f0f169 100644 --- a/mods/src/title-screen/title-screen.cpp +++ b/mods/src/title-screen/title-screen.cpp @@ -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(¤t_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) {