Add Some Symbols From MCPI-Addons
This commit is contained in:
parent
34c24378f3
commit
d32fa2d265
2
dependencies/symbol-processor/src
vendored
2
dependencies/symbol-processor/src
vendored
@ -1 +1 @@
|
||||
Subproject commit 1062e048c493607b7b57faf83570562fa44c0f9c
|
||||
Subproject commit 00b223a6adb8808b34f49371b6f2f30c182f147a
|
@ -8,17 +8,17 @@
|
||||
|
||||
// Fix Grass And Leaves Inventory Rendering When The gui_blocks Atlas Is Disabled
|
||||
static void ItemRenderer_renderGuiItemCorrect_injection(Font *font, Textures *textures, ItemInstance *item_instance, int32_t param_1, int32_t param_2) {
|
||||
int32_t leaves_id = (*Tile_leaves)->id;
|
||||
int32_t grass_id = (*Tile_grass)->id;
|
||||
int32_t leaves_id = Tile_leaves->id;
|
||||
int32_t grass_id = Tile_grass->id;
|
||||
// Replace Rendered Item With Carried Variant
|
||||
ItemInstance carried_item_instance;
|
||||
bool use_carried = false;
|
||||
if (item_instance != NULL) {
|
||||
if (item_instance->id == leaves_id) {
|
||||
(*ItemInstance_constructor_tile_extra)(&carried_item_instance, *Tile_leaves_carried, item_instance->count, item_instance->auxiliary);
|
||||
(*ItemInstance_constructor_tile_extra)(&carried_item_instance, Tile_leaves_carried, item_instance->count, item_instance->auxiliary);
|
||||
use_carried = true;
|
||||
} else if (item_instance->id == grass_id) {
|
||||
(*ItemInstance_constructor_tile_extra)(&carried_item_instance, *Tile_grass_carried, item_instance->count, item_instance->auxiliary);
|
||||
(*ItemInstance_constructor_tile_extra)(&carried_item_instance, Tile_grass_carried, item_instance->count, item_instance->auxiliary);
|
||||
use_carried = true;
|
||||
}
|
||||
}
|
||||
|
@ -10,18 +10,18 @@ Item *bucket = NULL;
|
||||
|
||||
// Description And Texture
|
||||
static std::string BucketItem_getDescriptionId(__attribute__((unused)) Item *item, ItemInstance *item_instance) {
|
||||
if (item_instance->auxiliary == (*Tile_water)->id) {
|
||||
if (item_instance->auxiliary == Tile_water->id) {
|
||||
return "item.bucketWater";
|
||||
} else if (item_instance->auxiliary == (*Tile_lava)->id) {
|
||||
} else if (item_instance->auxiliary == Tile_lava->id) {
|
||||
return "item.bucketLava";
|
||||
} else {
|
||||
return "item.bucket";
|
||||
}
|
||||
}
|
||||
static int32_t BucketItem_getIcon(__attribute__((unused)) Item *item, int32_t auxiliary) {
|
||||
if (auxiliary == (*Tile_water)->id) {
|
||||
if (auxiliary == Tile_water->id) {
|
||||
return 75;
|
||||
} else if (auxiliary == (*Tile_lava)->id) {
|
||||
} else if (auxiliary == Tile_lava->id) {
|
||||
return 76;
|
||||
} else {
|
||||
return 74;
|
||||
@ -36,10 +36,10 @@ static int32_t BucketItem_useOn(__attribute__((unused)) Item *item, ItemInstance
|
||||
// Empty Bucket
|
||||
int32_t new_auxiliary = 0;
|
||||
int32_t tile = level->vtable->getTile(level, x, y, z);
|
||||
if (tile == (*Tile_calmWater)->id) {
|
||||
new_auxiliary = (*Tile_water)->id;
|
||||
} else if (tile == (*Tile_calmLava)->id) {
|
||||
new_auxiliary = (*Tile_lava)->id;
|
||||
if (tile == Tile_calmWater->id) {
|
||||
new_auxiliary = Tile_water->id;
|
||||
} else if (tile == Tile_calmLava->id) {
|
||||
new_auxiliary = Tile_lava->id;
|
||||
}
|
||||
if (new_auxiliary != 0) {
|
||||
// Valid
|
||||
@ -103,7 +103,7 @@ static int32_t BucketItem_useOn(__attribute__((unused)) Item *item, ItemInstance
|
||||
if (material != NULL) {
|
||||
valid = !material->vtable->isSolid(material);
|
||||
}
|
||||
if (item_instance->auxiliary != (*Tile_water)->id && item_instance->auxiliary != (*Tile_lava)->id) {
|
||||
if (item_instance->auxiliary != Tile_water->id && item_instance->auxiliary != Tile_lava->id) {
|
||||
valid = false;
|
||||
}
|
||||
if (valid) {
|
||||
@ -177,8 +177,8 @@ static void inventory_add_item(FillingContainer *inventory, Item *item, int32_t
|
||||
}
|
||||
static void Inventory_setupDefault_FillingContainer_addItem_call_injection(FillingContainer *filling_container) {
|
||||
inventory_add_item(filling_container, bucket, 0);
|
||||
inventory_add_item(filling_container, bucket, (*Tile_water)->id);
|
||||
inventory_add_item(filling_container, bucket, (*Tile_lava)->id);
|
||||
inventory_add_item(filling_container, bucket, Tile_water->id);
|
||||
inventory_add_item(filling_container, bucket, Tile_lava->id);
|
||||
}
|
||||
|
||||
// Make Liquids Selectable
|
||||
@ -203,9 +203,9 @@ static void handle_tick(Minecraft *minecraft) {
|
||||
|
||||
// Prevent Breaking Liquid
|
||||
static bool is_calm_liquid(int32_t id) {
|
||||
if (id == (*Tile_calmWater)->id) {
|
||||
if (id == Tile_calmWater->id) {
|
||||
return true;
|
||||
} else if (id == (*Tile_calmLava)->id) {
|
||||
} else if (id == Tile_calmLava->id) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@ -254,7 +254,7 @@ static void Recipes_injection(Recipes *recipes) {
|
||||
|
||||
// Custom Furnace Fuel
|
||||
static int32_t FurnaceTileEntity_getBurnDuration_injection(ItemInstance *item_instance) {
|
||||
if (item_instance->count > 0 && item_instance->id == bucket->id && item_instance->auxiliary == (*Tile_lava)->id) {
|
||||
if (item_instance->count > 0 && item_instance->id == bucket->id && item_instance->auxiliary == Tile_lava->id) {
|
||||
return 20000;
|
||||
} else {
|
||||
// Call Original Method
|
||||
|
@ -68,7 +68,7 @@ void chat_handle_packet_send(Minecraft *minecraft, ChatPacket *packet) {
|
||||
// Hosting Multiplayer
|
||||
char *message = packet->message;
|
||||
ServerSideNetworkHandler *server_side_network_handler = (ServerSideNetworkHandler *) minecraft->network_handler;
|
||||
chat_send_message(server_side_network_handler, *Strings_default_username, message);
|
||||
chat_send_message(server_side_network_handler, Strings_default_username, message);
|
||||
} else {
|
||||
// Client
|
||||
rak_net_instance->vtable->send(rak_net_instance, (Packet *) packet);
|
||||
|
@ -24,10 +24,10 @@ static void inventory_add_item(FillingContainer *inventory, Tile *item) {
|
||||
// Expand Creative Inventory
|
||||
static void Inventory_setupDefault_FillingContainer_addItem_call_injection(FillingContainer *filling_container) {
|
||||
// Add Items
|
||||
inventory_add_item(filling_container, *Item_flintAndSteel);
|
||||
inventory_add_item(filling_container, *Item_snowball);
|
||||
inventory_add_item(filling_container, *Item_egg);
|
||||
inventory_add_item(filling_container, *Item_shears);
|
||||
inventory_add_item(filling_container, Item_flintAndSteel);
|
||||
inventory_add_item(filling_container, Item_snowball);
|
||||
inventory_add_item(filling_container, Item_egg);
|
||||
inventory_add_item(filling_container, Item_shears);
|
||||
// Dyes
|
||||
for (int i = 0; i < 16; i++) {
|
||||
if (i == 15) {
|
||||
@ -36,23 +36,23 @@ static void Inventory_setupDefault_FillingContainer_addItem_call_injection(Filli
|
||||
}
|
||||
ItemInstance *new_item_instance = new ItemInstance;
|
||||
ALLOC_CHECK(new_item_instance);
|
||||
new_item_instance = (*ItemInstance_constructor_item_extra)(new_item_instance, *Item_dye_powder, 1, i);
|
||||
new_item_instance = (*ItemInstance_constructor_item_extra)(new_item_instance, Item_dye_powder, 1, i);
|
||||
(*FillingContainer_addItem)(filling_container, new_item_instance);
|
||||
}
|
||||
inventory_add_item(filling_container, *Item_camera);
|
||||
inventory_add_item(filling_container, Item_camera);
|
||||
// Add Tiles
|
||||
inventory_add_item(filling_container, *Tile_water);
|
||||
inventory_add_item(filling_container, *Tile_lava);
|
||||
inventory_add_item(filling_container, *Tile_calmWater);
|
||||
inventory_add_item(filling_container, *Tile_calmLava);
|
||||
inventory_add_item(filling_container, *Tile_glowingObsidian);
|
||||
inventory_add_item(filling_container, *Tile_web);
|
||||
inventory_add_item(filling_container, *Tile_topSnow);
|
||||
inventory_add_item(filling_container, *Tile_ice);
|
||||
inventory_add_item(filling_container, *Tile_invisible_bedrock);
|
||||
inventory_add_item(filling_container, *Tile_bedrock);
|
||||
inventory_add_item(filling_container, *Tile_info_updateGame1);
|
||||
inventory_add_item(filling_container, *Tile_info_updateGame2);
|
||||
inventory_add_item(filling_container, Tile_water);
|
||||
inventory_add_item(filling_container, Tile_lava);
|
||||
inventory_add_item(filling_container, Tile_calmWater);
|
||||
inventory_add_item(filling_container, Tile_calmLava);
|
||||
inventory_add_item(filling_container, Tile_glowingObsidian);
|
||||
inventory_add_item(filling_container, Tile_web);
|
||||
inventory_add_item(filling_container, Tile_topSnow);
|
||||
inventory_add_item(filling_container, Tile_ice);
|
||||
inventory_add_item(filling_container, Tile_invisible_bedrock);
|
||||
inventory_add_item(filling_container, Tile_bedrock);
|
||||
inventory_add_item(filling_container, Tile_info_updateGame1);
|
||||
inventory_add_item(filling_container, Tile_info_updateGame2);
|
||||
// Nether Reactor
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (i == 0) {
|
||||
@ -61,7 +61,7 @@ static void Inventory_setupDefault_FillingContainer_addItem_call_injection(Filli
|
||||
}
|
||||
ItemInstance *new_item_instance = new ItemInstance;
|
||||
ALLOC_CHECK(new_item_instance);
|
||||
new_item_instance = (*ItemInstance_constructor_tile_extra)(new_item_instance, *Tile_netherReactor, 1, i);
|
||||
new_item_instance = (*ItemInstance_constructor_tile_extra)(new_item_instance, Tile_netherReactor, 1, i);
|
||||
(*FillingContainer_addItem)(filling_container, new_item_instance);
|
||||
}
|
||||
// Tall Grass
|
||||
@ -72,14 +72,14 @@ static void Inventory_setupDefault_FillingContainer_addItem_call_injection(Filli
|
||||
}
|
||||
ItemInstance *new_item_instance = new ItemInstance;
|
||||
ALLOC_CHECK(new_item_instance);
|
||||
new_item_instance = (*ItemInstance_constructor_tile_extra)(new_item_instance, *Tile_tallgrass, 1, i);
|
||||
new_item_instance = (*ItemInstance_constructor_tile_extra)(new_item_instance, Tile_tallgrass, 1, i);
|
||||
(*FillingContainer_addItem)(filling_container, new_item_instance);
|
||||
}
|
||||
// Smooth Stone Slab
|
||||
{
|
||||
ItemInstance *new_item_instance = new ItemInstance;
|
||||
ALLOC_CHECK(new_item_instance);
|
||||
new_item_instance = (*ItemInstance_constructor_tile_extra)(new_item_instance, *Tile_stoneSlab, 1, 6);
|
||||
new_item_instance = (*ItemInstance_constructor_tile_extra)(new_item_instance, Tile_stoneSlab, 1, 6);
|
||||
(*FillingContainer_addItem)(filling_container, new_item_instance);
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ __attribute__((destructor)) static void _free_home() {
|
||||
// Init
|
||||
void init_home() {
|
||||
// Store Data In ~/.minecraft-pi Instead Of ~/.minecraft
|
||||
patch_address((void *) Strings_default_path, (void *) HOME_SUBDIRECTORY_FOR_GAME_DATA);
|
||||
patch_address((void *) Strings_default_path_pointer, (void *) HOME_SUBDIRECTORY_FOR_GAME_DATA);
|
||||
|
||||
// The override code resolves assets manually,
|
||||
// making changing directory redundant.
|
||||
|
@ -32,8 +32,8 @@ static int use_classic_hud = 0;
|
||||
static void Gui_renderHearts_GuiComponent_blit_hearts_injection(Gui *component, int32_t x_dest, int32_t y_dest, int32_t x_src, int32_t y_src, int32_t width_dest, int32_t height_dest, int32_t width_src, int32_t height_src) {
|
||||
Minecraft *minecraft = component->minecraft;
|
||||
x_dest -= DEFAULT_HUD_PADDING;
|
||||
float width = ((float) minecraft->screen_width) * *Gui_InvGuiScale;
|
||||
float height = ((float) minecraft->screen_height) * *Gui_InvGuiScale;
|
||||
float width = ((float) minecraft->screen_width) * Gui_InvGuiScale;
|
||||
float height = ((float) minecraft->screen_height) * Gui_InvGuiScale;
|
||||
x_dest += (width - (NUMBER_OF_SLOTS * SLOT_WIDTH)) / 2;
|
||||
y_dest -= DEFAULT_HUD_PADDING;
|
||||
y_dest += height - HUD_ELEMENT_HEIGHT - TOOLBAR_HEIGHT - NEW_HUD_PADDING;
|
||||
@ -43,8 +43,8 @@ static void Gui_renderHearts_GuiComponent_blit_hearts_injection(Gui *component,
|
||||
static void Gui_renderHearts_GuiComponent_blit_armor_injection(Gui *component, int32_t x_dest, int32_t y_dest, int32_t x_src, int32_t y_src, int32_t width_dest, int32_t height_dest, int32_t width_src, int32_t height_src) {
|
||||
Minecraft *minecraft = component->minecraft;
|
||||
x_dest -= DEFAULT_HUD_PADDING + HUD_ELEMENT_WIDTH;
|
||||
float width = ((float) minecraft->screen_width) * *Gui_InvGuiScale;
|
||||
float height = ((float) minecraft->screen_height) * *Gui_InvGuiScale;
|
||||
float width = ((float) minecraft->screen_width) * Gui_InvGuiScale;
|
||||
float height = ((float) minecraft->screen_height) * Gui_InvGuiScale;
|
||||
x_dest += width - ((width - (NUMBER_OF_SLOTS * SLOT_WIDTH)) / 2) - HUD_ELEMENT_WIDTH;
|
||||
y_dest -= DEFAULT_HUD_PADDING;
|
||||
y_dest += height - HUD_ELEMENT_HEIGHT - TOOLBAR_HEIGHT - NEW_HUD_PADDING;
|
||||
@ -54,8 +54,8 @@ static void Gui_renderHearts_GuiComponent_blit_armor_injection(Gui *component, i
|
||||
static void Gui_renderBubbles_GuiComponent_blit_injection(Gui *component, int32_t x_dest, int32_t y_dest, int32_t x_src, int32_t y_src, int32_t width_dest, int32_t height_dest, int32_t width_src, int32_t height_src) {
|
||||
Minecraft *minecraft = component->minecraft;
|
||||
x_dest -= DEFAULT_HUD_PADDING;
|
||||
float width = ((float) minecraft->screen_width) * *Gui_InvGuiScale;
|
||||
float height = ((float) minecraft->screen_height) * *Gui_InvGuiScale;
|
||||
float width = ((float) minecraft->screen_width) * Gui_InvGuiScale;
|
||||
float height = ((float) minecraft->screen_height) * Gui_InvGuiScale;
|
||||
x_dest += (width - (NUMBER_OF_SLOTS * SLOT_WIDTH)) / 2;
|
||||
y_dest -= DEFAULT_HUD_PADDING + DEFAULT_BUBBLES_PADDING + HUD_ELEMENT_HEIGHT;
|
||||
y_dest += height - HUD_ELEMENT_HEIGHT - TOOLBAR_HEIGHT - HUD_ELEMENT_HEIGHT - NEW_HUD_PADDING;
|
||||
@ -87,7 +87,7 @@ static void Gui_renderChatMessages_injection(Gui *gui, int32_t y_offset, uint32_
|
||||
// Calculate Selected Item Text Scale
|
||||
Minecraft *minecraft = gui->minecraft;
|
||||
int32_t screen_width = minecraft->screen_width;
|
||||
float scale = ((float) screen_width) * *Gui_InvGuiScale;
|
||||
float scale = ((float) screen_width) * Gui_InvGuiScale;
|
||||
// Render Selected Item Text
|
||||
(*Gui_renderOnSelectItemNameText)(gui, (int32_t) scale, font, y_offset - 0x13);
|
||||
}
|
||||
@ -275,8 +275,8 @@ static void GameRenderer_render_injection(GameRenderer *game_renderer, float par
|
||||
// Fix GL Mode
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
// Get X And Y
|
||||
float x = (*Mouse_getX)() * (*Gui_InvGuiScale);
|
||||
float y = (*Mouse_getY)() * (*Gui_InvGuiScale);
|
||||
float x = (*Mouse_getX)() * Gui_InvGuiScale;
|
||||
float y = (*Mouse_getY)() * Gui_InvGuiScale;
|
||||
// Render Cursor
|
||||
Minecraft *minecraft = game_renderer->minecraft;
|
||||
(*Common_renderCursor)(x, y, minecraft);
|
||||
@ -418,7 +418,7 @@ static Entity *PathfinderMob_findAttackTarget_injection(PathfinderMob *mob) {
|
||||
|
||||
// 3D Chests
|
||||
static int32_t Tile_getRenderShape_injection(Tile *tile) {
|
||||
if (tile == *Tile_chest) {
|
||||
if (tile == Tile_chest) {
|
||||
// Don't Render "Simple" Chest Model
|
||||
return -1;
|
||||
} else {
|
||||
@ -502,7 +502,7 @@ static void glColor4f_injection(__attribute__((unused)) GLfloat red, __attribute
|
||||
line_width = strtof(custom_line_width, NULL);
|
||||
} else {
|
||||
// Guess
|
||||
line_width = 2 / (*Gui_InvGuiScale);
|
||||
line_width = 2 / Gui_InvGuiScale;
|
||||
}
|
||||
// Clamp Line Width
|
||||
float range[2];
|
||||
|
@ -74,7 +74,7 @@ static void Minecraft_init_injection(Minecraft *minecraft) {
|
||||
// Smooth Lighting
|
||||
static void TileRenderer_tesselateBlockInWorld_injection(TileRenderer *tile_renderer, Tile *tile, int32_t x, int32_t y, int32_t z) {
|
||||
// Set Variable
|
||||
*Minecraft_useAmbientOcclusion = stored_options->ambient_occlusion;
|
||||
Minecraft_useAmbientOcclusion = stored_options->ambient_occlusion;
|
||||
|
||||
// Call Original Method
|
||||
(*TileRenderer_tesselateBlockInWorld)(tile_renderer, tile, x, y, z);
|
||||
@ -98,11 +98,11 @@ void init_options() {
|
||||
// Change Username
|
||||
const char *username = get_username();
|
||||
DEBUG("Setting Username: %s", username);
|
||||
if (strcmp(*Strings_default_username, "StevePi") != 0) {
|
||||
if (strcmp(Strings_default_username, "StevePi") != 0) {
|
||||
ERR("Default Username Is Invalid");
|
||||
}
|
||||
safe_username = to_cp437(username);
|
||||
patch_address((void *) Strings_default_username, (void *) safe_username);
|
||||
patch_address((void *) Strings_default_username_pointer, (void *) safe_username);
|
||||
|
||||
// Disable Autojump By Default
|
||||
if (feature_has("Disable Autojump By Default", server_disabled)) {
|
||||
|
@ -99,9 +99,9 @@ static void OptionsPane_unknown_toggle_creating_function_injection(OptionsPane *
|
||||
std::string name = *name_ptr;
|
||||
std::string new_name = name;
|
||||
if (name == "Fancy Graphics") {
|
||||
option = Options_Option_GRAPHICS;
|
||||
option = &Options_Option_GRAPHICS;
|
||||
} else if (name == "Soft shadows") {
|
||||
option = Options_Option_AMBIENT_OCCLUSION;
|
||||
option = &Options_Option_AMBIENT_OCCLUSION;
|
||||
} else if (name == "Fancy Skies" || name == "Animated water") {
|
||||
// These have no corresponding option, so disable the toggle.
|
||||
return;
|
||||
@ -123,16 +123,16 @@ static void OptionsPane_unknown_toggle_creating_function_injection(OptionsPane *
|
||||
(*OptionsPane_unknown_toggle_creating_function)(options_pane, group_id, &new_name, option);
|
||||
|
||||
// Add 3D Anaglyph
|
||||
if (option == Options_Option_GRAPHICS) {
|
||||
if (option == &Options_Option_GRAPHICS) {
|
||||
std::string cpp_string = "3D Anaglyph";
|
||||
(*OptionsPane_unknown_toggle_creating_function)(options_pane, group_id, &cpp_string, Options_Option_ANAGLYPH);
|
||||
(*OptionsPane_unknown_toggle_creating_function)(options_pane, group_id, &cpp_string, &Options_Option_ANAGLYPH);
|
||||
}
|
||||
}
|
||||
|
||||
// Add Missing Options To Options::getBooleanValue
|
||||
static bool Options_getBooleanValue_injection(Options *options, Options_Option *option) {
|
||||
// Check
|
||||
if (option == Options_Option_GRAPHICS) {
|
||||
if (option == &Options_Option_GRAPHICS) {
|
||||
return options->fancy_graphics;
|
||||
} else {
|
||||
// Call Original Method
|
||||
@ -169,9 +169,9 @@ void _init_options_cpp() {
|
||||
// Actually Save options.txt
|
||||
overwrite_call((void *) 0x197fc, (void *) Options_save_Options_addOptionToSaveOutput_injection);
|
||||
// Fix options.txt Path
|
||||
patch_address((void *) Strings_options_txt_path, (void *) get_new_options_txt_path());
|
||||
patch_address((void *) Strings_options_txt_path_pointer, (void *) get_new_options_txt_path());
|
||||
// When Loading, options.txt Should Be Opened In Read Mode
|
||||
patch_address((void *) Strings_options_txt_fopen_mode_when_loading, (void *) "r");
|
||||
patch_address((void *) Strings_options_txt_fopen_mode_when_loading_pointer, (void *) "r");
|
||||
// Fix OptionsFile::getOptionStrings
|
||||
overwrite_calls((void *) OptionsFile_getOptionStrings, (void *) OptionsFile_getOptionStrings_injection);
|
||||
|
||||
@ -191,8 +191,8 @@ void _init_options_cpp() {
|
||||
{
|
||||
// Replace String
|
||||
static const char *new_feedback_vibration_options_txt_name = "gfx_ao";
|
||||
patch_address((void *) Strings_feedback_vibration_options_txt_name_1, (void *) &new_feedback_vibration_options_txt_name);
|
||||
patch_address((void *) Strings_feedback_vibration_options_txt_name_2, (void *) &new_feedback_vibration_options_txt_name);
|
||||
patch_address((void *) Strings_feedback_vibration_options_txt_name_1_pointer, (void *) &new_feedback_vibration_options_txt_name);
|
||||
patch_address((void *) Strings_feedback_vibration_options_txt_name_2_pointer, (void *) &new_feedback_vibration_options_txt_name);
|
||||
// Loading
|
||||
unsigned char offset = (unsigned char) offsetof(Options, ambient_occlusion);
|
||||
unsigned char gfx_ao_loading_patch[4] = {offset, 0x10, 0x84, 0xe2}; // "add r1, r4, #OFFSET"
|
||||
@ -206,7 +206,7 @@ void _init_options_cpp() {
|
||||
{
|
||||
// Replace String
|
||||
static const char *new_gfx_lowquality_options_txt_name = "gfx_anaglyph";
|
||||
patch_address((void *) Strings_gfx_lowquality_options_txt_name, (void *) &new_gfx_lowquality_options_txt_name);
|
||||
patch_address((void *) Strings_gfx_lowquality_options_txt_name_pointer, (void *) &new_gfx_lowquality_options_txt_name);
|
||||
// Loading
|
||||
unsigned char offset = (unsigned char) offsetof(Options, anaglyph_3d);
|
||||
unsigned char gfx_anaglyph_loading_patch[4] = {offset, 0x10, 0x84, 0xe2}; // "add r1, r4, #OFFSET"
|
||||
|
@ -69,7 +69,7 @@ static int32_t Textures_loadAndBindTexture_injection(Textures *textures, __attri
|
||||
// Change Texture
|
||||
static std::string new_texture;
|
||||
if (new_texture.length() == 0) {
|
||||
std::string username = base64_encode(*Strings_default_username);
|
||||
std::string username = base64_encode(Strings_default_username);
|
||||
new_texture = '$' + username;
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ void init_title_screen() {
|
||||
}
|
||||
|
||||
// Rename "Create" Button To "Quit"
|
||||
patch_address((void *) Strings_classic_create_button_text, (void *) "Quit");
|
||||
patch_address((void *) Strings_classic_create_button_text_pointer, (void *) "Quit");
|
||||
|
||||
// Add Functionality To Quit Button
|
||||
patch_address(StartMenuScreen_buttonClicked_vtable_addr, (void *) StartMenuScreen_buttonClicked_injection);
|
||||
|
@ -18,8 +18,8 @@ static unsigned char *operator_new_IngameBlockSelectionScreen_injection(__attrib
|
||||
// Improved Button Hover Behavior
|
||||
static int32_t Button_hovered_injection(__attribute__((unused)) Button *button, __attribute__((unused)) Minecraft *minecraft, __attribute__((unused)) int32_t click_x, __attribute__((unused)) int32_t click_y) {
|
||||
// Get Mouse Position
|
||||
int32_t x = (*Mouse_getX)() * (*Gui_InvGuiScale);
|
||||
int32_t y = (*Mouse_getY)() * (*Gui_InvGuiScale);
|
||||
int32_t x = (*Mouse_getX)() * Gui_InvGuiScale;
|
||||
int32_t y = (*Mouse_getY)() * Gui_InvGuiScale;
|
||||
|
||||
// Get Button Position
|
||||
int32_t button_x1 = button->x;
|
||||
|
@ -9,7 +9,7 @@ char *version_get() {
|
||||
static char *version = NULL;
|
||||
// Load
|
||||
if (version == NULL) {
|
||||
safe_asprintf(&version, "%s / Reborn v%s", *Strings_minecraft_pi_version, reborn_get_version());
|
||||
safe_asprintf(&version, "%s / Reborn v%s", Strings_minecraft_pi_version, reborn_get_version());
|
||||
}
|
||||
// Return
|
||||
return version;
|
||||
@ -30,7 +30,7 @@ void init_version() {
|
||||
// Touch GUI
|
||||
overwrite((void *) Common_getGameVersionString, (void *) Common_getGameVersionString_injection);
|
||||
// Normal GUI
|
||||
patch_address((void *) Strings_minecraft_pi_version, version_get());
|
||||
patch_address((void *) Strings_minecraft_pi_version_pointer, version_get());
|
||||
|
||||
// Log
|
||||
INFO("Starting Minecraft: Pi Edition (%s)", version_get());
|
||||
|
@ -118,6 +118,16 @@ set(SRC
|
||||
src/Options_Option.def
|
||||
src/LevelStorageSource.def
|
||||
src/SignTileEntity.def
|
||||
src/AgableMob.def
|
||||
src/PrimedTnt.def
|
||||
src/ItemEntity.def
|
||||
src/Arrow.def
|
||||
src/OffsetPosTranslator.def
|
||||
src/EntityFactory.def
|
||||
src/MobFactory.def
|
||||
src/Animal.def
|
||||
src/Sheep.def
|
||||
src/PingedCompatibleServer.def
|
||||
)
|
||||
# Resolve Definition Files
|
||||
set(RESOLVED_SRC "")
|
||||
|
5
symbols/src/AgableMob.def
Normal file
5
symbols/src/AgableMob.def
Normal file
@ -0,0 +1,5 @@
|
||||
extends PathfinderMob;
|
||||
|
||||
method void setAge(int age) = 0x7a058;
|
||||
|
||||
property int age = 0xbfc;
|
1
symbols/src/Animal.def
Normal file
1
symbols/src/Animal.def
Normal file
@ -0,0 +1 @@
|
||||
extends AgableMob;
|
3
symbols/src/Arrow.def
Normal file
3
symbols/src/Arrow.def
Normal file
@ -0,0 +1,3 @@
|
||||
extends Entity;
|
||||
|
||||
property bool is_critical = 0xd8;
|
@ -1,4 +1,6 @@
|
||||
virtual-method bool hurt(Entity *attacker, int damage) = 0xa4;
|
||||
virtual-method int getEntityTypeId() = 0xdc;
|
||||
method void moveTo(float x, float y, float z, float pitch, float yaw) = 0x7a834;
|
||||
|
||||
property float x = 0x4;
|
||||
property float y = 0x8;
|
||||
@ -10,3 +12,4 @@ property float old_y = 0x2c;
|
||||
property float old_z = 0x30;
|
||||
property float old_yaw = 0x48;
|
||||
property float old_pitch = 0x4c;
|
||||
property int id = 0x1c;
|
||||
|
1
symbols/src/EntityFactory.def
Normal file
1
symbols/src/EntityFactory.def
Normal file
@ -0,0 +1 @@
|
||||
static-method Entity *CreateEntity(int id, Level *level) = 0x7d794;
|
@ -18,6 +18,9 @@ property int category = 0x10;
|
||||
property int max_damage = 0x8;
|
||||
property int max_stack_size = 0x14;
|
||||
|
||||
// Globals
|
||||
static-property-array Item *items = 0x17b250;
|
||||
|
||||
// Items
|
||||
static-property Item *flintAndSteel = 0x17ba70;
|
||||
static-property Item *snowball = 0x17bbb0;
|
||||
|
3
symbols/src/ItemEntity.def
Normal file
3
symbols/src/ItemEntity.def
Normal file
@ -0,0 +1,3 @@
|
||||
extends Item;
|
||||
|
||||
property ItemInstance item = 0xd0;
|
@ -6,5 +6,8 @@ method void saveLevelData() = 0xa2e94;
|
||||
method void setTileAndData(int x, int y, int z, int id, int data) = 0xa38b4;
|
||||
method HitResult clip(uchar *param_1, uchar *param_2, bool clip_liquids, bool param_3) = 0xa3db0;
|
||||
method void addParticle(std::string *particle, float x, float y, float z, float deltaX, float deltaY, float deltaZ, int count) = 0xa449c;
|
||||
method Entity *getEntity(int id) = 0xa45a4;
|
||||
method bool addEntity(Entity *entity) = 0xa7cbc;
|
||||
|
||||
property std::vector<Player*> players = 0x60;
|
||||
property std::vector<Entity*> entities = 0x20;
|
||||
|
@ -19,6 +19,7 @@ method uchar *getCreator() = 0x17538;
|
||||
method LevelStorageSource *getLevelSource() = 0x16e84;
|
||||
method void handleMouseDown(int param_1, bool can_destroy) = 0x1584c;
|
||||
virtual-method void selectLevel(std::string *level_dir, std::string *level_name, LevelSettings *settings) = 0x40;
|
||||
method void joinMultiplayer(PingedCompatibleServer *server) = 0x165f4;
|
||||
|
||||
property int screen_width = 0x20;
|
||||
property int screen_height = 0x24;
|
||||
|
2
symbols/src/MobFactory.def
Normal file
2
symbols/src/MobFactory.def
Normal file
@ -0,0 +1,2 @@
|
||||
static-method Mob *getStaticTestMob(int id, Level *level) = 0x18844;
|
||||
static-method Mob *CreateMob(int id, Level *level) = 0x18184;
|
1
symbols/src/OffsetPosTranslator.def
Normal file
1
symbols/src/OffsetPosTranslator.def
Normal file
@ -0,0 +1 @@
|
||||
method void from(int *x, int *y, int *z) = 0x27c98;
|
0
symbols/src/PingedCompatibleServer.def
Normal file
0
symbols/src/PingedCompatibleServer.def
Normal file
@ -6,6 +6,7 @@ method int isUsingItem() = 0x8f15c;
|
||||
virtual-method void drop(ItemInstance *item_instance, bool is_death) = 0x208;
|
||||
virtual-method void stopSleepInBed(bool param_1, bool param_2, bool param_3) = 0x228;
|
||||
virtual-method void openTextEdit(TileEntity *sign) = 0x230;
|
||||
method ItemInstance *getArmor(int slot) = 0x8fda4;
|
||||
|
||||
property std::string username = 0xbf4;
|
||||
property Inventory *inventory = 0xbe0;
|
||||
|
3
symbols/src/PrimedTnt.def
Normal file
3
symbols/src/PrimedTnt.def
Normal file
@ -0,0 +1,3 @@
|
||||
extends Entity;
|
||||
|
||||
property int fuse = 0xd0;
|
3
symbols/src/Sheep.def
Normal file
3
symbols/src/Sheep.def
Normal file
@ -0,0 +1,3 @@
|
||||
extends Animal;
|
||||
|
||||
method void setColor(int color) = 0x86274;
|
@ -19,7 +19,7 @@ property int id = 0x8;
|
||||
property int category = 0x3c;
|
||||
|
||||
// Globals
|
||||
static-property Tile *tiles = 0x180e08;
|
||||
static-property-array Tile *tiles = 0x180e08;
|
||||
|
||||
// Tiles
|
||||
static-property Tile *chest = 0x181d60;
|
||||
|
@ -1,3 +1,5 @@
|
||||
property int id = 0x18;
|
||||
property int renderer_id = 0x24;
|
||||
property bool is_client = 0x20;
|
||||
property int tile = 0xd0;
|
||||
property int lifetime = 0xd8;
|
||||
|
Loading…
Reference in New Issue
Block a user