From 34eb1cb3c21885873a21ad30902e9d4a38147592 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Sun, 4 Oct 2020 17:52:42 -0400 Subject: [PATCH] Update Defaults --- debian/usr/bin/minecraft-pi | 2 +- mods/src/extra.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/usr/bin/minecraft-pi b/debian/usr/bin/minecraft-pi index d5a8078..f15e62c 100755 --- a/debian/usr/bin/minecraft-pi +++ b/debian/usr/bin/minecraft-pi @@ -4,7 +4,7 @@ set -e # Ensure Features Are Selected if [ -z "${MCPI_SUBSHELL}" ]; then - MCPI_FEATURES="$(zenity --class minecraft-pi --list --checklist --column 'Enabled' --column 'Feature' FALSE 'Touch GUI' FALSE 'Survival Mode' FALSE 'Fix Bow & Arrow' FALSE 'Fix Attacking' FALSE 'Mob Spawning' FALSE 'Fancy Graphics' FALSE 'Disable Autojump By Default' FALSE 'Fix Sign Placement')" + MCPI_FEATURES="$(zenity --class minecraft-pi --list --checklist --column 'Enabled' --column 'Feature' TRUE 'Touch GUI' FALSE 'Survival Mode' TRUE 'Fix Bow & Arrow' TRUE 'Fix Attacking' TRUE 'Mob Spawning' TRUE 'Fancy Graphics' TRUE 'Disable Autojump By Default' TRUE 'Fix Sign Placement' TRUE 'Show Block Outlines')" MCPI_USERNAME="$(zenity --class minecraft-pi --entry --text 'Minecraft Username:' --entry-text 'StevePi')" fi export MCPI_FEATURES diff --git a/mods/src/extra.c b/mods/src/extra.c index cf4f9f9..7852a39 100644 --- a/mods/src/extra.c +++ b/mods/src/extra.c @@ -182,7 +182,7 @@ __attribute__((constructor)) static void init() { // Allocate Correct Size For ServerLevel unsigned char patch_data_5[4] = {0x94, 0x0b, 0x00, 0x00}; patch((void *) 0x17004, patch_data_5); - + if (has_feature("Fancy Graphics")) { // Enable Fancy Graphics minecraft_init_original = overwrite((void *) minecraft_init, minecraft_init_injection); @@ -206,4 +206,10 @@ __attribute__((constructor)) static void init() { // Fix Segmentation Fault unsigned char segfault_patch[4] = {0x03, 0x00, 0x00, 0xea}; patch((void *) 0x4a630, segfault_patch); + + if (has_feature("Show Block Outlines")) { + // Show Block Outlines + unsigned char outline_patch[4] = {0x00, 0xf0, 0x20, 0xe3}; + patch((void *) 0x4a214, outline_patch); + } }