Compare commits

...

2 Commits

Author SHA1 Message Date
f25a2adcef Update More Methods!
All checks were successful
CI / Build (AMD64, Server) (push) Successful in 12m47s
CI / Build (AMD64, Client) (push) Successful in 13m7s
CI / Build (ARM64, Server) (push) Successful in 13m7s
CI / Build (ARM64, Client) (push) Successful in 15m38s
CI / Build (ARMHF, Server) (push) Successful in 9m9s
CI / Build (ARMHF, Client) (push) Successful in 11m46s
CI / Test (Server) (push) Successful in 14m4s
CI / Test (Client) (push) Successful in 16m33s
CI / Release (push) Has been skipped
CI / Build Example Mods (push) Successful in 7m55s
2024-05-15 05:08:39 -04:00
6ae475785e Fix Newlines 2024-05-15 05:06:36 -04:00
50 changed files with 13 additions and 62 deletions

View File

@ -107,4 +107,3 @@ void init_atlas() {
overwrite_call((void *) 0x1e21c, (void *) InventoryPane_renderBatch_Tesselator_color_injection);
}
}

View File

@ -171,4 +171,3 @@ void init_benchmark() {
media_disable_vsync();
}
}

View File

@ -372,4 +372,3 @@ void init_bucket() {
misc_run_on_language_setup(Language_injection);
}
}

View File

@ -238,4 +238,3 @@ void init_cake() {
}
}
}

View File

@ -46,4 +46,3 @@ void init_camera() {
overwrite_call((void *) 0x87dc4, (void *) TripodCamera_tick_Level_addParticle_call_injection);
}
}

View File

@ -99,4 +99,3 @@ void init_chat() {
patch((void *) 0x6b4c0, message_limit_patch);
}
}

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;
@ -153,4 +153,3 @@ void _init_chat_ui() {
}
});
}

View File

@ -17,4 +17,3 @@ void _patch_bcm_host_calls() {
overwrite_call((void *) 0x12618, (void *) do_nothing); // vc_dispmanx_element_add
overwrite_call((void *) 0x12624, (void *) do_nothing); // vc_dispmanx_update_submit_sync
}

View File

@ -140,4 +140,3 @@ void compat_request_exit() {
// Request
exit_requested = 1;
}

View File

@ -38,4 +38,3 @@ void _patch_egl_calls() {
patch((void *) 0x12504, nop_patch); // eglDestroySurface #2
overwrite_call((void *) 0x12594, (void *) eglCreateContext_injection); // eglCreateContext
}

View File

@ -27,4 +27,3 @@ void _patch_x11_calls() {
overwrite_call((void *) 0x132a4, (void *) XGetWindowAttributes_injection); // XGetWindowAttributes
overwrite_call((void *) 0x132d4, (void *) XTranslateCoordinates_injection); // XTranslateCoordinates
}

View File

@ -173,4 +173,3 @@ void init_creative() {
patch((void *) 0x8e104, maximize_stack_patch);
}
}

View File

@ -144,4 +144,3 @@ void init_death() {
unsigned char ldr_r0_24_patch[4] = {0x24, 0x00, 0x90, 0xe5}; // "ldr r0, [r0, #0x24]"
patch((void *) 0x8799c, ldr_r0_24_patch);
}

View File

@ -27,4 +27,3 @@ bool _feature_has(const char *name) {
// Return
return ret;
}

View File

@ -52,4 +52,3 @@ void init_fps() {
misc_run_on_tick(print_fps);
}
}

View File

@ -76,4 +76,3 @@ void init_game_mode() {
patch((void *) 0x6dc70, server_patch);
}
}

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

@ -31,4 +31,3 @@ void init_home() {
unsigned char nop_patch[4] = {0x00, 0xf0, 0x20, 0xe3}; // "nop"
patch((void *) 0xe0ac, nop_patch);
}

View File

@ -40,4 +40,3 @@ __attribute__((constructor)) static void init() {
init_benchmark();
#endif
}

View File

@ -63,4 +63,3 @@ void _init_attack() {
overwrite_call((void *) 0x8fc24, (void *) Player_attack_Inventory_getSelected_injection);
}
}

View File

@ -31,4 +31,3 @@ void _init_bow() {
fix_bow = feature_has("Fix Bow & Arrow", server_disabled);
input_run_on_tick(_handle_bow);
}

View File

@ -28,4 +28,3 @@ static void _handle_open_crafting(Minecraft *minecraft) {
void _init_crafting() {
input_run_on_tick(_handle_open_crafting);
}

View File

@ -78,4 +78,3 @@ void _init_drop() {
enable_drop = feature_has("Bind \"Q\" Key To Item Dropping", server_disabled);
input_run_on_tick(_handle_drop);
}

View File

@ -57,4 +57,3 @@ void init_input() {
media_set_raw_mouse_motion_enabled(0);
}
}

View File

@ -115,4 +115,3 @@ void _init_misc() {
input_run_on_tick(_handle_back);
input_run_on_tick(_handle_mouse_grab);
}

View File

@ -97,4 +97,3 @@ void _init_toggle() {
overwrite_calls(ParticleEngine_render, ParticleEngine_render_injection);
}
}

View File

@ -183,4 +183,3 @@ void _init_misc_api() {
// Handle Key Presses
overwrite_calls(Gui_handleKeyPressed, Gui_handleKeyPressed_injection);
}

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;
}
@ -97,4 +97,3 @@ void _init_misc_logging() {
// Disable stdout Buffering
setvbuf(stdout, nullptr, _IONBF, 0);
}

View File

@ -997,4 +997,3 @@ void init_misc() {
_init_misc_logging();
_init_misc_api();
}

View File

@ -133,4 +133,3 @@ void init_multiplayer() {
overwrite_virtual_calls(RakNetInstance_pingForHosts, RakNetInstance_pingForHosts_injection);
}
}

View File

@ -247,4 +247,3 @@ void init_options() {
// UI
_init_options_ui();
}

View File

@ -104,4 +104,3 @@ HOOK(fopen64, FILE *, (const char *filename, const char *mode)) {
// Return File
return file;
}

View File

@ -20,4 +20,3 @@ dirent *readdir(DIR *dirp) {
new_dirent.d_type = original->d_type;
return &new_dirent;
}

View File

@ -104,4 +104,3 @@ void screenshot_take(char *home) {
free(screenshots);
free(pixels);
}

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);
@ -594,4 +594,3 @@ void init_server() {
set_and_print_env("MCPI_RENDER_DISTANCE", "Tiny");
set_and_print_env("MCPI_USERNAME", get_motd().c_str());
}

View File

@ -35,4 +35,3 @@ bool ServerProperties::get_bool(std::string const& name, std::string const& def)
}
return is_true(def);
}

View File

@ -55,4 +55,3 @@ void init_sign() {
// Handle Backspace
overwrite_calls(Common_sdl_key_to_minecraft_key, sdl_key_to_minecraft_key_injection);
}

View File

@ -142,4 +142,3 @@ void _init_skin_loader() {
// Log
DEBUG("Skin Server: %s", get_skin_server().c_str());
}

View File

@ -95,4 +95,3 @@ void init_skin() {
_init_skin_loader();
}
}

View File

@ -377,4 +377,3 @@ void _sound_resolve_all() {
}
}
}

View File

@ -125,4 +125,3 @@ void init_sound() {
overwrite_calls(SoundEngine_init, SoundEngine_init_injection);
}
}

View File

@ -20,4 +20,3 @@ void run_tests() {
}
}
}

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;
@ -297,4 +297,3 @@ bool TextInputBox::isFocused() {
void TextInputBox::setMaxLength(int max_length) {
m_maxLength = max_length;
}

View File

@ -54,4 +54,3 @@ void TextInputScreen::setup(Screen_vtable *vtable) {
delete self->m_textInputs;
};
}

View File

@ -21,4 +21,3 @@ void init_textures() {
// Disable Texture Loading
overwrite_virtual_calls(AppPlatform_linux_loadTexture, AppPlatform_linux_loadTexture_injection);
}

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;
}
}
@ -259,4 +259,3 @@ void _init_textures_lava(bool animated_water_param, bool animated_lava_param, bo
animated_fire = animated_fire_param;
overwrite_call((void *) 0x170b4, (void *) Textures_addDynamicTexture_injection);
}

View File

@ -236,4 +236,3 @@ void init_textures() {
// Load Textures
overwrite_virtual_calls(AppPlatform_linux_loadTexture, AppPlatform_linux_loadTexture_injection);
}

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) {
@ -166,4 +166,3 @@ void init_title_screen() {
srand(time(nullptr));
}
}

View File

@ -106,4 +106,3 @@ void init_touch() {
unsigned char outline_patch[4] = {(unsigned char) (block_outlines ? !touch_gui : touch_gui), 0x00, 0x50, 0xe3}; // "cmp r0, #0x1" or "cmp r0, #0x0"
patch((void *) 0x4a210, outline_patch);
}

View File

@ -35,4 +35,3 @@ void init_version() {
// Log
INFO("Starting Minecraft: Pi Edition (%s)", version_get());
}