Port To v0.1.0

This commit is contained in:
TheBrokenRail 2021-11-30 21:25:04 -05:00
parent 33c7d025a5
commit 3259299058
32 changed files with 294 additions and 456 deletions

View File

@ -7,7 +7,7 @@ include(FetchContent)
# Download
FetchContent_Declare(
minecraft-pi
URL "${CMAKE_CURRENT_SOURCE_DIR}/minecraft-pi-0.1.1.tar.gz"
URL "${CMAKE_CURRENT_SOURCE_DIR}/minecraft-pi-0.1.0.tar.gz"
)
FetchContent_Populate(minecraft-pi)

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -1,11 +1,9 @@
TRUE Touch GUI
TRUE Fix Bow & Arrow
TRUE Fix Attacking
FALSE Force Mob Spawning
TRUE Fancy Graphics
TRUE Disable Autojump By Default
TRUE Display Nametags By Default
TRUE Fix Sign Placement
TRUE Show Block Outlines
FALSE Expand Creative Inventory
FALSE Remove Creative Mode Restrictions

View File

@ -25,7 +25,7 @@ if(MCPI_SERVER_MODE)
add_library(server SHARED src/server/server.cpp src/server/server_properties.cpp)
target_link_libraries(server reborn symbols feature home misc compat dl media-layer-core pthread)
else()
target_link_libraries(compat input sign chat home dl)
target_link_libraries(compat input chat home dl)
target_link_libraries(chat input)
@ -38,12 +38,9 @@ else()
add_library(camera SHARED src/camera/camera.cpp)
target_link_libraries(camera reborn symbols media-layer-core feature home)
add_library(input SHARED src/input/input.cpp src/input/bow.c src/input/attack.c src/input/toggle.c src/input/misc.c src/input/drop.cpp)
add_library(input SHARED src/input/input.cpp src/input/attack.c src/input/toggle.c src/input/misc.c src/input/drop.cpp)
target_link_libraries(input reborn symbols creative feature media-layer-core)
add_library(sign SHARED src/sign/sign.cpp)
target_link_libraries(sign reborn symbols feature input)
add_library(creative SHARED src/creative/creative.cpp)
target_link_libraries(creative reborn symbols feature)
@ -88,7 +85,7 @@ target_link_libraries(init compat game-mode misc death options chat home version
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 creative touch textures atlas)
if(NOT MCPI_HEADLESS_MODE)
target_link_libraries(init benchmark)
endif()
@ -99,7 +96,7 @@ install(TARGETS init compat readdir feature game-mode misc death options chat ho
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 creative touch textures atlas DESTINATION "${MCPI_INSTALL_DIR}/mods")
if(NOT MCPI_HEADLESS_MODE)
install(TARGETS benchmark DESTINATION "${MCPI_INSTALL_DIR}/mods")
endif()

View File

@ -57,9 +57,9 @@ static void Tesselator_colorABGR_injection(unsigned char *tesselator, int32_t co
// Call Original Method
(*Tesselator_colorABGR)(tesselator, color);
}
static void Tesselator_begin_injection(unsigned char *tesselator, int32_t mode) {
static void Tesselator_begin_injection(unsigned char *tesselator) {
// Call Original Method
(*Tesselator_begin)(tesselator, mode);
(*Tesselator_begin)(tesselator);
// Fix Furnace UI
if (use_furnace_fix) {
@ -95,14 +95,14 @@ static float FurnaceScreen_render_ItemRenderer_renderGuiItem_injection(unsigned
void init_atlas() {
// Disable The gui_blocks Atlas Which Contains Pre-Rendered Textures For Blocks In The Inventory
if (feature_has("Disable \"gui_blocks\" Atlas", 0)) {
unsigned char disable_gui_blocks_atlas_patch[4] = {0x00, 0xf0, 0x20, 0xe3}; // "nop"
patch((void *) 0x63c2c, disable_gui_blocks_atlas_patch);
unsigned char disable_gui_blocks_atlas_patch[4] = {0x45, 0x00, 0x00, 0xea}; // "b 0x7f740"
patch((void *) 0x7f624, disable_gui_blocks_atlas_patch);
// Fix Grass And Leaves Inventory Rendering When The gui_blocks Atlas Is Disabled
overwrite_calls((void *) ItemRenderer_renderGuiItemCorrect, (void *) ItemRenderer_renderGuiItemCorrect_injection);
// Fix Furnace UI
overwrite_calls((void *) Tesselator_colorABGR, (void *) Tesselator_colorABGR_injection);
overwrite_calls((void *) Tesselator_begin, (void *) Tesselator_begin_injection);
overwrite_calls((void *) Tesselator_color, (void *) Tesselator_color_injection);
overwrite_call((void *) 0x32324, (void *) FurnaceScreen_render_ItemRenderer_renderGuiItem_injection);
overwrite_call((void *) 0x3bff4, (void *) FurnaceScreen_render_ItemRenderer_renderGuiItem_injection);
}
}

View File

@ -41,6 +41,6 @@ void init_camera() {
// Enable TripodCameraRenderer
overwrite_calls((void *) EntityRenderDispatcher, (void *) EntityRenderDispatcher_injection);
// Display Smoke From TripodCamera Higher
overwrite_call((void *) 0x87dc4, (void *) TripodCamera_tick_Level_addParticle_call_injection);
overwrite_call((void *) 0xbcf18, (void *) TripodCamera_tick_Level_addParticle_call_injection);
}
}

View File

@ -72,7 +72,8 @@ static void CommandServer_parse_CommandServer_dispatchPacket_injection(unsigned
// Handle ChatPacket Server-Side
static void ServerSideNetworkHandler_handle_ChatPacket_injection(unsigned char *server_side_network_handler, RakNet_RakNetGUID *rak_net_guid, unsigned char *chat_packet) {
unsigned char *player = (*ServerSideNetworkHandler_getPlayer)(server_side_network_handler, rak_net_guid);
unsigned char *level = *(unsigned char **) (server_side_network_handler + ServerSideNetworkHandler_level_property_offset);
unsigned char *player = (*NetEventCallback_findPlayer)(server_side_network_handler, level, rak_net_guid);
if (player != NULL) {
char *username = *(char **) (player + Player_username_property_offset);
char *message = *(char **) (chat_packet + ChatPacket_message_property_offset);
@ -123,9 +124,9 @@ void init_chat() {
if (_chat_enabled) {
// Disable Original ChatPacket Loopback
unsigned char disable_chat_packet_loopback_patch[4] = {0x00, 0xf0, 0x20, 0xe3}; // "nop"
patch((void *) 0x6b490, disable_chat_packet_loopback_patch);
patch((void *) 0x8c118, disable_chat_packet_loopback_patch);
// Manually Send (And Loopback) ChatPacket
overwrite_call((void *) 0x6b518, (void *) CommandServer_parse_CommandServer_dispatchPacket_injection);
overwrite_call((void *) 0x8c1a4, (void *) CommandServer_parse_CommandServer_dispatchPacket_injection);
// Re-Broadcast ChatPacket
patch_address(ServerSideNetworkHandler_handle_ChatPacket_vtable_addr, (void *) ServerSideNetworkHandler_handle_ChatPacket_injection);
// Send Messages On Input Tick

View File

@ -11,7 +11,6 @@
#include <libreborn/libreborn.h>
#include "../input/input.h"
#include "../sign/sign.h"
#include "../chat/chat.h"
#include "../home/home.h"
@ -82,20 +81,12 @@ HOOK(SDL_PollEvent, int, (SDL_Event *event)) {
}
case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP: {
// Track Right-Click State
if (event->button.button == SDL_BUTTON_RIGHT) {
input_set_is_right_click(event->button.state != SDL_RELEASED);
} else if (event->button.button == SDL_BUTTON_LEFT) {
// Track Left-Click State
if (event->button.button == SDL_BUTTON_LEFT) {
input_set_is_left_click(event->button.state != SDL_RELEASED);
}
break;
}
case SDL_USEREVENT: {
// SDL_UserEvent Is Never Used In MCPI, So It Is Repurposed For Character Events
sign_key_press((char) event->user.code);
handled = 1;
break;
}
}
if (handled) {

View File

@ -23,17 +23,17 @@ static EGLBoolean eglSwapBuffers_injection(__attribute__((unused)) EGLDisplay di
__attribute__((constructor)) static void patch_egl_calls() {
// Disable EGL Calls
unsigned char nop_patch[4] = {0x00, 0xf0, 0x20, 0xe3}; // "nop"
patch((void *) 0x1250c, nop_patch); // eglTerminate
patch((void *) 0x12580, nop_patch); // eglBindAPI
overwrite_call((void *) 0x12638, (void *) eglCreateWindowSurface_injection); // eglCreateWindowSurface
patch((void *) 0x12578, nop_patch); // eglChooseConfig
patch((void *) 0x1255c, nop_patch); // eglInitialize
patch((void *) 0x124f0, nop_patch); // eglMakeCurrent #1
patch((void *) 0x12654, nop_patch); // eglMakeCurrent #2
overwrite_call((void *) 0x124dc, (void *) eglSwapBuffers_injection); // eglSwapBuffers #1
overwrite_call((void *) 0x14b6c, (void *) eglSwapBuffers_injection); // eglSwapBuffers #2
overwrite_call((void *) 0x1254c, (void *) eglGetDisplay_injection); // eglGetDisplay
patch((void *) 0x124fc, nop_patch); // eglDestroySurface #1
patch((void *) 0x12504, nop_patch); // eglDestroySurface #2
overwrite_call((void *) 0x12594, (void *) eglCreateContext_injection); // eglCreateContext
patch((void *) 0x11d3c, nop_patch); // eglTerminate
patch((void *) 0x11dbc, nop_patch); // eglBindAPI
overwrite_call((void *) 0x11e78, (void *) eglCreateWindowSurface_injection); // eglCreateWindowSurface
patch((void *) 0x11db4, nop_patch); // eglChooseConfig
patch((void *) 0x11d98, nop_patch); // eglInitialize
patch((void *) 0x11d20, nop_patch); // eglMakeCurrent #1
patch((void *) 0x11e90, nop_patch); // eglMakeCurrent #2
overwrite_call((void *) 0x11d0c, (void *) eglSwapBuffers_injection); // eglSwapBuffers #1
overwrite_call((void *) 0x14ce4, (void *) eglSwapBuffers_injection); // eglSwapBuffers #2
overwrite_call((void *) 0x11d7c, (void *) eglGetDisplay_injection); // eglGetDisplay
patch((void *) 0x11d2c, nop_patch); // eglDestroySurface #1
patch((void *) 0x11d34, nop_patch); // eglDestroySurface #2
overwrite_call((void *) 0x11dd0, (void *) eglCreateContext_injection); // eglCreateContext
}

View File

@ -23,6 +23,6 @@ static int XGetWindowAttributes_injection(__attribute__((unused)) void *display,
// Patch X11 Calls
__attribute__((constructor)) static void patch_x11_calls() {
// Disable X11 Calls
overwrite_call((void *) 0x132a4, (void *) XGetWindowAttributes_injection); // XGetWindowAttributes
overwrite_call((void *) 0x132d4, (void *) XTranslateCoordinates_injection); // XTranslateCoordinates
overwrite_call((void *) 0x12f2c, (void *) XGetWindowAttributes_injection); // XGetWindowAttributes
overwrite_call((void *) 0x12f64, (void *) XTranslateCoordinates_injection); // XTranslateCoordinates
}

View File

@ -38,7 +38,6 @@ static int32_t Inventory_setupDefault_FillingContainer_addItem_call_injection(un
// Add Tiles
inventory_add_item(filling_container, *Tile_water, true);
inventory_add_item(filling_container, *Tile_lava, true);
inventory_add_item(filling_container, *Tile_calmWater, true);
inventory_add_item(filling_container, *Tile_calmLava, true);
inventory_add_item(filling_container, *Tile_glowingObsidian, true);
inventory_add_item(filling_container, *Tile_web, true);
@ -62,39 +61,39 @@ int creative_is_restricted() {
void init_creative() {
// Add Extra Items To Creative Inventory (Only Replace Specific Function Call)
if (feature_has("Expand Creative Inventory", 0)) {
overwrite_call((void *) 0x8e0fc, (void *) Inventory_setupDefault_FillingContainer_addItem_call_injection);
overwrite_call((void *) 0xcdcf4, (void *) Inventory_setupDefault_FillingContainer_addItem_call_injection);
}
// Remove Creative Restrictions (Opening Chests, Crafting, Etc)
if (feature_has("Remove Creative Mode Restrictions", 0)) {
unsigned char nop_patch[4] = {0x00, 0xf0, 0x20, 0xe3}; // "nop"
// Remove Restrictions
patch((void *) 0x43ee8, nop_patch);
patch((void *) 0x43f3c, nop_patch);
patch((void *) 0x43f8c, nop_patch);
patch((void *) 0x43fd8, nop_patch);
patch((void *) 0x99010, nop_patch);
patch((void *) 0x59e68, nop_patch);
patch((void *) 0x59ebc, nop_patch);
patch((void *) 0x59f10, nop_patch);
unsigned char allow_eating_patch[4] = {0x02, 0x00, 0x00, 0xea}; // "b 0xddcbc"
patch((void *) 0xddcac, allow_eating_patch);
// Fix UI
patch((void *) 0x341c0, nop_patch);
patch((void *) 0x3adb4, nop_patch);
patch((void *) 0x3b374, nop_patch);
patch((void *) 0x4cb88, nop_patch);
unsigned char fix_ui_patch[4] = {0x05, 0x00, 0x55, 0xe1}; // "cmp r5, r5"
patch((void *) 0x4bf20, fix_ui_patch);
// Fix Inventory
patch((void *) 0xcce90, nop_patch);
patch((void *) 0xd5548, nop_patch);
unsigned char inv_creative_check_r3_patch[4] = {0x03, 0x00, 0x53, 0xe1}; // "cmp r3, r3"
patch((void *) 0xd497c, inv_creative_check_r3_patch);
unsigned char inv_creative_check_r5_patch[4] = {0x05, 0x00, 0x55, 0xe1}; // "cmp r5, r5"
patch((void *) 0xd4d94, inv_creative_check_r5_patch);
patch((void *) 0xd50ac, nop_patch);
patch((void *) 0x8d080, nop_patch);
patch((void *) 0x8d090, nop_patch);
patch((void *) 0x91d48, nop_patch);
patch((void *) 0x92098, nop_patch);
unsigned char inv_creative_check_r3_patch[4] = {0x03, 0x00, 0x53, 0xe1}; // "cmp r3, r3"
patch((void *) 0x923c0, inv_creative_check_r3_patch);
patch((void *) 0x92828, nop_patch);
patch((void *) 0x92830, nop_patch);
// Display Slot Count
patch((void *) 0x1e3f4, nop_patch);
unsigned char slot_count_patch[4] = {0x18, 0x00, 0x00, 0xea}; // "b 0x27110"
patch((void *) 0x270a8, slot_count_patch);
patch((void *) 0x33954, nop_patch);
patch((void *) 0x23d4c, nop_patch);
patch((void *) 0x2c570, nop_patch);
patch((void *) 0x3eec0, nop_patch);
// Maximize Creative Inventory Stack Size
unsigned char maximize_stack_patch[4] = {0xff, 0xc0, 0xa0, 0xe3}; // "mov r12, 0xff"
patch((void *) 0x8e104, maximize_stack_patch);
unsigned char maximize_stack_patch[4] = {0xff, 0x60, 0xa0, 0xe3}; // "mov r6, 0xff"
patch((void *) 0xccf80, maximize_stack_patch);
// Disable Other Restrictions
is_restricted = 0;
}

View File

@ -14,14 +14,14 @@ static void set_is_survival(int new_is_survival) {
// Correct Inventpry UI
unsigned char inventory_patch[4] = {new_is_survival ? 0x00 : 0x01, 0x30, 0xa0, 0xe3}; // "mov r3, #0x0" or "mov r3, #0x1"
patch((void *) 0x16efc, inventory_patch);
patch((void *) 0x178c0, inventory_patch);
// Use Correct Size For GameMode Object
unsigned char size_patch[4] = {new_is_survival ? SURVIVAL_MODE_SIZE : CREATOR_MODE_SIZE, 0x00, 0xa0, 0xe3}; // "mov r0, #SURVIVAL_MODE_SIZE" or "mov r0, #CREATOR_MODE_SIZE"
patch((void *) 0x16ee4, size_patch);
patch((void *) 0x178a8, size_patch);
// Replace Default CreatorMode Constructor With CreatorMode Or SurvivalMode Constructor
overwrite_call((void *) 0x16ef4, new_is_survival ? SurvivalMode : CreatorMode);
overwrite_call((void *) 0x178b8, new_is_survival ? SurvivalMode : CreatorMode);
is_survival = new_is_survival;
}
@ -54,11 +54,11 @@ void init_game_mode() {
overwrite_calls((void *) Minecraft_setIsCreativeMode, (void *) Minecraft_setIsCreativeMode_injection);
// Replace CreatorLevel With ServerLevel (This Fixes Beds And Mob Spawning)
overwrite_call((void *) 0x16f84, (void *) ServerLevel);
overwrite_call((void *) 0x17950, (void *) ServerLevel);
// Allocate Correct Size For ServerLevel
uint32_t level_size = SERVER_LEVEL_SIZE;
patch_address((void *) 0x17004, (void *) level_size);
patch_address((void *) 0x17a38, (void *) level_size);
// Disable CreatorMode-Specific API Features (Polling Block Hits) In SurvivalMode, This Is Preferable To Crashing
overwrite_calls((void *) Minecraft_getCreator, (void *) Minecraft_getCreator_injection);
@ -69,7 +69,7 @@ void init_game_mode() {
// Allow Joining Survival Servers
if (feature_has("Allow Joining Survival Servers", 1)) {
unsigned char server_patch[4] = {0x0f, 0x00, 0x00, 0xea}; // "b 0x6dcb4"
patch((void *) 0x6dc70, server_patch);
unsigned char server_patch[4] = {0x16, 0x00, 0x00, 0xea}; // "b 0x8e998"
patch((void *) 0x8e938, server_patch);
}
}

View File

@ -9,17 +9,19 @@ static unsigned char *get_minecraft_from_screen(unsigned char *screen) {
return *(unsigned char **) (screen + Screen_minecraft_property_offset);
}
// Redirect Create World Button To SimpleLevelChooseScreen
// Redirect Create World Button To DemoLevelChooseScreen
#define WORLD_NAME "world"
static void SelectWorldScreen_tick_injection(unsigned char *screen) {
bool create_world = *(bool *) (screen + SelectWorldScreen_should_create_world_property_offset);
if (create_world) {
// Get New World Name
free(*demo_level_name);
std::string new_name = (*SelectWorldScreen_getUniqueLevelName)(screen, WORLD_NAME);
// Create SimpleLevelChooseScreen
unsigned char *new_screen = (unsigned char *) ::operator new(SIMPLE_LEVEL_CHOOSE_SCREEN_SIZE);
patch_address((void *) demo_level_name, (void *) strdup(new_name.c_str()));
// Create DemoLevelChooseScreen
unsigned char *new_screen = (unsigned char *) ::operator new(DEMO_LEVEL_CHOOSE_SCREEN_SIZE);
ALLOC_CHECK(new_screen);
(*SimpleChooseLevelScreen)(new_screen, new_name);
(*DemoChooseLevelScreen)(new_screen);
// Set Screen
unsigned char *minecraft = get_minecraft_from_screen(screen);
(*Minecraft_setScreen)(minecraft, new_screen);
@ -33,11 +35,13 @@ static void Touch_SelectWorldScreen_tick_injection(unsigned char *screen) {
bool create_world = *(bool *) (screen + Touch_SelectWorldScreen_should_create_world_property_offset);
if (create_world) {
// Get New World Name
free(*demo_level_name);
std::string new_name = (*Touch_SelectWorldScreen_getUniqueLevelName)(screen, WORLD_NAME);
// Create SimpleLevelChooseScreen
unsigned char *new_screen = (unsigned char *) ::operator new(SIMPLE_LEVEL_CHOOSE_SCREEN_SIZE);
patch_address((void *) demo_level_name, (void *) strdup(new_name.c_str()));
// Create DemoLevelChooseScreen
unsigned char *new_screen = (unsigned char *) ::operator new(DEMO_LEVEL_CHOOSE_SCREEN_SIZE);
ALLOC_CHECK(new_screen);
(*SimpleChooseLevelScreen)(new_screen, new_name);
(*DemoChooseLevelScreen)(new_screen);
// Set Screen
unsigned char *minecraft = get_minecraft_from_screen(screen);
(*Minecraft_setScreen)(minecraft, new_screen);
@ -52,8 +56,16 @@ void _init_game_mode_cpp() {
// Hijack Create World Button
patch_address(SelectWorldScreen_tick_vtable_addr, (void *) SelectWorldScreen_tick_injection);
patch_address(Touch_SelectWorldScreen_tick_vtable_addr, (void *) Touch_SelectWorldScreen_tick_injection);
// Make The SimpleChooseLevelScreen Back Button Go To SelectWorldScreen Instead Of StartMenuScreen
unsigned char simple_choose_level_screen_back_button_patch[4] = {0x05, 0x10, 0xa0, 0xe3}; // "mov r1, #0x5"
patch((void *) 0x31144, simple_choose_level_screen_back_button_patch);
patch((void *) 0x3134c, simple_choose_level_screen_back_button_patch);
// Make The DemoChooseLevelScreen Back Button Go To SelectWorldScreen Instead Of StartMenuScreen
unsigned char demo_choose_level_screen_back_button_patch[4] = {0x05, 0x10, 0xa0, 0xe3}; // "mov r1, #0x5"
patch((void *) 0x3a298, demo_choose_level_screen_back_button_patch);
patch((void *) 0x39fa0, demo_choose_level_screen_back_button_patch);
}
// Reset Level Name
__attribute__((constructor)) static void _reset_level_name() {
patch_address((void *) demo_level_name, NULL);
}
// Free Level Name
__attribute__((destructor)) static void _free_level_name() {
free(*demo_level_name);
}

View File

@ -53,11 +53,9 @@ __attribute__((destructor)) static void _free_home() {
// Init
void init_home() {
// Store Data In ~/.minecraft-pi Instead Of ~/.minecraft
patch_address((void *) default_path, (void *) NEW_PATH);
patch_address((void *) full_data_path, (void *) home_get());
// Change Directory To Binary Directory Manually
unsigned char nop_patch[4] = {0x00, 0xf0, 0x20, 0xe3}; // "nop"
patch((void *) 0xe0ac, nop_patch);
// Change Directory To Binary Directory
char *binary_directory = get_binary_directory();
chdir(binary_directory);
free(binary_directory);

View File

@ -13,7 +13,6 @@ __attribute__((constructor)) static void init() {
init_multiplayer();
init_sound();
init_input();
init_sign();
init_creative();
init_camera();
init_touch();

View File

@ -13,7 +13,6 @@ void init_server();
void init_multiplayer();
void init_sound();
void init_input();
void init_sign();
void init_creative();
void init_camera();
void init_touch();

View File

@ -1,36 +0,0 @@
#include <libreborn/libreborn.h>
#include <symbols/minecraft.h>
#include "../feature/feature.h"
#include "input.h"
// Store Right-Click Status
static int is_right_click = 0;
void input_set_is_right_click(int val) {
is_right_click = val;
}
// Enable Bow & Arrow Fix
static int fix_bow = 0;
// Handle Bow & Arrow
static void _handle_bow(unsigned char *minecraft) {
if (fix_bow && !is_right_click) {
// GameMode Is Offset From minecraft By 0x160
// Player Is Offset From minecraft By 0x18c
unsigned char *game_mode = *(unsigned char **) (minecraft + Minecraft_game_mode_property_offset);
unsigned char *player = *(unsigned char **) (minecraft + Minecraft_player_property_offset);
if (player != NULL && game_mode != NULL && (*Player_isUsingItem)(player)) {
unsigned char *game_mode_vtable = *(unsigned char **) game_mode;
GameMode_releaseUsingItem_t GameMode_releaseUsingItem = *(GameMode_releaseUsingItem_t *) (game_mode_vtable + GameMode_releaseUsingItem_vtable_offset);
(*GameMode_releaseUsingItem)(game_mode, player);
}
}
}
// Init
void _init_bow() {
// Enable Bow & Arrow Fix
fix_bow = feature_has("Fix Bow & Arrow", 0);
input_run_on_tick(_handle_bow);
}

View File

@ -38,9 +38,6 @@ void init_input() {
// Item Dropping
_init_drop();
// Enable Bow & Arrow Fix
_init_bow();
// Loop
overwrite_calls((void *) Minecraft_tickInput, (void *) Minecraft_tickInput_injection);

View File

@ -7,7 +7,6 @@ extern "C" {
typedef void (*input_tick_function_t)(unsigned char *minecraft);
void input_run_on_tick(input_tick_function_t function);
void input_set_is_right_click(int val);
void input_hide_gui();
void input_third_person();
int input_back();
@ -18,7 +17,6 @@ void input_set_is_left_click(int val);
void input_set_mouse_grab_state(int state);
__attribute__((visibility("internal"))) void _init_attack();
__attribute__((visibility("internal"))) void _init_bow();
__attribute__((visibility("internal"))) void _init_misc();
__attribute__((visibility("internal"))) void _init_toggle();
__attribute__((visibility("internal"))) void _init_drop();

View File

@ -87,7 +87,7 @@ void _init_misc() {
overwrite_calls((void *) Gui_handleClick, (void *) Gui_handleClick_injection);
}
// Disable Item Dropping Using The Cursor When Cursor Is Hidden
overwrite_call((void *) 0x27800, (void *) Gui_tickItemDrop_Minecraft_isCreativeMode_call_injection);
overwrite_call((void *) 0x2b130, (void *) Gui_tickItemDrop_Minecraft_isCreativeMode_call_injection);
input_run_on_tick(_handle_back);
input_run_on_tick(_handle_mouse_grab);

View File

@ -135,12 +135,17 @@ static unsigned char *RakNetInstance_injection(unsigned char *rak_net_instance)
return result;
}
// Stop Checking GL Renderer
static bool AppPlatform_isPowerVR_injection(__attribute__((unused)) unsigned char *app_platform) {
return 0;
}
// Init
void init_misc() {
if (feature_has("Remove Invalid Item Background", 0)) {
// Remove Invalid Item Background (A Red Background That Appears For Items That Are Not Included In The gui_blocks Atlas)
unsigned char invalid_item_background_patch[4] = {0x00, 0xf0, 0x20, 0xe3}; // "nop"
patch((void *) 0x63c98, invalid_item_background_patch);
patch((void *) 0x7f7e8, invalid_item_background_patch);
}
// Render Selected Item Text + Hide Chat Messages
@ -157,11 +162,14 @@ void init_misc() {
overwrite_calls((void *) RakNet_RakString, (void *) RakNet_RakString_injection);
// Print Error Message If RakNet Startup Fails
overwrite_call((void *) 0x73778, (void *) RakNetInstance_host_RakNet_RakPeer_Startup_injection);
overwrite_call((void *) 0x98014, (void *) RakNetInstance_host_RakNet_RakPeer_Startup_injection);
// Fix Bug Where RakNetInstance Starts Pinging Potential Servers Before The "Join Game" Screen Is Opened
overwrite_calls((void *) RakNetInstance, (void *) RakNetInstance_injection);
// Stop Checking GL Renderer
overwrite((void *) AppPlatform_isPowerVR, (void *) AppPlatform_isPowerVR_injection);
// Init C++ And Logging
_init_misc_cpp();
_init_misc_logging();

View File

@ -99,24 +99,26 @@ void init_options() {
ERR("%s", "Default Username Is Invalid");
}
patch_address((void *) default_username, (void *) username);
unsigned char username_length_patch[4] = {(unsigned char) strlen(username), 0x20, 0xa0, 0xe3}; // "mov r2, #USERNAME_LENGTH"
patch((void *) 0x1ba2c, username_length_patch);
// Disable Autojump By Default
if (feature_has("Disable Autojump By Default", 0)) {
unsigned char autojump_patch[4] = {0x00, 0x30, 0xa0, 0xe3}; // "mov r3, #0x0"
patch((void *) 0x44b90, autojump_patch);
unsigned char autojump_patch[4] = {0x00, 0x00, 0xa0, 0xe3}; // "mov r0, #0x0"
patch((void *) 0x5b148, autojump_patch);
}
// Display Nametags By Default
if (feature_has("Display Nametags By Default", 0)) {
// r6 = 0x1
// r5 = 0x0
unsigned char display_nametags_patch[4] = {0x1d, 0x60, 0xc0, 0xe5}; // "strb r6, [r0, #0x1d]"
patch((void *) 0xa6628, display_nametags_patch);
// r12 = 0x0
unsigned char display_nametags_patch[4] = {0x1d, 0x60, 0xc4, 0xe5}; // "strb r6, [r4, #0x1d]"
patch((void *) 0xf2d44, display_nametags_patch);
}
// Enable Smooth Lighting
smooth_lighting = feature_has("Smooth Lighting", 0);
if (smooth_lighting) {
unsigned char smooth_lighting_patch[4] = {0x01, 0x00, 0x53, 0xe3}; // "cmp r3, #0x1"
patch((void *) 0x59ea4, smooth_lighting_patch);
patch((void *) 0x73b74, smooth_lighting_patch);
}
}

View File

@ -87,6 +87,7 @@ static void start_world(unsigned char *minecraft) {
// Open Port
int port = get_server_properties().get_int("port", DEFAULT_PORT);
INFO("Listening On: %i", port);
patch_address((void *) 0x16cd8, (void *) port);
(*Minecraft_hostMultiplayer)(minecraft, port);
}
@ -262,6 +263,15 @@ __attribute__((destructor)) static void _free_stdin_buffer() {
stdin_buffer = NULL;
}
}
// Prevent STDIN From Being Closed
HOOK(close, int, (int fd)) {
if (fd != fileno(stdin)) {
ensure_close();
return (*real_close)(fd);
} else {
return 0;
}
}
// Handle Commands
static void handle_commands(unsigned char *minecraft) {
@ -498,23 +508,23 @@ static void server_init() {
// Prevent Main Player From Loading
unsigned char player_patch[4] = {0x00, 0x20, 0xa0, 0xe3}; // "mov r2, #0x0"
patch((void *) 0x1685c, player_patch);
patch((void *) 0x16ef8, player_patch);
// Start World On Launch
misc_run_on_update(Minecraft_update_injection);
// Set Max Players
unsigned char max_players_patch[4] = {get_max_players(), 0x30, 0xa0, 0xe3}; // "mov r3, #MAX_PLAYERS"
patch((void *) 0x166d0, max_players_patch);
patch((void *) 0x16cc0, max_players_patch);
// Custom Banned IP List
overwrite((void *) RakNet_RakPeer_IsBanned, (void *) RakNet_RakPeer_IsBanned_injection);
// Show The MineCon Icon Next To MOTD In Server List
if (get_server_properties().get_bool("show-minecon-badge", DEFAULT_SHOW_MINECON_BADGE)) {
unsigned char minecon_badge_patch[4] = {0x04, 0x1a, 0x9f, 0xe5}; // "ldr r1, [0x741f0]"
patch((void *) 0x737e4, minecon_badge_patch);
unsigned char minecon_badge_patch[4] = {0x5c, 0x1a, 0x9f, 0xe5}; // "ldr r1, [0x98af0]"
patch((void *) 0x9808c, minecon_badge_patch);
}
// Log IPs
overwrite_call((void *) 0x75e54, (void *) ServerSideNetworkHandler_onReady_ClientGeneration_ServerSideNetworkHandler_popPendingPlayer_injection);
overwrite_call((void *) 0x9a63c, (void *) ServerSideNetworkHandler_onReady_ClientGeneration_ServerSideNetworkHandler_popPendingPlayer_injection);
// Start Reading STDIN
pthread_t read_stdin_thread_obj;

View File

@ -1,2 +0,0 @@
# ``sign`` Mod
This mod fixes sign placement.

View File

@ -1,68 +0,0 @@
#include <vector>
#include <libreborn/libreborn.h>
#include <symbols/minecraft.h>
#include "../init/init.h"
#include "../feature/feature.h"
#include "../input/input.h"
#include "sign.h"
// Open Sign Screen
static void LocalPlayer_openTextEdit_injection(unsigned char *local_player, unsigned char *sign) {
if (*(int32_t *) (sign + TileEntity_id_property_offset) == 4) {
unsigned char *minecraft = *(unsigned char **) (local_player + LocalPlayer_minecraft_property_offset);
unsigned char *screen = (unsigned char *) ::operator new(TEXT_EDIT_SCREEN_SIZE);
ALLOC_CHECK(screen);
screen = (*TextEditScreen)(screen, sign);
(*Minecraft_setScreen)(minecraft, screen);
}
}
#define BACKSPACE_KEY 8
static int is_valid_key(char key) {
return (key >= 32 && key <= 126) || key == BACKSPACE_KEY;
}
// Store Text Input
std::vector<char> input;
void sign_key_press(char key) {
if (is_valid_key(key)) {
input.push_back(key);
}
}
static void clear_input(__attribute__((unused)) unsigned char *minecraft) {
input.clear();
}
// Handle Text Input
static void TextEditScreen_updateEvents_injection(unsigned char *screen) {
// Call Original Method
(*Screen_updateEvents)(screen);
if (*(char *)(screen + 4) == '\0') {
uint32_t vtable = *((uint32_t *) screen);
for (char key : input) {
if (key == BACKSPACE_KEY) {
// Handle Backspace
(*(Screen_keyPressed_t *) (vtable + Screen_keyPressed_vtable_offset))(screen, BACKSPACE_KEY);
} else {
// Handle Nrmal Key
(*(Screen_keyboardNewChar_t *) (vtable + Screen_keyboardNewChar_vtable_offset))(screen, key);
}
}
}
clear_input(NULL);
}
// Init
void init_sign() {
if (feature_has("Fix Sign Placement", 0)) {
// Fix Signs
patch_address(LocalPlayer_openTextEdit_vtable_addr, (void *) LocalPlayer_openTextEdit_injection);
patch_address(TextEditScreen_updateEvents_vtable_addr, (void *) TextEditScreen_updateEvents_injection);
// Clear input On Input Tick
input_run_on_tick(clear_input);
}
}

View File

@ -1,11 +0,0 @@
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
void sign_key_press(char key);
#ifdef __cplusplus
}
#endif

View File

@ -171,5 +171,5 @@ void init_textures() {
}
// Scale Animated Textures
overwrite_call((void *) 0x53274, (void *) Textures_tick_glTexSubImage2D_injection);
overwrite_call((void *) 0x6bfd0, (void *) Textures_tick_glTexSubImage2D_injection);
}

View File

@ -38,17 +38,17 @@ void init_touch() {
// Disable Normal Cursor Rendering
unsigned char disable_cursor_patch[4] = {0x00, 0xf0, 0x20, 0xe3}; // "nop"
patch((void *) 0x4a6c0, disable_cursor_patch);
patch((void *) 0x61afc, disable_cursor_patch);
// Add Custom Cursor Rendering
overwrite_calls((void *) GameRenderer_render, (void *) GameRenderer_render_injection);
// Force Correct Toolbar Size
unsigned char toolbar_patch[4] = {0x01, 0x00, 0x50, 0xe3}; // "cmp r0, #0x1"
patch((void *) 0x257b0, toolbar_patch);
patch((void *) 0x2a6cc, toolbar_patch);
}
// Show Block Outlines
int block_outlines = feature_has("Show Block Outlines", 0);
unsigned char outline_patch[4] = {block_outlines ? !touch_gui : touch_gui, 0x00, 0x50, 0xe3}; // "cmp r0, #0x1" or "cmp r0, #0x0"
patch((void *) 0x4a210, outline_patch);
patch((void *) 0x6183c, outline_patch);
}

View File

@ -31,6 +31,8 @@ void init_version() {
overwrite((void *) Common_getGameVersionString, (void *) Common_getGameVersionString_injection);
// Normal GUI
patch_address((void *) minecraft_pi_version, version_get());
unsigned char normal_gui_version_length_patch[4] = {(unsigned char) strlen(version_get()), 0x20, 0xa0, 0xe3}; // "mov r2, #VERSION_LENGTH"
patch((void *) 0x4b11c, normal_gui_version_length_patch);
// Log
INFO("Starting Minecraft: Pi Edition (%s)", version_get());

View File

@ -13,43 +13,40 @@ typedef unsigned char bool;
// Globals
typedef void (*renderCursor_t)(float x, float y, unsigned char *minecraft);
static renderCursor_t renderCursor = (renderCursor_t) 0x480c4;
static renderCursor_t renderCursor = (renderCursor_t) 0x5f414;
static char **default_path = (char **) 0xe264; // /.minecraft/
static char **default_username = (char **) 0x18fd4; // StevePi
static char **minecraft_pi_version = (char **) 0x39d94; // v0.1.1 alpha
static char **full_data_path = (char **) 0xdd10; // .
static char **default_username = (char **) 0x1c250; // StevePi
static char **minecraft_pi_version = (char **) 0x4b2a0; // v0.1.0 alpha
static char **demo_level_name = (char **) 0x3a37c;
static unsigned char **Material_stone = (unsigned char **) 0x180a9c; // Material
static unsigned char **Item_flintAndSteel = (unsigned char **) 0x1da680; // Item
static unsigned char **Item_snowball = (unsigned char **) 0x1da770; // Item
static unsigned char **Item_shears = (unsigned char **) 0x1da7b0; // Item
static unsigned char **Item_egg = (unsigned char **) 0x1da790; // Item
static unsigned char **Item_dye_powder = (unsigned char **) 0x1da7a0; // Item
static unsigned char **Item_camera = (unsigned char **) 0x1da7cc; // Item
static unsigned char *SOUND_STONE = (unsigned char *) 0x181c80; // Tile::SoundType
static unsigned char **Tile_water = (unsigned char **) 0x1dfca4; // Tile
static unsigned char **Tile_lava = (unsigned char **) 0x1dfe30; // Tile
static unsigned char **Tile_calmWater = (unsigned char **) 0x1dfca8; // Tile
static unsigned char **Tile_calmLava = (unsigned char **) 0x1dfe34; // Tile
static unsigned char **Tile_glowingObsidian = (unsigned char **) 0x1e0014; // Tile
static unsigned char **Tile_web = (unsigned char **) 0x1dfe70; // Tile
static unsigned char **Tile_topSnow = (unsigned char **) 0x1dfc98; // Tile
static unsigned char **Tile_ice = (unsigned char **) 0x1dfee8; // Tile
static unsigned char **Tile_invisible_bedrock = (unsigned char **) 0x1dfef8; // Tile
static unsigned char **Tile_netherReactor = (unsigned char **) 0x1e0018; // Tile
static unsigned char **Tile_info_updateGame1 = (unsigned char **) 0x1dfdd4; // Tile
static unsigned char **Tile_info_updateGame2 = (unsigned char **) 0x1dfdd0; // Tile
static unsigned char **Tile_bedrock = (unsigned char **) 0x1dfe2c; // Tile
static unsigned char **Item_flintAndSteel = (unsigned char **) 0x17ba70; // Item
static unsigned char **Item_snowball = (unsigned char **) 0x17bbb0; // Item
static unsigned char **Item_shears = (unsigned char **) 0x17bbf0; // Item
static unsigned char **Item_egg = (unsigned char **) 0x17bbd0; // Item
static unsigned char **Item_dye_powder = (unsigned char **) 0x17bbe0; // Item
static unsigned char **Item_camera = (unsigned char **) 0x17bc14; // Item
static unsigned char **Tile_leaves = (unsigned char **) 0x1df374; // Tile
static unsigned char **Tile_leaves_carried = (unsigned char **) 0x1e0020; // Tile
static unsigned char **Tile_grass = (unsigned char **) 0x1dfc7c; // Tile
static unsigned char **Tile_grass_carried = (unsigned char **) 0x1e001c; // Tile
static unsigned char **Tile_water = (unsigned char **) 0x181b3c; // Tile
static unsigned char **Tile_lava = (unsigned char **) 0x181cc8; // Tile
static unsigned char **Tile_calmWater = (unsigned char **) 0x181b40; // Tile
static unsigned char **Tile_calmLava = (unsigned char **) 0x181ccc; // Tile
static unsigned char **Tile_glowingObsidian = (unsigned char **) 0x181dcc; // Tile
static unsigned char **Tile_web = (unsigned char **) 0x181d08; // Tile
static unsigned char **Tile_topSnow = (unsigned char **) 0x181b30; // Tile
static unsigned char **Tile_ice = (unsigned char **) 0x181d80; // Tile
static unsigned char **Tile_invisible_bedrock = (unsigned char **) 0x181d94; // Tile
static unsigned char **Tile_netherReactor = (unsigned char **) 0x181dd0; // Tile
static unsigned char **Tile_info_updateGame1 = (unsigned char **) 0x181c68; // Tile
static unsigned char **Tile_info_updateGame2 = (unsigned char **) 0x181c6c; // Tile
static unsigned char **Tile_bedrock = (unsigned char **) 0x181cc4; // Tile
static unsigned char **Tile_leaves = (unsigned char **) 0x18120c; // Tile
static unsigned char **Tile_leaves_carried = (unsigned char **) 0x181dd8; // Tile
static unsigned char **Tile_grass = (unsigned char **) 0x181b14; // Tile
static unsigned char **Tile_grass_carried = (unsigned char **) 0x181dd4; // Tile
static float *InvGuiScale = (float *) 0x135d98;
static float *InvGuiScale = (float *) 0x1949fc;
// Structures
@ -76,113 +73,86 @@ struct RakNet_SystemAddress {
// Tile
typedef void (*Tile_initTiles_t)();
static Tile_initTiles_t Tile_initTiles = (Tile_initTiles_t) 0xc358c;
#define TILE_SIZE 0x5c
#define TILE_VTABLE_SIZE 0x104
static unsigned char *Tile_vtable = (unsigned char *) 0x115670;
typedef unsigned char *(*Tile_t)(unsigned char *tile, int32_t id, int32_t texture, const void *material);
static Tile_t Tile = (Tile_t) 0xc33a0;
typedef unsigned char *(*Tile_init_t)(unsigned char *tile);
static Tile_init_t Tile_init = (Tile_init_t) 0xc34dc;
typedef unsigned char *(*Tile_setDestroyTime_t)(unsigned char *tile, float destroy_time);
static uint32_t Tile_setDestroyTime_vtable_offset = 0xf8;
typedef unsigned char *(*Tile_setExplodeable_t)(unsigned char *tile, float explodeable);
static uint32_t Tile_setExplodeable_vtable_offset = 0xf4;
typedef unsigned char *(*Tile_setSoundType_t)(unsigned char *tile, unsigned char *sound_type);
static uint32_t Tile_setSoundType_vtable_offset = 0xe8;
typedef int32_t (*Tile_use_t)(unsigned char *tile, unsigned char *level, int32_t x, int32_t y, int32_t z, unsigned char *player);
static uint32_t Tile_use_vtable_offset = 0x98;
static uint32_t Tile_id_property_offset = 0x8; // int32_t
static uint32_t Tile_category_property_offset = 0x3c; // int32_t
// GameMode
// AppPlatform
typedef void (*GameMode_releaseUsingItem_t)(unsigned char *game_mode, unsigned char *player);
static uint32_t GameMode_releaseUsingItem_vtable_offset = 0x5c;
typedef bool (*AppPlatform_isPowerVR_t)(unsigned char *app_platform);
static AppPlatform_isPowerVR_t AppPlatform_isPowerVR = (AppPlatform_isPowerVR_t) 0x12670;
// Minecraft
typedef void (*Minecraft_init_t)(unsigned char *minecraft);
static Minecraft_init_t Minecraft_init = (Minecraft_init_t) 0x1700c;
static Minecraft_init_t Minecraft_init = (Minecraft_init_t) 0x182c8;
typedef void (*Minecraft_tickInput_t)(unsigned char *minecraft);
static Minecraft_tickInput_t Minecraft_tickInput = (Minecraft_tickInput_t) 0x15ffc;
static Minecraft_tickInput_t Minecraft_tickInput = (Minecraft_tickInput_t) 0x166a8;
typedef void (*Minecraft_setIsCreativeMode_t)(unsigned char *, int32_t);
static Minecraft_setIsCreativeMode_t Minecraft_setIsCreativeMode = (Minecraft_setIsCreativeMode_t) 0x16ec4;
static Minecraft_setIsCreativeMode_t Minecraft_setIsCreativeMode = (Minecraft_setIsCreativeMode_t) 0x17888;
typedef int32_t (*Minecraft_isTouchscreen_t)(unsigned char *minecraft);
static Minecraft_isTouchscreen_t Minecraft_isTouchscreen = (Minecraft_isTouchscreen_t) 0x1639c;
static Minecraft_isTouchscreen_t Minecraft_isTouchscreen = (Minecraft_isTouchscreen_t) 0x16b38;
typedef void (*Minecraft_setScreen_t)(unsigned char *minecraft, unsigned char *screen);
static Minecraft_setScreen_t Minecraft_setScreen = (Minecraft_setScreen_t) 0x15d6c;
static Minecraft_setScreen_t Minecraft_setScreen = (Minecraft_setScreen_t) 0x16388;
typedef void (*Minecraft_tick_t)(unsigned char *minecraft, int32_t param_1, int32_t param_2);
static Minecraft_tick_t Minecraft_tick = (Minecraft_tick_t) 0x16934;
static Minecraft_tick_t Minecraft_tick = (Minecraft_tick_t) 0x17030;
typedef void (*Minecraft_update_t)(unsigned char *minecraft);
static Minecraft_update_t Minecraft_update = (Minecraft_update_t) 0x16b74;
static Minecraft_update_t Minecraft_update = (Minecraft_update_t) 0x172e4;
typedef void (*Minecraft_hostMultiplayer_t)(unsigned char *minecraft, int32_t port);
static Minecraft_hostMultiplayer_t Minecraft_hostMultiplayer = (Minecraft_hostMultiplayer_t) 0x16664;
static Minecraft_hostMultiplayer_t Minecraft_hostMultiplayer = (Minecraft_hostMultiplayer_t) 0x16c50;
typedef const char *(*Minecraft_getProgressMessage_t)(unsigned char *minecraft);
static Minecraft_getProgressMessage_t Minecraft_getProgressMessage = (Minecraft_getProgressMessage_t) 0x16e58;
static Minecraft_getProgressMessage_t Minecraft_getProgressMessage = (Minecraft_getProgressMessage_t) 0x17810;
typedef uint32_t (*Minecraft_isLevelGenerated_t)(unsigned char *minecraft);
static Minecraft_isLevelGenerated_t Minecraft_isLevelGenerated = (Minecraft_isLevelGenerated_t) 0x16e6c;
static Minecraft_isLevelGenerated_t Minecraft_isLevelGenerated = (Minecraft_isLevelGenerated_t) 0x17824;
typedef bool (*Minecraft_isCreativeMode_t)(unsigned char *minecraft);
static Minecraft_isCreativeMode_t Minecraft_isCreativeMode = (Minecraft_isCreativeMode_t) 0x17270;
static Minecraft_isCreativeMode_t Minecraft_isCreativeMode = (Minecraft_isCreativeMode_t) 0x17a48;
typedef void (*Minecraft_releaseMouse_t)(unsigned char *minecraft);
static Minecraft_releaseMouse_t Minecraft_releaseMouse = (Minecraft_releaseMouse_t) 0x15d30;
static Minecraft_releaseMouse_t Minecraft_releaseMouse = (Minecraft_releaseMouse_t) 0x1634c;
typedef void (*Minecraft_grabMouse_t)(unsigned char *minecraft);
static Minecraft_grabMouse_t Minecraft_grabMouse = (Minecraft_grabMouse_t) 0x15d10;
static Minecraft_grabMouse_t Minecraft_grabMouse = (Minecraft_grabMouse_t) 0x1632c;
typedef void (*Minecraft_leaveGame_t)(unsigned char *minecraft, bool save_remote_level);
static Minecraft_leaveGame_t Minecraft_leaveGame = (Minecraft_leaveGame_t) 0x15ea0;
static Minecraft_leaveGame_t Minecraft_leaveGame = (Minecraft_leaveGame_t) 0x1653c;
typedef int (*Minecraft_handleBack_t)(unsigned char *minecraft, bool do_nothing);
static uint32_t Minecraft_handleBack_vtable_offset = 0x34;
typedef unsigned char *(*Minecraft_getCreator_t)(unsigned char *minecraft);
static Minecraft_getCreator_t Minecraft_getCreator = (Minecraft_getCreator_t) 0x17538;
static Minecraft_getCreator_t Minecraft_getCreator = (Minecraft_getCreator_t) 0x17d74;
typedef unsigned char *(*Minecraft_getLevelSource_t)(unsigned char *minecraft);
static Minecraft_getLevelSource_t Minecraft_getLevelSource = (Minecraft_getLevelSource_t) 0x16e84;
static Minecraft_getLevelSource_t Minecraft_getLevelSource = (Minecraft_getLevelSource_t) 0x1783c;
static uint32_t Minecraft_screen_width_property_offset = 0x20; // int32_t
static uint32_t Minecraft_network_handler_property_offset = 0x174; // NetEventCallback *
static uint32_t Minecraft_rak_net_instance_property_offset = 0x170; // RakNetInstance *
static uint32_t Minecraft_level_property_offset = 0x188; // Level *
static uint32_t Minecraft_textures_property_offset = 0x164; // Textures *
static uint32_t Minecraft_game_mode_property_offset = 0x160; // GameMode *
static uint32_t Minecraft_player_property_offset = 0x18c; // LocalPlayer *
static uint32_t Minecraft_options_property_offset = 0x3c; // Options
static uint32_t Minecraft_hit_result_property_offset = 0xc38; // HitResult
static uint32_t Minecraft_progress_property_offset = 0xc60; // int32_t
static uint32_t Minecraft_command_server_property_offset = 0xcc0; // CommandServer *
static uint32_t Minecraft_screen_property_offset = 0xc10; // Screen *
static uint32_t Minecraft_gui_property_offset = 0x198; // Gui
static uint32_t Minecraft_pov_property_offset = 0x150; // Mob *
static uint32_t Minecraft_perf_renderer_property_offset = 0xcbc; // PerfRenderer *
static uint32_t Minecraft_network_handler_property_offset = 0x158; // NetEventCallback *
static uint32_t Minecraft_rak_net_instance_property_offset = 0x154; // RakNetInstance *
static uint32_t Minecraft_level_property_offset = 0x16c; // Level *
static uint32_t Minecraft_textures_property_offset = 0x148; // Textures *
static uint32_t Minecraft_game_mode_property_offset = 0x144; // GameMode *
static uint32_t Minecraft_player_property_offset = 0x170; // LocalPlayer *
static uint32_t Minecraft_options_property_offset = 0x28; // Options
static uint32_t Minecraft_hit_result_property_offset = 0xc1c; // HitResult
static uint32_t Minecraft_progress_property_offset = 0xc44; // int32_t
static uint32_t Minecraft_command_server_property_offset = 0xca4; // CommandServer *
static uint32_t Minecraft_screen_property_offset = 0xbf4; // Screen *
static uint32_t Minecraft_gui_property_offset = 0x17c; // Gui
static uint32_t Minecraft_pov_property_offset = 0x170; // Mob *
// GameRenderer
typedef void (*GameRenderer_render_t)(unsigned char *game_renderer, float param_1);
static GameRenderer_render_t GameRenderer_render = (GameRenderer_render_t) 0x4a338;
static GameRenderer_render_t GameRenderer_render = (GameRenderer_render_t) 0x619c0;
static uint32_t GameRenderer_minecraft_property_offset = 0x4; // Minecraft *
@ -190,19 +160,19 @@ static uint32_t GameRenderer_minecraft_property_offset = 0x4; // Minecraft *
typedef int (*Mouse_get_t)();
static Mouse_get_t Mouse_getX = (Mouse_get_t) 0x1385c;
static Mouse_get_t Mouse_getY = (Mouse_get_t) 0x1386c;
static Mouse_get_t Mouse_getX = (Mouse_get_t) 0x13480;
static Mouse_get_t Mouse_getY = (Mouse_get_t) 0x13490;
// CommandServer
static uint32_t CommandServer_minecraft_property_offset = 0x18; // Minecraft *
static uint32_t CommandServer_minecraft_property_offset = 0x14; // Minecraft *
// ServerLevel
#define SERVER_LEVEL_SIZE 0xb80
typedef unsigned char *(*ServerLevel_t)(unsigned char *server_level, unsigned char *storage, unsigned char *name, struct LevelSettings *settings, int param_4, unsigned char *dimension);
static ServerLevel_t ServerLevel = (ServerLevel_t) 0x7692c;
static ServerLevel_t ServerLevel = (ServerLevel_t) 0x9b6c4;
// Packet
@ -210,16 +180,16 @@ typedef void (*Packet_read_t)(unsigned char *packet, unsigned char *bit_stream);
// LoginPacket
static Packet_read_t LoginPacket_read = (Packet_read_t) 0x6e5f8;
static void *LoginPacket_read_vtable_addr = (void *) 0x108dcc;
static Packet_read_t LoginPacket_read = (Packet_read_t) 0x8fc4c;
static void *LoginPacket_read_vtable_addr = (void *) 0x169e64;
static uint32_t LoginPacket_username_property_offset = 0xc; // RakString
// StartGamePacket
typedef void (*StartGamePacket_read_t)(unsigned char *packet, unsigned char *bit_stream);
static StartGamePacket_read_t StartGamePacket_read = (StartGamePacket_read_t) 0x72c58;
static void *StartGamePacket_read_vtable_addr = (void *) 0x109264;
static StartGamePacket_read_t StartGamePacket_read = (StartGamePacket_read_t) 0x96e50;
static void *StartGamePacket_read_vtable_addr = (void *) 0x16a2cc;
static uint32_t StartGamePacket_game_mode_property_offset = 0x14; // int32_t
@ -234,8 +204,8 @@ static uint32_t HitResult_type_property_offset = 0x0;
// Options
static uint32_t Options_fancy_graphics_property_offset = 0x17; // unsigned char / bool
static uint32_t Options_split_controls_property_offset = 0x105; // int32_t
static uint32_t Options_peaceful_mode_property_offset = 0xe8; // unsigned char / bool
static uint32_t Options_peaceful_mode_property_offset = 0xe8; // int32_t
static uint32_t Options_split_controls_property_offset = 0x105; // unsigned char / bool
static uint32_t Options_3d_anaglyph_property_offset = 0x15; // unsigned char / bool
static uint32_t Options_ambient_occlusion_property_offset = 0x18; // unsigned char / bool
static uint32_t Options_hide_gui_property_offset = 0xec; // unsigned char / bool
@ -247,8 +217,8 @@ static uint32_t Options_debug_property_offset = 0xee; // unsigned char / bool
// MouseBuildInput
typedef int32_t (*MouseBuildInput_tickBuild_t)(unsigned char *mouse_build_input, unsigned char *player, uint32_t *build_action_intention_return);
static MouseBuildInput_tickBuild_t MouseBuildInput_tickBuild = (MouseBuildInput_tickBuild_t) 0x17c98;
static void *MouseBuildInput_tickBuild_vtable_addr = (void *) 0x102564;
static MouseBuildInput_tickBuild_t MouseBuildInput_tickBuild = (MouseBuildInput_tickBuild_t) 0x19118;
static void *MouseBuildInput_tickBuild_vtable_addr = (void *) 0x16405c;
// ItemInstance
@ -259,12 +229,12 @@ typedef struct {
} ItemInstance;
typedef ItemInstance *(*ItemInstance_constructor_t)(ItemInstance *item_instance, unsigned char *item);
static ItemInstance_constructor_t ItemInstance_constructor_item = (ItemInstance_constructor_t) 0x9992c;
static ItemInstance_constructor_t ItemInstance_constructor_tile = (ItemInstance_constructor_t) 0x998e4;
static ItemInstance_constructor_t ItemInstance_constructor_item = (ItemInstance_constructor_t) 0xdf40c;
static ItemInstance_constructor_t ItemInstance_constructor_tile = (ItemInstance_constructor_t) 0xdf3c8;
typedef ItemInstance *(*ItemInstance_constructor_extra_t)(ItemInstance *item_instance, unsigned char *item, int32_t count, int32_t auxiliary);
static ItemInstance_constructor_extra_t ItemInstance_constructor_tile_extra = (ItemInstance_constructor_extra_t) 0x99918;
static ItemInstance_constructor_extra_t ItemInstance_constructor_item_extra = (ItemInstance_constructor_extra_t) 0x99960;
static ItemInstance_constructor_extra_t ItemInstance_constructor_tile_extra = (ItemInstance_constructor_extra_t) 0xdf3fc;
static ItemInstance_constructor_extra_t ItemInstance_constructor_item_extra = (ItemInstance_constructor_extra_t) 0xdf440;
// Entity
@ -283,55 +253,49 @@ static uint32_t Entity_old_yaw_property_offset = 0x48; // float
// Mob
typedef void (*Mob_actuallyHurt_t)(unsigned char *entity, int32_t damage);
static Mob_actuallyHurt_t Mob_actuallyHurt = (Mob_actuallyHurt_t) 0x7f11c;
static uint32_t Mob_actuallyHurt_vtable_offset = 0x16c;
typedef float (*Mob_getWalkingSpeedModifier_t)(unsigned char *entity);
static Mob_actuallyHurt_t Mob_actuallyHurt = (Mob_actuallyHurt_t) 0xab2d4;
static uint32_t Mob_actuallyHurt_vtable_offset = 0x1a0;
static uint32_t Mob_health_property_offset = 0xec; // int32_t
// Player
typedef int (*Player_isUsingItem_t)(unsigned char *player);
static Player_isUsingItem_t Player_isUsingItem = (Player_isUsingItem_t) 0x8f15c;
static Player_isUsingItem_t Player_isUsingItem = (Player_isUsingItem_t) 0xceb24;
typedef void (*Player_drop_t)(unsigned char *player, ItemInstance *item_instance, bool is_death);
static uint32_t Player_drop_vtable_offset = 0x208;
static uint32_t Player_drop_vtable_offset = 0x1f8;
static Mob_getWalkingSpeedModifier_t Player_getWalkingSpeedModifier = (Mob_getWalkingSpeedModifier_t) 0x8ea0c;
static uint32_t Player_username_property_offset = 0xbf4; // std::string
static uint32_t Player_inventory_property_offset = 0xbe0; // Inventory *
static uint32_t Player_username_property_offset = 0xbec; // std::string
static uint32_t Player_inventory_property_offset = 0xbd8; // Inventory *
// LocalPlayer
static Mob_actuallyHurt_t LocalPlayer_actuallyHurt = (Mob_actuallyHurt_t) 0x44010;
static void *LocalPlayer_actuallyHurt_vtable_addr = (void *) 0x10639c;
static Mob_actuallyHurt_t LocalPlayer_actuallyHurt = (Mob_actuallyHurt_t) 0x59f48;
static void *LocalPlayer_actuallyHurt_vtable_addr = (void *) 0x1676d0;
static void *LocalPlayer_openTextEdit_vtable_addr = (void *) 0x106460;
static uint32_t LocalPlayer_minecraft_property_offset = 0xc90; // Minecraft *
static uint32_t LocalPlayer_minecraft_property_offset = 0xc58; // Minecraft *
// ServerPlayer
static void *ServerPlayer_actuallyHurt_vtable_addr = (void *) 0x109fa4;
static void *ServerPlayer_actuallyHurt_vtable_addr = (void *) 0x16b020;
static uint32_t ServerPlayer_minecraft_property_offset = 0xc8c; // Minecraft *
static uint32_t ServerPlayer_guid_property_offset = 0xc08; // RakNetGUID
static uint32_t ServerPlayer_minecraft_property_offset = 0xc54; // Minecraft *
static uint32_t ServerPlayer_guid_property_offset = 0xc00; // RakNetGUID
// Gui
typedef void (*Gui_tick_t)(unsigned char *gui);
static Gui_tick_t Gui_tick = (Gui_tick_t) 0x27778;
static Gui_tick_t Gui_tick = (Gui_tick_t) 0x2b0b0;
typedef void (*Gui_handleClick_t)(unsigned char *gui, int32_t param_2, int32_t param_3, int32_t param_4);
static Gui_handleClick_t Gui_handleClick = (Gui_handleClick_t) 0x2599c;
static Gui_handleClick_t Gui_handleClick = (Gui_handleClick_t) 0x2a8f0;
typedef void (*Gui_renderOnSelectItemNameText_t)(unsigned char *gui, int32_t param_1, unsigned char *font, int32_t param_2);
static Gui_renderOnSelectItemNameText_t Gui_renderOnSelectItemNameText = (Gui_renderOnSelectItemNameText_t) 0x26aec;
static Gui_renderOnSelectItemNameText_t Gui_renderOnSelectItemNameText = (Gui_renderOnSelectItemNameText_t) 0x2bcb8;
typedef void (*Gui_renderChatMessages_t)(unsigned char *gui, int32_t y_offset, uint32_t max_messages, bool disable_fading, unsigned char *font);
static Gui_renderChatMessages_t Gui_renderChatMessages = (Gui_renderChatMessages_t) 0x273d8;
static Gui_renderChatMessages_t Gui_renderChatMessages = (Gui_renderChatMessages_t) 0x2bed8;
static uint32_t Gui_minecraft_property_offset = 0x9f4; // Minecraft *
static uint32_t Gui_selected_item_text_timer_property_offset = 0x9fc; // float
@ -339,102 +303,86 @@ static uint32_t Gui_selected_item_text_timer_property_offset = 0x9fc; // float
// Textures
typedef void (*Textures_tick_t)(unsigned char *textures, bool param_1);
static Textures_tick_t Textures_tick = (Textures_tick_t) 0x531c4;
static Textures_tick_t Textures_tick = (Textures_tick_t) 0x6bee4;
// GameMode Constructors
#define CREATOR_MODE_SIZE 0x1c
static void *CreatorMode = (void *) 0x1a044;
static void *CreatorMode = (void *) 0x1d254;
#define SURVIVAL_MODE_SIZE 0x24
static void *SurvivalMode = (void *) 0x1b7d8;
static void *SurvivalMode = (void *) 0x1fecc;
// LevelData
typedef uint32_t (*LevelData_getSpawnMobs_t)(unsigned char *level_data);
static LevelData_getSpawnMobs_t LevelData_getSpawnMobs = (LevelData_getSpawnMobs_t) 0xbabec;
static LevelData_getSpawnMobs_t LevelData_getSpawnMobs = (LevelData_getSpawnMobs_t) 0x1171e0;
// Level
typedef void (*Level_saveLevelData_t)(unsigned char *level);
static Level_saveLevelData_t Level_saveLevelData = (Level_saveLevelData_t) 0xa2e94;
static Level_saveLevelData_t Level_saveLevelData = (Level_saveLevelData_t) 0xeef98;
typedef void (*Level_setTileAndData_t)(unsigned char *level, int32_t x, int32_t y, int32_t z, int32_t id, int32_t data);
static Level_setTileAndData_t Level_setTileAndData = (Level_setTileAndData_t) 0xa38b4;
static Level_setTileAndData_t Level_setTileAndData = (Level_setTileAndData_t) 0xefa8c;
static uint32_t Level_players_property_offset = 0x60; // std::vector<ServerPlayer *>
// LevelRenderer
typedef void (*LevelRenderer_render_t)(unsigned char *level_renderer, unsigned char *mob, int param_1, float delta);
static LevelRenderer_render_t LevelRenderer_render = (LevelRenderer_render_t) 0x4f710;
static LevelRenderer_render_t LevelRenderer_render = (LevelRenderer_render_t) 0x67604;
typedef void (*LevelRenderer_renderDebug_t)(unsigned char *level_renderer, struct AABB *aabb, float delta);
static LevelRenderer_renderDebug_t LevelRenderer_renderDebug = (LevelRenderer_renderDebug_t) 0x4d310;
static LevelRenderer_renderDebug_t LevelRenderer_renderDebug = (LevelRenderer_renderDebug_t) 0x65c34;
static uint32_t LevelRenderer_minecraft_property_offset = 0x4; // Minecraft *
// PerfRenderer
typedef void (*PerfRenderer_debugFpsMeterKeyPress_t)(unsigned char *perf_renderer, int key);
static PerfRenderer_debugFpsMeterKeyPress_t PerfRenderer_debugFpsMeterKeyPress = (PerfRenderer_debugFpsMeterKeyPress_t) 0x79118;
// TextEditScreen
#define TEXT_EDIT_SCREEN_SIZE 0xd0
typedef unsigned char *(*TextEditScreen_t)(unsigned char *text_edit_screen, unsigned char *sign);
static TextEditScreen_t TextEditScreen = (TextEditScreen_t) 0x3a840;
static void *TextEditScreen_updateEvents_vtable_addr = (void *) 0x10531c;
// ProgressScreen
#define PROGRESS_SCREEN_SIZE 0x4c
#define PROGRESS_SCREEN_SIZE 0x40
typedef void *(*ProgressScreen_t)(unsigned char *obj);
static ProgressScreen_t ProgressScreen = (ProgressScreen_t) 0x37044;
static ProgressScreen_t ProgressScreen = (ProgressScreen_t) 0x42a08;
// OptionsScreen
static void *OptionsScreen_handleBackEvent_vtable_addr = (void *) 0x10499c;
static void *OptionsScreen_handleBackEvent_vtable_addr = (void *) 0x165fb8;
// Screen
typedef void (*Screen_updateEvents_t)(unsigned char *screen);
static Screen_updateEvents_t Screen_updateEvents = (Screen_updateEvents_t) 0x28eb8;
typedef void (*Screen_keyboardNewChar_t)(unsigned char *screen, char key);
static uint32_t Screen_keyboardNewChar_vtable_offset = 0x70;
typedef void (*Screen_keyPressed_t)(unsigned char *screen, int32_t key);
static uint32_t Screen_keyPressed_vtable_offset = 0x6c;
typedef void (*Screen_tick_t)(unsigned char *screen);
typedef int32_t (*Screen_handleBackEvent_t)(unsigned char *screen, bool param_1);
static uint32_t Screen_minecraft_property_offset = 0x14; // Minecraft *
// DemoChooseLevelScreen
#define DEMO_LEVEL_CHOOSE_SCREEN_SIZE 0x49
typedef unsigned char *(*DemoChooseLevelScreen_t)(unsigned char *demo_choose_level_screen);
static DemoChooseLevelScreen_t DemoChooseLevelScreen = (DemoChooseLevelScreen_t) 0x3a470;
// SelectWorldScreen
static Screen_tick_t SelectWorldScreen_tick = (Screen_tick_t) 0x38a2c;
static void *SelectWorldScreen_tick_vtable_addr = (void *) 0x104f78;
static Screen_tick_t SelectWorldScreen_tick = (Screen_tick_t) 0x46228;
static void *SelectWorldScreen_tick_vtable_addr = (void *) 0x16642c;
static uint32_t SelectWorldScreen_should_create_world_property_offset = 0xfc; // bool
static uint32_t SelectWorldScreen_world_created_property_offset = 0xf9; // bool
static uint32_t SelectWorldScreen_should_create_world_property_offset = 0xe0; // bool
static uint32_t SelectWorldScreen_world_created_property_offset = 0xdd; // bool
// Touch::SelectWorldScreen
static Screen_tick_t Touch_SelectWorldScreen_tick = (Screen_tick_t) 0x3d96c;
static void *Touch_SelectWorldScreen_tick_vtable_addr = (void *) 0x105780;
static Screen_tick_t Touch_SelectWorldScreen_tick = (Screen_tick_t) 0x50cb0;
static void *Touch_SelectWorldScreen_tick_vtable_addr = (void *) 0x166b64;
static uint32_t Touch_SelectWorldScreen_should_create_world_property_offset = 0x154; // bool
static uint32_t Touch_SelectWorldScreen_world_created_property_offset = 0x151; // bool
static uint32_t Touch_SelectWorldScreen_should_create_world_property_offset = 0x134; // bool
static uint32_t Touch_SelectWorldScreen_world_created_property_offset = 0x131; // bool
// FillingContainer
typedef int32_t (*FillingContainer_addItem_t)(unsigned char *filling_container, ItemInstance *item_instance);
static FillingContainer_addItem_t FillingContainer_addItem = (FillingContainer_addItem_t) 0x92aa0;
static FillingContainer_addItem_t FillingContainer_addItem = (FillingContainer_addItem_t) 0xd563c;
typedef ItemInstance *(*FillingContainer_getItem_t)(unsigned char *filling_container, int32_t slot);
static uint32_t FillingContainer_getItem_vtable_offset = 0x8;
@ -443,13 +391,13 @@ typedef void (*FillingContainer_setItem_t)(unsigned char *filling_container, int
static uint32_t FillingContainer_setItem_vtable_offset = 0xc;
typedef void (*FillingContainer_clearSlot_t)(unsigned char *filling_container, int32_t slot);
static FillingContainer_clearSlot_t FillingContainer_clearSlot = (FillingContainer_clearSlot_t) 0x922f8;
static FillingContainer_clearSlot_t FillingContainer_clearSlot = (FillingContainer_clearSlot_t) 0xd4fd4;
typedef void (*FillingContainer_release_t)(unsigned char *filling_container, int32_t slot);
static FillingContainer_release_t FillingContainer_release = (FillingContainer_release_t) 0x92058;
static FillingContainer_release_t FillingContainer_release = (FillingContainer_release_t) 0xd4d58;
typedef void (*FillingContainer_compressLinkedSlotList_t)(unsigned char *filling_container, int32_t slot);
static FillingContainer_compressLinkedSlotList_t FillingContainer_compressLinkedSlotList = (FillingContainer_compressLinkedSlotList_t) 0x92280;
static FillingContainer_compressLinkedSlotList_t FillingContainer_compressLinkedSlotList = (FillingContainer_compressLinkedSlotList_t) 0xd4f58;
static uint32_t FillingContainer_linked_slots_property_offset = 0xc; // int32_t[]
static uint32_t FillingContainer_linked_slots_length_property_offset = 0x14; // int32_t
@ -457,10 +405,10 @@ static uint32_t FillingContainer_linked_slots_length_property_offset = 0x14; //
// RakNet::RakString
typedef unsigned char *(*RakNet_RakString_t)(unsigned char *rak_string, const char *format, ...);
static RakNet_RakString_t RakNet_RakString = (RakNet_RakString_t) 0xea5cc;
static RakNet_RakString_t RakNet_RakString = (RakNet_RakString_t) 0x151f10;
typedef void (*RakNet_RakString_Assign_t)(unsigned char *rak_string, const char *str);
static RakNet_RakString_Assign_t RakNet_RakString_Assign = (RakNet_RakString_Assign_t) 0xe9e34;
static RakNet_RakString_Assign_t RakNet_RakString_Assign = (RakNet_RakString_Assign_t) 0x15189c;
static uint32_t RakNet_RakString_sharedString_property_offset = 0x0; // RakNet::RakString::SharedString *
@ -477,12 +425,12 @@ typedef uint32_t (*RakNetInstance_isServer_t)(unsigned char *rak_net_instance);
static uint32_t RakNetInstance_isServer_vtable_offset = 0x48;
typedef void (*RakNetInstance_pingForHosts_t)(unsigned char *rak_net_instance, int32_t base_port);
static RakNetInstance_pingForHosts_t RakNetInstance_pingForHosts = (RakNetInstance_pingForHosts_t) 0x73538;
static RakNetInstance_pingForHosts_t RakNetInstance_pingForHosts = (RakNetInstance_pingForHosts_t) 0x97da8;
static uint32_t RakNetInstance_pingForHosts_vtable_offset = 0x14;
static void *RakNetInstance_pingForHosts_vtable_addr = (void *) 0x109afc;
static void *RakNetInstance_pingForHosts_vtable_addr = (void *) 0x16ab4c;
typedef unsigned char *(*RakNetInstance_t)(unsigned char *rak_net_instance);
static RakNetInstance_t RakNetInstance = (RakNetInstance_t) 0x73b20;
static RakNetInstance_t RakNetInstance = (RakNetInstance_t) 0x98318;
static uint32_t RakNetInstance_peer_property_offset = 0x4; // RakNet::RakPeer *
static uint32_t RakNetInstance_pinging_for_hosts_property_offset = 0x24; // unsigned char
@ -504,45 +452,48 @@ typedef enum {
STARTUP_OTHER_FAILURE
} RakNet_StartupResult;
typedef RakNet_StartupResult (*RakNet_RakPeer_Startup_t)(unsigned char *rak_peer, unsigned short maxConnections, unsigned char *socketDescriptors, uint32_t socketDescriptorCount, int32_t threadPriority);
static RakNet_RakPeer_Startup_t RakNet_RakPeer_Startup = (RakNet_RakPeer_Startup_t) 0xe1654;
static void *RakNet_RakPeer_Startup_vtable_addr = (void *) 0x135438;
static RakNet_RakPeer_Startup_t RakNet_RakPeer_Startup = (RakNet_RakPeer_Startup_t) 0x14a5e4;
static void *RakNet_RakPeer_Startup_vtable_addr = (void *) 0x176998;
typedef struct RakNet_SystemAddress (*RakNet_RakPeer_GetSystemAddressFromGuid_t)(unsigned char *rak_peer, struct RakNet_RakNetGUID guid);
static uint32_t RakNet_RakPeer_GetSystemAddressFromGuid_vtable_offset = 0xd0;
typedef bool (*RakNet_RakPeer_IsBanned_t)(unsigned char *rak_peer, const char *ip);
static RakNet_RakPeer_IsBanned_t RakNet_RakPeer_IsBanned = (RakNet_RakPeer_IsBanned_t) 0xda3b4;
static RakNet_RakPeer_IsBanned_t RakNet_RakPeer_IsBanned = (RakNet_RakPeer_IsBanned_t) 0x144860;
typedef bool (*RakNet_RakPeer_Ping_t)(unsigned char *rak_peer, const char *host, unsigned short remotePort, bool onlyReplyOnAcceptingConnections, uint32_t connectionSocketIndex);
static RakNet_RakPeer_Ping_t RakNet_RakPeer_Ping = (RakNet_RakPeer_Ping_t) 0xd9c2c;
static RakNet_RakPeer_Ping_t RakNet_RakPeer_Ping = (RakNet_RakPeer_Ping_t) 0x1464f0;
// RakNet::SystemAddress
typedef char *(*RakNet_SystemAddress_ToString_t)(struct RakNet_SystemAddress *system_address, bool print_delimiter, char delimiter);
static RakNet_SystemAddress_ToString_t RakNet_SystemAddress_ToString = (RakNet_SystemAddress_ToString_t) 0xd6198;
static RakNet_SystemAddress_ToString_t RakNet_SystemAddress_ToString = (RakNet_SystemAddress_ToString_t) 0x143754;
// ServerSideNetworkHandler
typedef void (*ServerSideNetworkHandler_onDisconnect_t)(unsigned char *server_side_network_handler, struct RakNet_RakNetGUID *guid);
static ServerSideNetworkHandler_onDisconnect_t ServerSideNetworkHandler_onDisconnect = (ServerSideNetworkHandler_onDisconnect_t) 0x75164;
static void *ServerSideNetworkHandler_onDisconnect_vtable_addr = (void *) 0x109bb0;
typedef unsigned char *(*ServerSideNetworkHandler_getPlayer_t)(unsigned char *server_side_network_handler, struct RakNet_RakNetGUID *guid);
static ServerSideNetworkHandler_getPlayer_t ServerSideNetworkHandler_getPlayer = (ServerSideNetworkHandler_getPlayer_t) 0x75464;
static ServerSideNetworkHandler_onDisconnect_t ServerSideNetworkHandler_onDisconnect = (ServerSideNetworkHandler_onDisconnect_t) 0x99b78;
static void *ServerSideNetworkHandler_onDisconnect_vtable_addr = (void *) 0x16ac00;
typedef unsigned char *(*ServerSideNetworkHandler_popPendingPlayer_t)(unsigned char *server_side_network_handler, struct RakNet_RakNetGUID *guid);
static ServerSideNetworkHandler_popPendingPlayer_t ServerSideNetworkHandler_popPendingPlayer = (ServerSideNetworkHandler_popPendingPlayer_t) 0x75db4;
static ServerSideNetworkHandler_popPendingPlayer_t ServerSideNetworkHandler_popPendingPlayer = (ServerSideNetworkHandler_popPendingPlayer_t) 0x99ee8;
typedef void (*ServerSideNetworkHandler_handle_t)(unsigned char *server_side_network_handler, struct RakNet_RakNetGUID *rak_net_guid, unsigned char *packet);
static void *ServerSideNetworkHandler_handle_ChatPacket_vtable_addr = (void *) 0x109c60;
static void *ServerSideNetworkHandler_handle_ChatPacket_vtable_addr = (void *) 0x16aca8;
static uint32_t ServerSideNetworkHandler_level_property_offset = 0xc; // Level *
static uint32_t ServerSideNetworkHandler_minecraft_property_offset = 0x8; // Minecraft *
// NetEventCallback
typedef unsigned char *(*NetEventCallback_findPlayer_t)(unsigned char *net_event_callback, unsigned char *level, struct RakNet_RakNetGUID *guid);
static NetEventCallback_findPlayer_t NetEventCallback_findPlayer = (NetEventCallback_findPlayer_t) 0x91440;
// Inventory
typedef void (*Inventory_selectSlot_t)(unsigned char *inventory, int32_t slot);
static Inventory_selectSlot_t Inventory_selectSlot = (Inventory_selectSlot_t) 0x8d13c;
static Inventory_selectSlot_t Inventory_selectSlot = (Inventory_selectSlot_t) 0xccefc;
static uint32_t Inventory_selectedSlot_property_offset = 0x28; // int32_t
@ -551,15 +502,15 @@ static uint32_t Inventory_selectedSlot_property_offset = 0x28; // int32_t
#define TRIPOD_CAMERA_RENDERER_SIZE 0x178
typedef unsigned char *(*TripodCameraRenderer_t)(unsigned char *renderer);
static TripodCameraRenderer_t TripodCameraRenderer = (TripodCameraRenderer_t) 0x6583c;
static TripodCameraRenderer_t TripodCameraRenderer = (TripodCameraRenderer_t) 0x81260;
// EntityRenderDispatcher
typedef unsigned char *(*EntityRenderDispatcher_t)(unsigned char *dispatcher);
static EntityRenderDispatcher_t EntityRenderDispatcher = (EntityRenderDispatcher_t) 0x6096c;
static EntityRenderDispatcher_t EntityRenderDispatcher = (EntityRenderDispatcher_t) 0x7a990;
typedef void (*EntityRenderDispatcher_assign_t)(unsigned char *dispatcher, unsigned char entity_id, unsigned char *renderer);
static EntityRenderDispatcher_assign_t EntityRenderDispatcher_assign = (EntityRenderDispatcher_assign_t) 0x6094c;
static EntityRenderDispatcher_assign_t EntityRenderDispatcher_assign = (EntityRenderDispatcher_assign_t) 0x7a968;
// TileEntity
@ -568,32 +519,32 @@ static uint32_t TileEntity_id_property_offset = 0x18; // int32_t
// ItemRenderer
typedef float (*ItemRenderer_renderGuiItem_t)(unsigned char *font, unsigned char *textures, ItemInstance *item_instance, float param_1, float param_2, bool param_3);
static ItemRenderer_renderGuiItem_t ItemRenderer_renderGuiItem = (ItemRenderer_renderGuiItem_t) 0x63e58;
static ItemRenderer_renderGuiItem_t ItemRenderer_renderGuiItem = (ItemRenderer_renderGuiItem_t) 0x7f8bc;
typedef float (*ItemRenderer_renderGuiItemCorrect_t)(unsigned char *font, unsigned char *textures, ItemInstance *item_instance, int32_t param_1, int32_t param_2);
static ItemRenderer_renderGuiItemCorrect_t ItemRenderer_renderGuiItemCorrect = (ItemRenderer_renderGuiItemCorrect_t) 0x639a0;
static ItemRenderer_renderGuiItemCorrect_t ItemRenderer_renderGuiItemCorrect = (ItemRenderer_renderGuiItemCorrect_t) 0x7f260;
// Tesselator
typedef void (*Tesselator_begin_t)(unsigned char *tesselator, int32_t mode);
static Tesselator_begin_t Tesselator_begin = (Tesselator_begin_t) 0x529d4;
typedef void (*Tesselator_begin_t)(unsigned char *tesselator);
static Tesselator_begin_t Tesselator_begin = (Tesselator_begin_t) 0x6b6f4;
typedef void (*Tesselator_colorABGR_t)(unsigned char *tesselator, int32_t color);
static Tesselator_colorABGR_t Tesselator_colorABGR = (Tesselator_colorABGR_t) 0x52b54;
static Tesselator_colorABGR_t Tesselator_colorABGR = (Tesselator_colorABGR_t) 0x6b878;
typedef void (*Tesselator_color_t)(unsigned char *tesselator, int32_t r, int32_t g, int32_t b, int32_t a);
static Tesselator_color_t Tesselator_color = (Tesselator_color_t) 0x52a48;
static Tesselator_color_t Tesselator_color = (Tesselator_color_t) 0x6b764;
// SoundEngine
typedef void (*SoundEngine_init_t)(unsigned char *sound_engine, unsigned char *minecraft, unsigned char *options);
static SoundEngine_init_t SoundEngine_init = (SoundEngine_init_t) 0x67760;
static SoundEngine_init_t SoundEngine_init = (SoundEngine_init_t) 0x835a4;
typedef void (*SoundEngine_enable_t)(unsigned char *sound_engine, bool state);
static SoundEngine_enable_t SoundEngine_enable = (SoundEngine_enable_t) 0x6776c;
static SoundEngine_enable_t SoundEngine_enable = (SoundEngine_enable_t) 0x835b0;
typedef void (*SoundEngine_update_t)(unsigned char *sound_engine, unsigned char *listener_mob, float listener_angle);
static SoundEngine_update_t SoundEngine_update = (SoundEngine_update_t) 0x67778;
static SoundEngine_update_t SoundEngine_update = (SoundEngine_update_t) 0x835bc;
static uint32_t SoundEngine_minecraft_property_offset = 0xa08; // Minecraft *
static uint32_t SoundEngine_options_property_offset = 0x4; // Options *
@ -624,15 +575,15 @@ static uint32_t Tile_setDescriptionId_vtable_offset = 0xe0;
// AppPlatform
typedef void (*AppPlatform_saveScreenshot_t)(unsigned char *app_platform, std::string const& path, int32_t width, int32_t height);
static void *AppPlatform_linux_saveScreenshot_vtable_addr = (void *) 0x102160;
static void *AppPlatform_linux_saveScreenshot_vtable_addr = (void *) 0x163b70;
typedef AppPlatform_readAssetFile_return_value (*AppPlatform_readAssetFile_t)(unsigned char *app_platform, std::string const& path);
static AppPlatform_readAssetFile_t AppPlatform_readAssetFile = (AppPlatform_readAssetFile_t) 0x12b10;
static AppPlatform_readAssetFile_t AppPlatform_readAssetFile = (AppPlatform_readAssetFile_t) 0x12564;
// Minecraft
typedef void (*Minecraft_selectLevel_t)(unsigned char *minecraft, std::string const& level_dir, std::string const& level_name, LevelSettings const& vsettings);
static Minecraft_selectLevel_t Minecraft_selectLevel = (Minecraft_selectLevel_t) 0x16f38;
static Minecraft_selectLevel_t Minecraft_selectLevel = (Minecraft_selectLevel_t) 0x178fc;
// ExternalFileLevelStorageSource
@ -642,51 +593,44 @@ static uint32_t ExternalFileLevelStorageSource_deleteLevel_vtable_offset = 0x20;
// CommandServer
typedef std::string (*CommandServer_parse_t)(unsigned char *command_server, struct ConnectedClient &client, std::string const& command);
static CommandServer_parse_t CommandServer_parse = (CommandServer_parse_t) 0x6aa8c;
static CommandServer_parse_t CommandServer_parse = (CommandServer_parse_t) 0x8b524;
// Level
typedef void (*Level_addParticle_t)(unsigned char *level, std::string const& particle, float x, float y, float z, float deltaX, float deltaY, float deltaZ, int count);
static Level_addParticle_t Level_addParticle = (Level_addParticle_t) 0xa449c;
static Level_addParticle_t Level_addParticle = (Level_addParticle_t) 0xf07b8;
// Gui
typedef void (*Gui_addMessage_t)(unsigned char *gui, std::string const& text);
static Gui_addMessage_t Gui_addMessage = (Gui_addMessage_t) 0x27820;
static Gui_addMessage_t Gui_addMessage = (Gui_addMessage_t) 0x2cec0;
// ServerSideNetworkHandler
typedef void (*ServerSideNetworkHandler_displayGameMessage_t)(unsigned char *server_side_network_handler, std::string const& message);
static ServerSideNetworkHandler_displayGameMessage_t ServerSideNetworkHandler_displayGameMessage = (ServerSideNetworkHandler_displayGameMessage_t) 0x750c4;
// SimpleChooseLevelScreen
#define SIMPLE_LEVEL_CHOOSE_SCREEN_SIZE 0x68
typedef unsigned char *(*SimpleChooseLevelScreen_t)(unsigned char *simple_choose_level_screen, std::string const& world_name);
static SimpleChooseLevelScreen_t SimpleChooseLevelScreen = (SimpleChooseLevelScreen_t) 0x31404;
static ServerSideNetworkHandler_displayGameMessage_t ServerSideNetworkHandler_displayGameMessage = (ServerSideNetworkHandler_displayGameMessage_t) 0x99ad4;
// SelectWorldScreen
typedef std::string (*SelectWorldScreen_getUniqueLevelName_t)(unsigned char *screen, std::string const& name);
static SelectWorldScreen_getUniqueLevelName_t SelectWorldScreen_getUniqueLevelName = (SelectWorldScreen_getUniqueLevelName_t) 0x388ec;
static SelectWorldScreen_getUniqueLevelName_t SelectWorldScreen_getUniqueLevelName = (SelectWorldScreen_getUniqueLevelName_t) 0x459fc;
// Touch::SelectWorldScreen
static SelectWorldScreen_getUniqueLevelName_t Touch_SelectWorldScreen_getUniqueLevelName = (SelectWorldScreen_getUniqueLevelName_t) 0x3d82c;
static SelectWorldScreen_getUniqueLevelName_t Touch_SelectWorldScreen_getUniqueLevelName = (SelectWorldScreen_getUniqueLevelName_t) 0x50b04;
// SoundEngine
typedef void (*SoundEngine_playUI_t)(unsigned char *sound_engine, std::string const& name, float pitch, float volume);
static SoundEngine_playUI_t SoundEngine_playUI = (SoundEngine_playUI_t) 0x67864;
static SoundEngine_playUI_t SoundEngine_playUI = (SoundEngine_playUI_t) 0x836a4;
typedef void (*SoundEngine_play_t)(unsigned char *sound_engine, std::string const& name, float x, float y, float z, float pitch, float volume);
static SoundEngine_play_t SoundEngine_play = (SoundEngine_play_t) 0x67860;
static SoundEngine_play_t SoundEngine_play = (SoundEngine_play_t) 0x836a0;
// Common
typedef std::string (*Common_getGameVersionString_t)(std::string const& version_suffix);
static Common_getGameVersionString_t Common_getGameVersionString = (Common_getGameVersionString_t) 0x15068;
static Common_getGameVersionString_t Common_getGameVersionString = (Common_getGameVersionString_t) 0x1523c;
#endif