From 157d51e6b68f35335fc3ebd4a0f95365da6ffaa6 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Sat, 9 Apr 2022 20:01:16 -0400 Subject: [PATCH] Improve feature_has --- launcher/src/bootstrap.c | 16 +++------------- mods/CMakeLists.txt | 14 +++++++------- mods/src/atlas/atlas.cpp | 2 +- mods/src/camera/camera.cpp | 2 +- mods/src/chat/chat.cpp | 2 +- mods/src/creative/creative.cpp | 8 ++++++-- mods/src/death/death.cpp | 2 +- mods/src/feature/feature.c | 11 +---------- mods/src/feature/feature.h | 11 ++++++++++- mods/src/game-mode/game-mode.c | 4 ++-- mods/src/input/attack.c | 2 +- mods/src/input/bow.c | 2 +- mods/src/input/drop.cpp | 2 +- mods/src/input/input.cpp | 2 +- mods/src/input/misc.c | 2 +- mods/src/input/toggle.c | 2 +- mods/src/misc/misc.c | 14 +++++++------- mods/src/misc/misc.cpp | 2 +- mods/src/multiplayer/multiplayer.cpp | 2 +- mods/src/options/options.c | 16 ++++++++-------- mods/src/sign/sign.cpp | 2 +- mods/src/sound/sound.cpp | 2 +- mods/src/textures/textures.cpp | 2 +- mods/src/touch/touch.c | 2 +- scripts/generate-appimage-builder-yaml.js | 4 +--- scripts/install-dependencies.sh | 2 +- 26 files changed, 62 insertions(+), 70 deletions(-) diff --git a/launcher/src/bootstrap.c b/launcher/src/bootstrap.c index c14fc65f..1000e70f 100644 --- a/launcher/src/bootstrap.c +++ b/launcher/src/bootstrap.c @@ -255,7 +255,7 @@ void bootstrap(int argc, char *argv[]) { // Load ARM Libraries (Ensure Priority) string_append(&new_ld_path, ":%s/usr/lib/arm-linux-gnueabihf:%s/usr/arm-linux-gnueabihf/lib", usr_prefix, usr_prefix); - // Add LD_LIBRARY_PATH (ARM32 Only) + // Add LD_LIBRARY_PATH { char *value = get_env_safe("LD_LIBRARY_PATH"); if (strlen(value) > 0) { @@ -299,24 +299,14 @@ void bootstrap(int argc, char *argv[]) { free(mods_folder); } - // Add MCPI_LD_PRELOAD + // Add LD_PRELOAD { - char *value = get_env_safe("MCPI_LD_PRELOAD"); + char *value = get_env_safe("LD_PRELOAD"); if (strlen(value) > 0) { string_append(&new_ld_preload, ":%s", value); } } - // Add LD_PRELOAD (ARM32 Only) -#ifdef __arm__ - { - char *value = get_env_safe("MCPI_LD_PRELOAD"); - if (strlen(value) > 0) { - string_append(&new_ld_preload, ":%s", value); - } - } -#endif - // Set LD_PRELOAD set_and_print_env("LD_PRELOAD", new_ld_preload); free(new_ld_preload); diff --git a/mods/CMakeLists.txt b/mods/CMakeLists.txt index 6fb757a6..54e82892 100644 --- a/mods/CMakeLists.txt +++ b/mods/CMakeLists.txt @@ -21,6 +21,9 @@ target_link_libraries(version reborn-patch symbols) add_library(chat SHARED src/chat/chat.cpp src/chat/ui.c) target_link_libraries(chat reborn-patch symbols feature pthread) +add_library(creative SHARED src/creative/creative.cpp) +target_link_libraries(creative reborn-patch symbols feature) + if(MCPI_SERVER_MODE) add_library(server SHARED src/server/server.cpp src/server/server_properties.cpp) target_link_libraries(server reborn-patch symbols feature home misc compat dl media-layer-core pthread) @@ -44,9 +47,6 @@ else() add_library(sign SHARED src/sign/sign.cpp) target_link_libraries(sign reborn-patch symbols feature input) - add_library(creative SHARED src/creative/creative.cpp) - target_link_libraries(creative reborn-patch symbols feature) - add_library(touch SHARED src/touch/touch.c) target_link_libraries(touch reborn-patch symbols feature) @@ -84,22 +84,22 @@ add_library(test SHARED src/test/test.c) target_link_libraries(test reborn-patch home) add_library(init SHARED src/init/init.c) -target_link_libraries(init compat game-mode misc death options chat home version test media-layer-core) +target_link_libraries(init compat game-mode misc death options chat creative home version test media-layer-core) if(MCPI_SERVER_MODE) target_link_libraries(init server) else() - target_link_libraries(init multiplayer sound camera input sign creative touch textures atlas) + target_link_libraries(init multiplayer sound camera input sign touch textures atlas) if(NOT MCPI_HEADLESS_MODE) target_link_libraries(init benchmark) endif() endif() ## Install Mods -install(TARGETS init compat readdir feature game-mode misc death options chat home version test DESTINATION "${MCPI_INSTALL_DIR}/mods") +install(TARGETS init compat readdir feature game-mode misc death options chat creative home version test DESTINATION "${MCPI_INSTALL_DIR}/mods") if(MCPI_SERVER_MODE) install(TARGETS server DESTINATION "${MCPI_INSTALL_DIR}/mods") else() - install(TARGETS multiplayer sound override camera input sign creative touch textures atlas DESTINATION "${MCPI_INSTALL_DIR}/mods") + install(TARGETS multiplayer sound override camera input sign touch textures atlas DESTINATION "${MCPI_INSTALL_DIR}/mods") if(NOT MCPI_HEADLESS_MODE) install(TARGETS benchmark DESTINATION "${MCPI_INSTALL_DIR}/mods") endif() diff --git a/mods/src/atlas/atlas.cpp b/mods/src/atlas/atlas.cpp index d4ce04c3..f0c88371 100644 --- a/mods/src/atlas/atlas.cpp +++ b/mods/src/atlas/atlas.cpp @@ -123,7 +123,7 @@ void init_atlas() { overwrite_calls((void *) ItemRenderer_renderGuiItem_two, (void *) ItemRenderer_renderGuiItem_two_injection); // Disable The gui_blocks Atlas Which Contains Pre-Rendered Textures For Blocks In The Inventory - if (feature_has("Disable \"gui_blocks\" Atlas", 0)) { + if (feature_has("Disable \"gui_blocks\" Atlas", server_disabled)) { unsigned char disable_gui_blocks_atlas_patch[4] = {0x00, 0xf0, 0x20, 0xe3}; // "nop" patch((void *) 0x63c2c, disable_gui_blocks_atlas_patch); // Fix Grass And Leaves Inventory Rendering When The gui_blocks Atlas Is Disabled diff --git a/mods/src/camera/camera.cpp b/mods/src/camera/camera.cpp index ba999524..2679fd5b 100644 --- a/mods/src/camera/camera.cpp +++ b/mods/src/camera/camera.cpp @@ -37,7 +37,7 @@ void init_camera() { patch_address(AppPlatform_linux_saveScreenshot_vtable_addr, (void *) AppPlatform_linux_saveScreenshot_injection); // Fix Camera Rendering - if (feature_has("Fix Camera Rendering", 0)) { + if (feature_has("Fix Camera Rendering", server_disabled)) { // Enable TripodCameraRenderer overwrite_calls((void *) EntityRenderDispatcher, (void *) EntityRenderDispatcher_injection); // Display Smoke From TripodCamera Higher diff --git a/mods/src/chat/chat.cpp b/mods/src/chat/chat.cpp index 6435ce74..17c5719f 100644 --- a/mods/src/chat/chat.cpp +++ b/mods/src/chat/chat.cpp @@ -119,7 +119,7 @@ static void send_queued_messages(unsigned char *minecraft) { // Init void init_chat() { - _chat_enabled = feature_has("Implement Chat", 1); + _chat_enabled = feature_has("Implement Chat", server_enabled); if (_chat_enabled) { // Disable Original ChatPacket Loopback unsigned char disable_chat_packet_loopback_patch[4] = {0x00, 0xf0, 0x20, 0xe3}; // "nop" diff --git a/mods/src/creative/creative.cpp b/mods/src/creative/creative.cpp index bd4506bc..7a272a1b 100644 --- a/mods/src/creative/creative.cpp +++ b/mods/src/creative/creative.cpp @@ -5,6 +5,7 @@ #include "../feature/feature.h" #include "creative.h" +#ifndef MCPI_SERVER_MODE // Add Item To Inventory static void inventory_add_item(unsigned char *inventory, unsigned char *item, bool is_tile) { ItemInstance *item_instance = new ItemInstance; @@ -80,6 +81,7 @@ static int32_t Inventory_setupDefault_FillingContainer_addItem_call_injection(un return ret; } +#endif // Hook Specific TileItem Constructor static unsigned char *Tile_initTiles_TileItem_injection(unsigned char *tile_item, int32_t id) { @@ -106,8 +108,10 @@ int creative_is_restricted() { // Init void init_creative() { // Add Extra Items To Creative Inventory (Only Replace Specific Function Call) - if (feature_has("Expand Creative Inventory", 0)) { + if (feature_has("Expand Creative Inventory", server_enabled)) { +#ifndef MCPI_SERVER_MODE overwrite_call((void *) 0x8e0fc, (void *) Inventory_setupDefault_FillingContainer_addItem_call_injection); +#endif // Use AuxDataTileItem by default instead of TileItem, so tiles in the Creative // Inventory can have arbitrary auxiliary values. @@ -121,7 +125,7 @@ void init_creative() { } // Remove Creative Restrictions (Opening Chests, Crafting, Etc) - if (feature_has("Remove Creative Mode Restrictions", 0)) { + if (feature_has("Remove Creative Mode Restrictions", server_disabled)) { unsigned char nop_patch[4] = {0x00, 0xf0, 0x20, 0xe3}; // "nop" // Remove Restrictions patch((void *) 0x43ee8, nop_patch); diff --git a/mods/src/death/death.cpp b/mods/src/death/death.cpp index d55b0cca..b360b8b1 100644 --- a/mods/src/death/death.cpp +++ b/mods/src/death/death.cpp @@ -62,7 +62,7 @@ static void LocalPlayer_actuallyHurt_injection(unsigned char *player, int32_t da // Init void init_death() { // Death Messages - if (feature_has("Implement Death Messages", 1)) { + if (feature_has("Implement Death Messages", server_enabled)) { patch_address(ServerPlayer_actuallyHurt_vtable_addr, (void *) ServerPlayer_actuallyHurt_injection); patch_address(LocalPlayer_actuallyHurt_vtable_addr, (void *) LocalPlayer_actuallyHurt_injection); } diff --git a/mods/src/feature/feature.c b/mods/src/feature/feature.c index 782fa824..2e5a6b2f 100644 --- a/mods/src/feature/feature.c +++ b/mods/src/feature/feature.c @@ -6,16 +6,7 @@ #include "feature.h" // Check For Feature -int feature_has(const char *name, int server_default) { - // Default Value For Server Mode -#ifdef MCPI_SERVER_MODE - if (server_default != -1) { - return server_default; - } -#else - (void) server_default; -#endif - +int _feature_has(const char *name) { // Get Value char *env = getenv("MCPI_FEATURE_FLAGS"); char *features = strdup(env != NULL ? env : ""); diff --git a/mods/src/feature/feature.h b/mods/src/feature/feature.h index 922d74aa..528e8dc1 100644 --- a/mods/src/feature/feature.h +++ b/mods/src/feature/feature.h @@ -4,7 +4,16 @@ extern "C" { #endif -int feature_has(const char *name, int server_default); +int _feature_has(const char *name); + +#ifdef MCPI_SERVER_MODE +#define _feature_has__server_defaul_is_server_disabled(name) 0 +#define _feature_has__server_defaul_is_server_auto(name) _feature_has(name) +#define _feature_has__server_defaul_is_server_enabled(name) 1 +#define feature_has(name, server_default) _feature_has__server_defaul_is_##server_default(name) +#else +#define feature_has(name, server_default) _feature_has(name) +#endif #ifdef __cplusplus } diff --git a/mods/src/game-mode/game-mode.c b/mods/src/game-mode/game-mode.c index 11f84f57..04d4b592 100644 --- a/mods/src/game-mode/game-mode.c +++ b/mods/src/game-mode/game-mode.c @@ -49,7 +49,7 @@ static unsigned char *Minecraft_getCreator_injection(unsigned char *minecraft) { // Init void init_game_mode() { // Dynamic Game Mode Switching - if (feature_has("Implement Game-Mode Switching", 1)) { + if (feature_has("Implement Game-Mode Switching", server_enabled)) { set_is_survival(1); overwrite_calls((void *) Minecraft_setIsCreativeMode, (void *) Minecraft_setIsCreativeMode_injection); @@ -68,7 +68,7 @@ void init_game_mode() { } // Allow Joining Survival Servers - if (feature_has("Allow Joining Survival Servers", 1)) { + if (feature_has("Allow Joining Survival Servers", server_enabled)) { unsigned char server_patch[4] = {0x0f, 0x00, 0x00, 0xea}; // "b 0x6dcb4" patch((void *) 0x6dc70, server_patch); } diff --git a/mods/src/input/attack.c b/mods/src/input/attack.c index 38d4e911..2afb7ee6 100644 --- a/mods/src/input/attack.c +++ b/mods/src/input/attack.c @@ -40,7 +40,7 @@ static int32_t MouseBuildInput_tickBuild_injection(unsigned char *mouse_build_in // Init void _init_attack() { // Allow Attacking Mobs - if (feature_has("Fix Attacking", 0)) { + if (feature_has("Fix Attacking", server_disabled)) { patch_address(MouseBuildInput_tickBuild_vtable_addr, (void *) MouseBuildInput_tickBuild_injection); } } diff --git a/mods/src/input/bow.c b/mods/src/input/bow.c index 9313a47b..157237a8 100644 --- a/mods/src/input/bow.c +++ b/mods/src/input/bow.c @@ -31,6 +31,6 @@ static void _handle_bow(unsigned char *minecraft) { // Init void _init_bow() { // Enable Bow & Arrow Fix - fix_bow = feature_has("Fix Bow & Arrow", 0); + fix_bow = feature_has("Fix Bow & Arrow", server_disabled); input_run_on_tick(_handle_bow); } diff --git a/mods/src/input/drop.cpp b/mods/src/input/drop.cpp index c220e0bb..3f96a758 100644 --- a/mods/src/input/drop.cpp +++ b/mods/src/input/drop.cpp @@ -86,6 +86,6 @@ static void _handle_drop(unsigned char *minecraft) { // Init void _init_drop() { - enable_drop = feature_has("Bind \"Q\" Key To Item Dropping", 0); + enable_drop = feature_has("Bind \"Q\" Key To Item Dropping", server_disabled); input_run_on_tick(_handle_drop); } diff --git a/mods/src/input/input.cpp b/mods/src/input/input.cpp index 0729a246..c7b5ef7d 100644 --- a/mods/src/input/input.cpp +++ b/mods/src/input/input.cpp @@ -49,7 +49,7 @@ void init_input() { _init_attack(); // Disable Raw Mouse Motion - if (feature_has("Disable Raw Mouse Motion (Not Recommended)", 9)) { + if (feature_has("Disable Raw Mouse Motion (Not Recommended)", server_disabled)) { media_set_raw_mouse_motion_enabled(0); } } diff --git a/mods/src/input/misc.c b/mods/src/input/misc.c index 92fc7913..5be260f6 100644 --- a/mods/src/input/misc.c +++ b/mods/src/input/misc.c @@ -79,7 +79,7 @@ static void Gui_handleClick_injection(unsigned char *gui, int32_t param_2, int32 // Init void _init_misc() { - enable_misc = feature_has("Miscellaneous Input Fixes", 0); + enable_misc = feature_has("Miscellaneous Input Fixes", server_disabled); if (enable_misc) { // Fix OptionsScreen Ignoring The Back Button patch_address(OptionsScreen_handleBackEvent_vtable_addr, (void *) OptionsScreen_handleBackEvent_injection); diff --git a/mods/src/input/toggle.c b/mods/src/input/toggle.c index 1b68e9a9..3a030410 100644 --- a/mods/src/input/toggle.c +++ b/mods/src/input/toggle.c @@ -37,6 +37,6 @@ static void _handle_toggle_options(unsigned char *minecraft) { // Init void _init_toggle() { - enable_toggles = feature_has("Bind Common Toggleable Options To Function Keys", 0); + enable_toggles = feature_has("Bind Common Toggleable Options To Function Keys", server_disabled); input_run_on_tick(_handle_toggle_options); } diff --git a/mods/src/misc/misc.c b/mods/src/misc/misc.c index ac76d804..beca6ae3 100644 --- a/mods/src/misc/misc.c +++ b/mods/src/misc/misc.c @@ -204,14 +204,14 @@ static void GameRenderer_render_injection(unsigned char *game_renderer, float pa // Init void init_misc() { // Remove Invalid Item Background (A Red Background That Appears For Items That Are Not Included In The gui_blocks Atlas) - if (feature_has("Remove Invalid Item Background", 0)) { + if (feature_has("Remove Invalid Item Background", server_disabled)) { unsigned char invalid_item_background_patch[4] = {0x00, 0xf0, 0x20, 0xe3}; // "nop" patch((void *) 0x63c98, invalid_item_background_patch); } // Render Selected Item Text + Hide Chat Messages - hide_chat_messages = feature_has("Hide Chat Messages", 0); - render_selected_item_text = feature_has("Render Selected Item Text", 0); + hide_chat_messages = feature_has("Hide Chat Messages", server_disabled); + render_selected_item_text = feature_has("Render Selected Item Text", server_disabled); overwrite_calls((void *) Gui_renderChatMessages, (void *) Gui_renderChatMessages_injection); overwrite_calls((void *) Gui_tick, (void *) Gui_tick_injection); overwrite_calls((void *) Inventory_selectSlot, (void *) Inventory_selectSlot_injection); @@ -229,17 +229,17 @@ void init_misc() { overwrite_calls((void *) RakNetInstance, (void *) RakNetInstance_injection); // Close Current Screen On Death To Prevent Bugs - if (feature_has("Close Current Screen On Death", 0)) { + if (feature_has("Close Current Screen On Death", server_disabled)) { patch_address(LocalPlayer_die_vtable_addr, (void *) LocalPlayer_die_injection); } // Fix Furnace Not Checking Item Auxiliary When Inserting New Item - if (feature_has("Fix Furnace Not Checking Item Auxiliary", 0)) { + if (feature_has("Fix Furnace Not Checking Item Auxiliary", server_disabled)) { overwrite_calls((void *) FurnaceScreen_handleAddItem, (void *) FurnaceScreen_handleAddItem_injection); } // Improved Cursor Rendering - if (feature_has("Improved Cursor Rendering", 0)) { + if (feature_has("Improved Cursor Rendering", server_disabled)) { // Disable Normal Cursor Rendering unsigned char disable_cursor_patch[4] = {0x00, 0xf0, 0x20, 0xe3}; // "nop" patch((void *) 0x4a6c0, disable_cursor_patch); @@ -248,7 +248,7 @@ void init_misc() { } // Disable V-Sync - if (feature_has("Disable V-Sync", 0)) { + if (feature_has("Disable V-Sync", server_disabled)) { media_disable_vsync(); } diff --git a/mods/src/misc/misc.cpp b/mods/src/misc/misc.cpp index 00313348..81b1f000 100644 --- a/mods/src/misc/misc.cpp +++ b/mods/src/misc/misc.cpp @@ -48,7 +48,7 @@ static void Minecraft_update_injection(unsigned char *minecraft) { // Init void _init_misc_cpp() { // Implement AppPlatform::readAssetFile So Translations Work - if (feature_has("Load Language Files", 1)) { + if (feature_has("Load Language Files", server_enabled)) { overwrite((void *) AppPlatform_readAssetFile, (void *) AppPlatform_readAssetFile_injection); } diff --git a/mods/src/multiplayer/multiplayer.cpp b/mods/src/multiplayer/multiplayer.cpp index 2f2e5f2d..462e51e3 100644 --- a/mods/src/multiplayer/multiplayer.cpp +++ b/mods/src/multiplayer/multiplayer.cpp @@ -127,7 +127,7 @@ static void RakNetInstance_pingForHosts_injection(unsigned char *rak_net_instanc // Init void init_multiplayer() { // Inject Code - if (feature_has("External Server Support", 0)) { + if (feature_has("External Server Support", server_disabled)) { patch_address(RakNetInstance_pingForHosts_vtable_addr, (void *) RakNetInstance_pingForHosts_injection); } } diff --git a/mods/src/options/options.c b/mods/src/options/options.c index dc1cf68e..554e63e1 100644 --- a/mods/src/options/options.c +++ b/mods/src/options/options.c @@ -72,16 +72,16 @@ static void Minecraft_init_injection(unsigned char *this) { // Init void init_options() { // Force Mob Spawning - if (feature_has("Force Mob Spawning", -1)) { + if (feature_has("Force Mob Spawning", server_auto)) { overwrite((void *) LevelData_getSpawnMobs, (void *) LevelData_getSpawnMobs_injection); } // Enable Fancy Graphics - fancy_graphics = feature_has("Fancy Graphics", 0); + fancy_graphics = feature_has("Fancy Graphics", server_disabled); // Peaceful Mode - peaceful_mode = feature_has("Peaceful Mode", -1); + peaceful_mode = feature_has("Peaceful Mode", server_auto); // 3D Anaglyph - anaglyph = feature_has("3D Anaglyph", 0); + anaglyph = feature_has("3D Anaglyph", server_disabled); // Render Distance #ifndef MCPI_SERVER_MODE render_distance = get_render_distance(); @@ -90,7 +90,7 @@ void init_options() { render_distance = 3; #endif // Server Visible - server_visible = !feature_has("Disable Hosting LAN Worlds", 0); + server_visible = !feature_has("Disable Hosting LAN Worlds", server_disabled); // Set Options overwrite_calls((void *) Minecraft_init, (void *) Minecraft_init_injection); @@ -106,12 +106,12 @@ void init_options() { patch_address((void *) default_username, (void *) username); // Disable Autojump By Default - if (feature_has("Disable Autojump By Default", 0)) { + if (feature_has("Disable Autojump By Default", server_disabled)) { unsigned char autojump_patch[4] = {0x00, 0x30, 0xa0, 0xe3}; // "mov r3, #0x0" patch((void *) 0x44b90, autojump_patch); } // Display Nametags By Default - if (feature_has("Display Nametags By Default", 0)) { + if (feature_has("Display Nametags By Default", server_disabled)) { // r6 = 0x1 // r5 = 0x0 unsigned char display_nametags_patch[4] = {0x1d, 0x60, 0xc0, 0xe5}; // "strb r6, [r0, #0x1d]" @@ -119,7 +119,7 @@ void init_options() { } // Enable Smooth Lighting - smooth_lighting = feature_has("Smooth Lighting", 0); + smooth_lighting = feature_has("Smooth Lighting", server_disabled); if (smooth_lighting) { unsigned char smooth_lighting_patch[4] = {0x01, 0x00, 0x53, 0xe3}; // "cmp r3, #0x1" patch((void *) 0x59ea4, smooth_lighting_patch); diff --git a/mods/src/sign/sign.cpp b/mods/src/sign/sign.cpp index 23ce2554..aa252352 100644 --- a/mods/src/sign/sign.cpp +++ b/mods/src/sign/sign.cpp @@ -58,7 +58,7 @@ static void TextEditScreen_updateEvents_injection(unsigned char *screen) { // Init void init_sign() { - if (feature_has("Fix Sign Placement", 0)) { + if (feature_has("Fix Sign Placement", server_disabled)) { // Fix Signs patch_address(LocalPlayer_openTextEdit_vtable_addr, (void *) LocalPlayer_openTextEdit_injection); patch_address(TextEditScreen_updateEvents_vtable_addr, (void *) TextEditScreen_updateEvents_injection); diff --git a/mods/src/sound/sound.cpp b/mods/src/sound/sound.cpp index 35491a75..a1d9825f 100644 --- a/mods/src/sound/sound.cpp +++ b/mods/src/sound/sound.cpp @@ -114,7 +114,7 @@ static void SoundEngine_init_injection(unsigned char *sound_engine, unsigned cha // Init void init_sound() { // Implement Sound Engine - if (feature_has("Implement Sound Engine", 0)) { + if (feature_has("Implement Sound Engine", server_disabled)) { overwrite_calls((void *) SoundEngine_playUI, (void *) SoundEngine_playUI_injection); overwrite_calls((void *) SoundEngine_play, (void *) SoundEngine_play_injection); overwrite_calls((void *) SoundEngine_update, (void *) SoundEngine_update_injection); diff --git a/mods/src/textures/textures.cpp b/mods/src/textures/textures.cpp index 641d4cec..1d7cb38f 100644 --- a/mods/src/textures/textures.cpp +++ b/mods/src/textures/textures.cpp @@ -166,7 +166,7 @@ static void Textures_tick_glTexSubImage2D_injection(GLenum target, GLint level, // Init void init_textures() { // Tick Dynamic Textures (Animated Water) - if (feature_has("Animated Water", 0)) { + if (feature_has("Animated Water", server_disabled)) { overwrite_calls((void *) Minecraft_tick, (void *) Minecraft_tick_injection); } diff --git a/mods/src/touch/touch.c b/mods/src/touch/touch.c index fb47db0b..134fc242 100644 --- a/mods/src/touch/touch.c +++ b/mods/src/touch/touch.c @@ -12,7 +12,7 @@ static int32_t Minecraft_isTouchscreen_injection(__attribute__((unused)) unsigne // Init void init_touch() { - int touch_gui = feature_has("Touch GUI", 0); + int touch_gui = feature_has("Touch GUI", server_disabled); if (touch_gui) { // Main UI overwrite((void *) Minecraft_isTouchscreen, (void *) Minecraft_isTouchscreen_injection); diff --git a/scripts/generate-appimage-builder-yaml.js b/scripts/generate-appimage-builder-yaml.js index 6698214d..2b92f0a9 100755 --- a/scripts/generate-appimage-builder-yaml.js +++ b/scripts/generate-appimage-builder-yaml.js @@ -131,9 +131,7 @@ const runtime = { `usr/lib/${name}/minecraft-pi`, `usr/lib/${name}/**/*.so`, 'usr/arm-linux-gnueabihf/lib' - ] : undefined, - // libapprun_hooks.so Is Buggy And Unneeded - no_hooks: true + ] : undefined }; // AppDir diff --git a/scripts/install-dependencies.sh b/scripts/install-dependencies.sh index b80c52c5..099588ff 100755 --- a/scripts/install-dependencies.sh +++ b/scripts/install-dependencies.sh @@ -118,4 +118,4 @@ sudo rm -f /usr/local/bin/appimagetool sudo ln -s /opt/appimagetool.AppDir/AppRun /usr/local/bin/appimagetool # Install appimage-builder -sudo pip3 install 'git+https://github.com/TheBrokenRail/appimage-builder.git@combined' +sudo pip3 install 'git+https//github.com/AppImageCrafters/appimage-builder.git'