diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index f1587efe..c4d24c43 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -20,7 +20,7 @@ jobs: - ARMHF name: Build runs-on: ubuntu-latest - container: node:lts-bullseye + container: node:lts-bullseye # Minimum Supported OS steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -53,7 +53,6 @@ jobs: - ARMHF name: Test runs-on: ${{ startsWith(matrix.arch, 'ARM') && 'raspberry-pi' || 'ubuntu-latest' }} - container: node:lts-bullseye steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -76,7 +75,6 @@ jobs: needs: build name: Build Example Mods runs-on: ubuntu-latest - container: node:lts-bullseye steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -84,7 +82,7 @@ jobs: submodules: false # Dependencies - name: Install Dependencies - run: ./scripts/install-dependencies.mjs sdk amd64 + run: ./scripts/install-dependencies.mjs sdk host # SDK - name: Download SDK uses: actions/download-artifact@v3 diff --git a/dependencies/symbol-processor/src b/dependencies/symbol-processor/src index 16ab0983..01a64f32 160000 --- a/dependencies/symbol-processor/src +++ b/dependencies/symbol-processor/src @@ -1 +1 @@ -Subproject commit 16ab0983a7a56880cfbe2c0339ed22a04f7ec69f +Subproject commit 01a64f321d5f98a59d1432f659b8a9e11d3d60c6 diff --git a/libreborn/include/libreborn/patch.h b/libreborn/include/libreborn/patch.h index 0227f848..6c9e0f71 100644 --- a/libreborn/include/libreborn/patch.h +++ b/libreborn/include/libreborn/patch.h @@ -21,7 +21,7 @@ void overwrite_call(void *addr, __attribute__((unused)) T *target_type, typename void *overwrite_calls_manual(void *target, void *replacement, bool allow_no_callsites = false); template void overwrite_calls(T *target, typename T::overwrite_type replacement) { - DEBUG("Overwriting Method: %s", target->name.c_str()); + DEBUG("Overwriting Method: %s", target->name); if (!target->overwrite(replacement)) { ERR("Unable To Overwrite Method! Use patch_vtable() Instead!"); } @@ -50,7 +50,7 @@ void patch_address(void *addr, void *target); // IMPORTANT NOTE: This does not affect subclasses. template void patch_vtable(const T *target, typename T::ptr_type replacement) { - DEBUG("Patching VTable: %s", target->name.c_str()); + DEBUG("Patching VTable: %s", target->name); if (target->enabled) { WARN("Use overwrite_calls() Instead!"); } diff --git a/mods/src/chat/chat.cpp b/mods/src/chat/chat.cpp index 6bb42dfc..3b0168c4 100644 --- a/mods/src/chat/chat.cpp +++ b/mods/src/chat/chat.cpp @@ -13,7 +13,7 @@ std::string chat_send_api_command(const Minecraft *minecraft, const std::string ConnectedClient client; client.sock = -1; client.str = ""; - client.time = 0; + client.lastBlockHitPoll = 0; CommandServer *command_server = minecraft->command_server; if (command_server != nullptr) { return command_server->parse(client, str); diff --git a/mods/src/game-mode/game-mode.cpp b/mods/src/game-mode/game-mode.cpp index d6513d3d..53a1a7b3 100644 --- a/mods/src/game-mode/game-mode.cpp +++ b/mods/src/game-mode/game-mode.cpp @@ -42,7 +42,7 @@ static void Minecraft_setIsCreativeMode_injection(Minecraft_setIsCreativeMode_t } // Disable CreatorMode-Specific API Features (Polling Block Hits) In SurvivalMode, This Is Preferable To Crashing -static unsigned char *Minecraft_getCreator_injection(Minecraft_getCreator_t original, Minecraft *minecraft) { +static ICreator *Minecraft_getCreator_injection(Minecraft_getCreator_t original, Minecraft *minecraft) { if (is_survival) { // SurvivalMode, Return nullptr return nullptr; diff --git a/mods/src/server/server.cpp b/mods/src/server/server.cpp index 2e2f8b17..11401083 100644 --- a/mods/src/server/server.cpp +++ b/mods/src/server/server.cpp @@ -66,7 +66,7 @@ static std::string get_world_name() { // Create/Start World static void start_world(Minecraft *minecraft) { // Get World Name - std::string world_name = get_world_name(); + const std::string world_name = get_world_name(); // Log INFO("Loading World: %s", world_name.c_str()); @@ -133,9 +133,8 @@ static void find_players(Minecraft *minecraft, const std::string &target_usernam Level *level = get_level(minecraft); const std::vector players = get_players_in_level(level); bool found_player = false; - for (std::size_t i = 0; i < players.size(); i++) { + for (Player *player : players) { // Iterate Players - Player *player = players[i]; std::string username = get_player_username(player); if (all_players || username == target_username) { // Run Callback @@ -342,14 +341,14 @@ std::vector *server_get_commands(Minecraft *minecraft, ServerSide .comment = "Print This Message", .callback = [commands](__attribute__((unused)) const std::string &cmd) { INFO("All Commands:"); - int max_lhs_length = 0; - for (ServerCommand command : *commands) { - const int lhs_length = command.get_lhs_help().length(); + std::string::size_type max_lhs_length = 0; + for (const ServerCommand &command : *commands) { + const std::string::size_type lhs_length = command.get_lhs_help().length(); if (lhs_length > max_lhs_length) { max_lhs_length = lhs_length; } } - for (ServerCommand command : *commands) { + for (const ServerCommand &command : *commands) { INFO("%s", command.get_full_help(max_lhs_length).c_str()); } } @@ -368,10 +367,10 @@ static void handle_commands(Minecraft *minecraft) { ServerSideNetworkHandler *server_side_network_handler = get_server_side_network_handler(minecraft); if (server_side_network_handler != nullptr) { // Generate Command List - std::vector *commands = server_get_commands(minecraft, server_side_network_handler); + const std::vector *commands = server_get_commands(minecraft, server_side_network_handler); // Run bool success = false; - for (ServerCommand command : *commands) { + for (const ServerCommand &command : *commands) { const bool valid = command.has_args() ? data.rfind(command.name, 0) == 0 : data == command.name; if (valid) { command.callback(data.substr(command.name.length())); @@ -425,7 +424,7 @@ static bool is_ip_in_blacklist(const char *ip) { std::string line; while (std::getline(blacklist_file, line)) { // Check Line - if (line.length() > 0 && line[0] != '#') { + if (!line.empty() && line[0] != '#') { ips.push_back(line); } } diff --git a/symbols/CMakeLists.txt b/symbols/CMakeLists.txt index 5836429c..0499f157 100644 --- a/symbols/CMakeLists.txt +++ b/symbols/CMakeLists.txt @@ -9,6 +9,11 @@ set(SRC src/game/mode/GameMode.def src/game/mode/CreatorMode.def src/game/mode/SurvivalMode.def + src/game/mode/creator/Creator.def + src/game/mode/creator/EventList_Item.def + src/game/mode/creator/EventList_TileEvent.def + src/game/mode/creator/ICreator.def + src/game/mode/creator/TileEvent.def src/game/NinecraftApp.def src/game/GameRenderer.def src/network/RakNetInstance.def @@ -66,6 +71,7 @@ set(SRC src/entity/ArrowRenderer.def src/entity/PaintingRenderer.def src/entity/Throwable.def + src/entity/Particle.def src/level/container/FillingContainer.def src/level/container/Container.def src/level/container/ContainerMenu.def @@ -137,6 +143,7 @@ set(SRC src/gui/components/GuiComponent.def src/gui/components/Button.def src/gui/Gui.def + src/gui/GuiMessage.def src/gui/components/IntRectangle.def src/gui/components/RectangleArea.def src/gui/components/ScrollingPane.def diff --git a/symbols/src/api/ConnectedClient.def b/symbols/src/api/ConnectedClient.def index b23e6421..5591653f 100644 --- a/symbols/src/api/ConnectedClient.def +++ b/symbols/src/api/ConnectedClient.def @@ -2,6 +2,6 @@ size 0xc; property uint sock = 0x0; property std::string str = 0x4; -property int time = 0x8; +property int lastBlockHitPoll = 0x8; mark-as-simple; \ No newline at end of file diff --git a/symbols/src/entity/Arrow.def b/symbols/src/entity/Arrow.def index c5d4949f..d76a8bfd 100644 --- a/symbols/src/entity/Arrow.def +++ b/symbols/src/entity/Arrow.def @@ -1,3 +1,10 @@ extends Entity; +vtable 0x10db20; + property bool is_critical = 0xd8; +property int hit_x = 0xdc; +property int hit_y = 0xe0; +property int hit_z = 0xe4; +property bool grounded = 0xf0; +property int flight_time = 0xf8; \ No newline at end of file diff --git a/symbols/src/entity/Particle.def b/symbols/src/entity/Particle.def new file mode 100644 index 00000000..a236bf9f --- /dev/null +++ b/symbols/src/entity/Particle.def @@ -0,0 +1,3 @@ +extends Entity; + +vtable 0x105b68; \ No newline at end of file diff --git a/symbols/src/game/Minecraft.def b/symbols/src/game/Minecraft.def index 3ed956ec..32ebc9b5 100644 --- a/symbols/src/game/Minecraft.def +++ b/symbols/src/game/Minecraft.def @@ -12,7 +12,7 @@ method bool isCreativeMode() = 0x17270; method void releaseMouse() = 0x15d30; method void grabMouse() = 0x15d10; method void leaveGame(bool save_remote_level) = 0x15ea0; -method uchar *getCreator() = 0x17538; +method ICreator *getCreator() = 0x17538; method LevelStorageSource *getLevelSource() = 0x16e84; method void handleMouseDown(int param_1, bool can_destroy) = 0x1584c; method void handleBuildAction(uint *build_action_intention) = 0x15920; diff --git a/symbols/src/game/mode/CreatorMode.def b/symbols/src/game/mode/CreatorMode.def index 0d59741a..fbcfacc6 100644 --- a/symbols/src/game/mode/CreatorMode.def +++ b/symbols/src/game/mode/CreatorMode.def @@ -1,5 +1,8 @@ extends GameMode; size 0x1c; +vtable 0x102d00; constructor (Minecraft *minecraft) = 0x1a044; + +property Creator *creator = 0x4; \ No newline at end of file diff --git a/symbols/src/game/mode/creator/Creator.def b/symbols/src/game/mode/creator/Creator.def new file mode 100644 index 00000000..bc820ac3 --- /dev/null +++ b/symbols/src/game/mode/creator/Creator.def @@ -0,0 +1,7 @@ +size 0x20; + +extends ICreator; +vtable 0x1a0dc; + +property EventList_TileEvent tileEvents = 0x4; +property int tick = 0x1c; \ No newline at end of file diff --git a/symbols/src/game/mode/creator/EventList_Item.def b/symbols/src/game/mode/creator/EventList_Item.def new file mode 100644 index 00000000..69039493 --- /dev/null +++ b/symbols/src/game/mode/creator/EventList_Item.def @@ -0,0 +1,6 @@ +size 0x18; + +property int tick = 0x0; +property TileEvent item = 0x4; + +mark-as-simple; \ No newline at end of file diff --git a/symbols/src/game/mode/creator/EventList_TileEvent.def b/symbols/src/game/mode/creator/EventList_TileEvent.def new file mode 100644 index 00000000..eeefd54e --- /dev/null +++ b/symbols/src/game/mode/creator/EventList_TileEvent.def @@ -0,0 +1,8 @@ +size 0x18; + +property int at = 0x0; +property int len = 0x4; +property int cap = 0x8; +property std::vector events = 0xc; + +mark-as-simple; \ No newline at end of file diff --git a/symbols/src/game/mode/creator/ICreator.def b/symbols/src/game/mode/creator/ICreator.def new file mode 100644 index 00000000..3569a1fd --- /dev/null +++ b/symbols/src/game/mode/creator/ICreator.def @@ -0,0 +1,3 @@ +vtable 0x102ca8; + +virtual-method EventList_TileEvent &getTileEvents() = 0x8; \ No newline at end of file diff --git a/symbols/src/game/mode/creator/TileEvent.def b/symbols/src/game/mode/creator/TileEvent.def new file mode 100644 index 00000000..8ff37b87 --- /dev/null +++ b/symbols/src/game/mode/creator/TileEvent.def @@ -0,0 +1,9 @@ +size 0x14; + +property int entityId = 0x0; +property int x = 0x4; +property int y = 0x8; +property int z = 0xc; +property int face = 0x10; + +mark-as-simple; \ No newline at end of file diff --git a/symbols/src/gui/Gui.def b/symbols/src/gui/Gui.def index af94bfd1..9f99dc1b 100644 --- a/symbols/src/gui/Gui.def +++ b/symbols/src/gui/Gui.def @@ -18,6 +18,7 @@ method void renderDebugInfo() = 0x26958; method void renderProgressIndicator(bool is_touch, int width, int height, float a) = 0x26098; method void renderVignette(float param_1, int width, int height) = 0x25b0c; +property std::vector messages = 0x18; property Minecraft *minecraft = 0x9f4; property float selected_item_text_timer = 0x9fc; property int flashing_slot = 0xa2c; diff --git a/symbols/src/gui/GuiMessage.def b/symbols/src/gui/GuiMessage.def new file mode 100644 index 00000000..6ae8886a --- /dev/null +++ b/symbols/src/gui/GuiMessage.def @@ -0,0 +1,6 @@ +size 0x8; + +property std::string message = 0x0; +property int time = 0x4; + +mark-as-simple; \ No newline at end of file diff --git a/symbols/src/misc/HitResult.def b/symbols/src/misc/HitResult.def index 75dfe547..182e8327 100644 --- a/symbols/src/misc/HitResult.def +++ b/symbols/src/misc/HitResult.def @@ -1,5 +1,7 @@ size 0x28; +constructor (Entity *entity) = 0xd3a98; + property int type = 0x0; property int x = 0x4; property int y = 0x8; diff --git a/symbols/src/tile/entity/SignTileEntity.def b/symbols/src/tile/entity/SignTileEntity.def index 069f50ee..9f1311ac 100644 --- a/symbols/src/tile/entity/SignTileEntity.def +++ b/symbols/src/tile/entity/SignTileEntity.def @@ -1,3 +1,5 @@ vtable 0x115d08; extends TileEntity; + +property std::string lines[4] = 0x30; \ No newline at end of file