diff --git a/dependencies/symbol-processor/src b/dependencies/symbol-processor/src index 346d4403df..46c486e56a 160000 --- a/dependencies/symbol-processor/src +++ b/dependencies/symbol-processor/src @@ -1 +1 @@ -Subproject commit 346d4403df854a03e0cce15d26519a8700014615 +Subproject commit 46c486e56a15334ccc4bd52bcc9ab1bfbcb7d27e diff --git a/mods/include/mods/chat/chat.h b/mods/include/mods/chat/chat.h index e9f4437909..e1a6b837b0 100644 --- a/mods/include/mods/chat/chat.h +++ b/mods/include/mods/chat/chat.h @@ -7,7 +7,7 @@ extern "C" { // Send API Command -std::string chat_send_api_command(Minecraft *minecraft, std::string str); +std::string chat_send_api_command(const Minecraft *minecraft, const std::string &str); // Override using the HOOK() macro to provide customized chat behavior. void chat_send_message(ServerSideNetworkHandler *server_side_network_handler, char *username, char *message); diff --git a/mods/src/atlas/atlas.cpp b/mods/src/atlas/atlas.cpp index 0b60a0298f..4a6b0316bf 100644 --- a/mods/src/atlas/atlas.cpp +++ b/mods/src/atlas/atlas.cpp @@ -7,7 +7,7 @@ #include // Fix Grass And Leaves Inventory Rendering When The gui_blocks Atlas Is Disabled -static void ItemRenderer_renderGuiItemCorrect_injection(ItemRenderer_renderGuiItemCorrect_t original, Font *font, Textures *textures, ItemInstance *item_instance, int32_t param_1, int32_t param_2) { +static void ItemRenderer_renderGuiItemCorrect_injection(ItemRenderer_renderGuiItemCorrect_t original, Font *font, Textures *textures, const 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; // Replace Rendered Item With Carried Variant @@ -74,7 +74,7 @@ static void InventoryPane_renderBatch_Tesselator_color_injection(Tesselator *tes // Enable Item Color Fix item_color_fix_mode = 2; } -static void ItemRenderer_renderGuiItem_two_injection(ItemRenderer_renderGuiItem_two_t original, Font *font, Textures *textures, ItemInstance *item_instance, float param_1, float param_2, float param_3, float param_4, bool param_5) { +static void ItemRenderer_renderGuiItem_two_injection(ItemRenderer_renderGuiItem_two_t original, Font *font, Textures *textures, const ItemInstance *item_instance, float param_1, float param_2, float param_3, float param_4, bool param_5) { // Call Original Method original(font, textures, item_instance, param_1, param_2, param_3, param_4, param_5); diff --git a/mods/src/benchmark/benchmark.cpp b/mods/src/benchmark/benchmark.cpp index 274fd50b79..c51878b46d 100644 --- a/mods/src/benchmark/benchmark.cpp +++ b/mods/src/benchmark/benchmark.cpp @@ -34,10 +34,10 @@ static void start_world(Minecraft *minecraft) { // Delete World If It Already Exists LevelStorageSource *level_source = minecraft->getLevelSource(); std::string name = BENCHMARK_WORLD_NAME; - level_source->deleteLevel(&name); + level_source->deleteLevel(name); // Select Level - minecraft->selectLevel(&name, &name, &settings); + minecraft->selectLevel(name, name, settings); // Open ProgressScreen ProgressScreen *screen = new ProgressScreen; diff --git a/mods/src/bucket/bucket.cpp b/mods/src/bucket/bucket.cpp index 6cc61f5e09..4da1658088 100644 --- a/mods/src/bucket/bucket.cpp +++ b/mods/src/bucket/bucket.cpp @@ -10,7 +10,7 @@ static FoodItem *bucket = nullptr; // Description And Texture -static std::string BucketItem_getDescriptionId(__attribute__((unused)) FoodItem *item, ItemInstance *item_instance) { +static std::string BucketItem_getDescriptionId(__attribute__((unused)) FoodItem *item, const ItemInstance *item_instance) { if (item_instance->auxiliary == Tile::water->id) { return "item.bucketWater"; } else if (item_instance->auxiliary == Tile::lava->id) { @@ -195,8 +195,8 @@ static FoodItem *create_bucket(int32_t id, int32_t texture_x, int32_t texture_y, // Setup item->setIcon(texture_x, texture_y); - item->setDescriptionId(&name); - item->is_stacked_by_data = 1; + item->setDescriptionId(name); + item->is_stacked_by_data = true; item->category = 2; item->max_damage = 0; item->max_stack_size = 1; @@ -249,9 +249,9 @@ static void Inventory_setupDefault_FillingContainer_addItem_call_injection(Filli // Make Liquids Selectable static bool is_holding_bucket = false; -static HitResult Mob_pick_Level_clip_injection(Level *level, unsigned char *param_1, unsigned char *param_2, __attribute__((unused)) bool clip_liquids, bool param_3) { +static HitResult Mob_pick_Level_clip_injection(Level *level, const Vec3 ¶m_1, const Vec3 ¶m_2, __attribute__((unused)) bool clip_liquids, bool clip_hitboxes) { // Call Original Method - return level->clip(param_1, param_2, is_holding_bucket, param_3); + return level->clip(param_1, param_2, is_holding_bucket, clip_hitboxes); } static void handle_tick(Minecraft *minecraft) { LocalPlayer *player = minecraft->player; @@ -315,12 +315,12 @@ static void Recipes_injection(Recipes *recipes) { std::string line1 = "# #"; std::string line2 = " # "; std::vector types = {type1}; - recipes->addShapedRecipe_2(&result, &line1, &line2, &types); + recipes->addShapedRecipe_2(result, line1, line2, types); } // Custom Furnace Fuel -static int32_t FurnaceTileEntity_getBurnDuration_injection(FurnaceTileEntity_getBurnDuration_t original, ItemInstance *item_instance) { - if (item_instance->count > 0 && item_instance->id == bucket->id && item_instance->auxiliary == Tile::lava->id) { +static int32_t FurnaceTileEntity_getBurnDuration_injection(FurnaceTileEntity_getBurnDuration_t original, const ItemInstance &item_instance) { + if (item_instance.count > 0 && item_instance.id == bucket->id && item_instance.auxiliary == Tile::lava->id) { return 20000; } else { // Call Original Method diff --git a/mods/src/cake/cake.cpp b/mods/src/cake/cake.cpp index f22888ec34..ea7128fdf9 100644 --- a/mods/src/cake/cake.cpp +++ b/mods/src/cake/cake.cpp @@ -150,7 +150,7 @@ static void make_cake() { cake->setExplodeable(20.0f); cake->category = 4; std::string name = "Cake"; - cake->setDescriptionId(&name); + cake->setDescriptionId(name); } static void Tile_initTiles_injection() { @@ -223,8 +223,8 @@ static void Recipes_injection(Recipes *recipes) { std::string line1 = "mmm"; std::string line2 = "ses"; std::string line3 = "www"; - std::vector ingredients = {milk, sugar, wheat, eggs}; - recipes->addShapedRecipe_3(&cake_item, &line1, &line2, &line3, &ingredients); + std::vector ingredients = {milk, sugar, wheat, eggs}; + recipes->addShapedRecipe_3(cake_item, line1, line2, line3, ingredients); } void init_cake() { diff --git a/mods/src/camera/camera.cpp b/mods/src/camera/camera.cpp index 7c41c5f103..211a052ed1 100644 --- a/mods/src/camera/camera.cpp +++ b/mods/src/camera/camera.cpp @@ -6,7 +6,7 @@ #include // Take Screenshot Using TripodCamera -static void AppPlatform_saveScreenshot_injection(__attribute__((unused)) AppPlatform_saveScreenshot_t original, __attribute__((unused)) AppPlatform *app_platform, __attribute__((unused)) std::string *path, __attribute__((unused)) int32_t width, __attribute__((unused)) int32_t height) { +static void AppPlatform_saveScreenshot_injection(__attribute__((unused)) AppPlatform_saveScreenshot_t original, __attribute__((unused)) AppPlatform *app_platform, __attribute__((unused)) const std::string &path, __attribute__((unused)) int32_t width, __attribute__((unused)) int32_t height) { screenshot_take(nullptr); } @@ -25,7 +25,7 @@ static EntityRenderDispatcher *EntityRenderDispatcher_injection(EntityRenderDisp } // Display Smoke From TripodCamera Higher -static void TripodCamera_tick_Level_addParticle_call_injection(Level *level, std::string *particle, float x, float y, float z, float deltaX, float deltaY, float deltaZ, int count) { +static void TripodCamera_tick_Level_addParticle_call_injection(Level *level, const std::string &particle, float x, float y, float z, float deltaX, float deltaY, float deltaZ, int count) { // Call Original Method level->addParticle(particle, x, y + 0.5, z, deltaX, deltaY, deltaZ, count); } diff --git a/mods/src/chat/chat.cpp b/mods/src/chat/chat.cpp index fa549fe7eb..1def731108 100644 --- a/mods/src/chat/chat.cpp +++ b/mods/src/chat/chat.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include #include @@ -12,14 +11,14 @@ #include // Send API Command -std::string chat_send_api_command(Minecraft *minecraft, std::string str) { +std::string chat_send_api_command(const Minecraft *minecraft, const std::string &str) { ConnectedClient client; client.sock = -1; client.str = ""; client.time = 0; CommandServer *command_server = minecraft->command_server; if (command_server != nullptr) { - return command_server->parse(&client, &str); + return command_server->parse(client, str); } else { return ""; } @@ -42,7 +41,7 @@ void chat_send_message(ServerSideNetworkHandler *server_side_network_handler, ch sanitize_string(raw_str, MAX_CHAT_MESSAGE_LENGTH, 0); full_message = raw_str; free(raw_str); - server_side_network_handler->displayGameMessage(&full_message); + server_side_network_handler->displayGameMessage(full_message); } // Handle Chat packet Send void chat_handle_packet_send(Minecraft *minecraft, ChatPacket *packet) { @@ -54,7 +53,7 @@ void chat_handle_packet_send(Minecraft *minecraft, ChatPacket *packet) { chat_send_message(server_side_network_handler, Strings::default_username, (char *) message); } else { // Client - rak_net_instance->send((Packet *) packet); + rak_net_instance->send(*(Packet *) packet); } } @@ -67,7 +66,7 @@ static void CommandServer_parse_CommandServer_dispatchPacket_injection(CommandSe } // Handle ChatPacket Server-Side -static void ServerSideNetworkHandler_handle_ChatPacket_injection(ServerSideNetworkHandler *server_side_network_handler, RakNet_RakNetGUID *rak_net_guid, ChatPacket *chat_packet) { +static void ServerSideNetworkHandler_handle_ChatPacket_injection(ServerSideNetworkHandler *server_side_network_handler, const RakNet_RakNetGUID &rak_net_guid, ChatPacket *chat_packet) { Player *player = server_side_network_handler->getPlayer(rak_net_guid); if (player != nullptr) { const char *username = player->username.c_str(); diff --git a/mods/src/death/death.cpp b/mods/src/death/death.cpp index ed14bbf324..40b236f63d 100644 --- a/mods/src/death/death.cpp +++ b/mods/src/death/death.cpp @@ -84,7 +84,7 @@ static void Player_die_injection(std::function ori // Post Death Message ServerSideNetworkHandler *server_side_network_handler = (ServerSideNetworkHandler *) player->minecraft->network_handler; - server_side_network_handler->displayGameMessage(&message); + server_side_network_handler->displayGameMessage(message); } } template @@ -112,7 +112,7 @@ static void Player_actuallyHurt_injection(Self *player, int32_t damage) { // Post Death Message ServerSideNetworkHandler *server_side_network_handler = (ServerSideNetworkHandler *) player->minecraft->network_handler; - server_side_network_handler->displayGameMessage(&message); + server_side_network_handler->displayGameMessage(message); } } } diff --git a/mods/src/f3/f3.cpp b/mods/src/f3/f3.cpp index 9ac3fe9d1c..1b8d9b26fc 100644 --- a/mods/src/f3/f3.cpp +++ b/mods/src/f3/f3.cpp @@ -31,7 +31,7 @@ static std::vector get_debug_info(const Minecraft *minecraft) { float x = minecraft->player->x; float y = minecraft->player->y - minecraft->player->height_offset; float z = minecraft->player->z; - minecraft->command_server->pos_translator.to(&x, &y, &z); + minecraft->command_server->pos_translator.to(x, y, z); info.push_back("X: " + to_string_with_precision(x, debug_precision)); info.push_back("Y: " + to_string_with_precision(y, debug_precision)); info.push_back("Z: " + to_string_with_precision(z, debug_precision)); @@ -47,13 +47,13 @@ static int debug_background_padding = 1; static int line_height = 8; static void render_debug_line(Gui *gui, std::string &line, const int x, const int y) { // Draw Background - int width = gui->minecraft->font->width(&line); + int width = gui->minecraft->font->width(line); if (width == 0) { return; } gui->fill(x - debug_background_padding, y - debug_background_padding, x + width + debug_background_padding, y + line_height, debug_background_color); // Draw Text - gui->minecraft->font->draw(&line, float(x), float(y), debug_text_color); + gui->minecraft->font->draw(line, float(x), float(y), debug_text_color); } // Draw Debug Information static bool debug_info_shown = false; diff --git a/mods/src/game-mode/ui.cpp b/mods/src/game-mode/ui.cpp index 6ed1bcbe88..e886ff9931 100644 --- a/mods/src/game-mode/ui.cpp +++ b/mods/src/game-mode/ui.cpp @@ -86,12 +86,12 @@ CUSTOM_VTABLE(create_world_screen, Screen) { original_render(super, x, y, param_1); // Title std::string title = "Create world"; - super->drawCenteredString(super->font, &title, super->width / 2, title_padding, 0xffffffff); + super->drawCenteredString(super->font, title, super->width / 2, title_padding, 0xffffffff); // Game Mode Description CreateWorldScreen *self = (CreateWorldScreen *) super; bool is_creative = self->game_mode->text == CREATIVE_STR; std::string description = is_creative ? Strings::creative_mode_description : Strings::survival_mode_description; - super->drawString(super->font, &description, self->game_mode->x, self->game_mode->y + self->game_mode->height + description_padding, 0xa0a0a0); + super->drawString(super->font, description, self->game_mode->x, self->game_mode->y + self->game_mode->height + description_padding, 0xa0a0a0); }; // Positioning static Screen_setupPositions_t original_setupPositions = vtable->setupPositions; @@ -164,7 +164,7 @@ static Screen *create_create_world_screen() { static std::string getUniqueLevelName(LevelStorageSource *source, const std::string &in) { std::set maps; std::vector vls; - source->getLevelList(&vls); + source->getLevelList(vls); for (int i = 0; i < int(vls.size()); i++) { const LevelSummary &ls = vls[i]; maps.insert(ls.folder); @@ -179,13 +179,13 @@ static std::string getUniqueLevelName(LevelStorageSource *source, const std::str // Create World int get_seed_from_string(std::string str) { int seed; - str = Util::stringTrim(&str); + str = Util::stringTrim(str); if (!str.empty()) { int num; if (sscanf(str.c_str(), "%d", &num) > 0) { seed = num; } else { - seed = Util::hashCode(&str); + seed = Util::hashCode(str); } } else { seed = Common::getEpochTimeS(); @@ -197,7 +197,7 @@ static void create_world(Minecraft *minecraft, std::string name, bool is_creativ int seed = get_seed_from_string(std::move(seed_str)); // Get Folder Name - name = Util::stringTrim(&name); + name = Util::stringTrim(name); std::string folder = ""; for (char c : name) { if ( @@ -227,7 +227,7 @@ static void create_world(Minecraft *minecraft, std::string name, bool is_creativ settings.seed = seed; // Create World - minecraft->selectLevel(&folder, &name, &settings); + minecraft->selectLevel(folder, name, settings); // Multiplayer minecraft->hostMultiplayer(19132); diff --git a/mods/src/misc/api.cpp b/mods/src/misc/api.cpp index 062f9c3150..aab11c444e 100644 --- a/mods/src/misc/api.cpp +++ b/mods/src/misc/api.cpp @@ -114,8 +114,7 @@ void misc_run_on_key_press(const std::function &func) { void misc_render_background(int color, Minecraft *minecraft, int x, int y, int width, int height) { // https://github.com/ReMinecraftPE/mcpe/blob/f0d65eaecec1b3fe9c2f2b251e114a890c54ab77/source/client/gui/components/RolledSelectionList.cpp#L169-L179 glColor4f(1, 1, 1, 1); - std::string texture = "gui/background.png"; - minecraft->textures->loadAndBindTexture(&texture); + minecraft->textures->loadAndBindTexture("gui/background.png"); Tesselator *t = &Tesselator::instance; t->begin(7); t->color(color, color, color, 255); diff --git a/mods/src/misc/logging.cpp b/mods/src/misc/logging.cpp index b70677f297..970dda930f 100644 --- a/mods/src/misc/logging.cpp +++ b/mods/src/misc/logging.cpp @@ -8,9 +8,9 @@ // Print Chat To Log static bool Gui_addMessage_recursing = false; -static void Gui_addMessage_injection(Gui_addMessage_t original, Gui *gui, std::string *text) { +static void Gui_addMessage_injection(Gui_addMessage_t original, Gui *gui, const std::string &text) { // Sanitize Message - char *new_message = strdup(text->c_str()); + char *new_message = strdup(text.c_str()); ALLOC_CHECK(new_message); sanitize_string(new_message, -1, 1); std::string cpp_str = new_message; @@ -26,13 +26,13 @@ static void Gui_addMessage_injection(Gui_addMessage_t original, Gui *gui, std::s free(safe_message); // Call Original Method - original(gui, &cpp_str); + original(gui, cpp_str); // End Recursing Gui_addMessage_recursing = false; } else { // Call Original Method - original(gui, &cpp_str); + original(gui, cpp_str); } // Free diff --git a/mods/src/misc/misc.cpp b/mods/src/misc/misc.cpp index 601551b596..8d2c9971ab 100644 --- a/mods/src/misc/misc.cpp +++ b/mods/src/misc/misc.cpp @@ -286,7 +286,7 @@ static void LocalPlayer_die_injection(LocalPlayer_die_t original, LocalPlayer *e } // Fix Furnace Not Checking Item Auxiliary When Inserting New Item -static int32_t FurnaceScreen_handleAddItem_injection(FurnaceScreen_handleAddItem_t original, FurnaceScreen *furnace_screen, int32_t slot, ItemInstance *item) { +static int32_t FurnaceScreen_handleAddItem_injection(FurnaceScreen_handleAddItem_t original, FurnaceScreen *furnace_screen, int32_t slot, const ItemInstance *item) { // Get Existing Item FurnaceTileEntity *tile_entity = furnace_screen->tile_entity; ItemInstance *existing_item = tile_entity->getItem(slot); @@ -611,9 +611,9 @@ static void Dimension_updateLightRamp_injection(__attribute__((unused)) Dimensio } // Read Asset File -static AppPlatform_readAssetFile_return_value AppPlatform_readAssetFile_injection(__attribute__((unused)) AppPlatform_readAssetFile_t original, __attribute__((unused)) AppPlatform *app_platform, std::string *path) { +static AppPlatform_readAssetFile_return_value AppPlatform_readAssetFile_injection(__attribute__((unused)) AppPlatform_readAssetFile_t original, __attribute__((unused)) AppPlatform *app_platform, const std::string &path) { // Open File - std::ifstream stream("data/" + *path, std::ios_base::binary | std::ios_base::ate); + std::ifstream stream("data/" + path, std::ios_base::binary | std::ios_base::ate); if (!stream) { // Does Not Exist AppPlatform_readAssetFile_return_value ret; @@ -899,7 +899,7 @@ void init_misc() { // Replace Block Highlight With Outline if (feature_has("Replace Block Highlight With Outline", server_disabled)) { - overwrite_calls(LevelRenderer_renderHitSelect, [](__attribute__((unused)) LevelRenderer_renderHitSelect_t original, LevelRenderer *self, Player *player, HitResult *hit_result, int i, void *vp, float f) { + overwrite_calls(LevelRenderer_renderHitSelect, [](__attribute__((unused)) LevelRenderer_renderHitSelect_t original, LevelRenderer *self, Player *player, const HitResult &hit_result, int i, void *vp, float f) { self->renderHitOutline(player, hit_result, i, vp, f); }); unsigned char fix_outline_patch[4] = {0x00, 0xf0, 0x20, 0xe3}; // "nop" @@ -983,7 +983,7 @@ void init_misc() { if (reborn_is_headless()) { overwrite_calls(GameRenderer_render, nop); overwrite_calls(NinecraftApp_initGLStates, nop); - overwrite_calls(Gui_onConfigChanged, nop); + overwrite_calls(Gui_onConfigChanged, nop); overwrite_calls(LevelRenderer_generateSky, nop); } } diff --git a/mods/src/options/info.cpp b/mods/src/options/info.cpp index b6ee17a6c8..5148c7ee6f 100644 --- a/mods/src/options/info.cpp +++ b/mods/src/options/info.cpp @@ -101,7 +101,7 @@ static void position_info(Font *font, int width, int height) { int info_text_width = 0; for (int i = 0; i < info_size; i++) { std::string text = info[i].get_text(); - int text_width = font->width(&text); + int text_width = font->width(text); if (text_width > info_text_width) { info_text_width = text_width; } @@ -127,7 +127,7 @@ static void position_info(Font *font, int width, int height) { // Third Stage (Find Line Button Width) line_button_width = 0; for (int i = 0; i < info_size; i++) { - int text_width = font->width(&info[i].button_text); + int text_width = font->width(info[i].button_text); if (text_width > line_button_width) { line_button_width = text_width; } @@ -205,11 +205,11 @@ CUSTOM_VTABLE(info_screen, Screen) { original_render(self, x, y, param_1); // Title std::string title = "Reborn Information"; - self->drawCenteredString(self->font, &title, self->width / 2, title_padding, 0xffffffff); + self->drawCenteredString(self->font, title, self->width / 2, title_padding, 0xffffffff); // Info Text for (int i = 0; i < info_size; i++) { std::string text = info[i].get_text(); - self->drawString(self->font, &text, positioned_info[i].text.x, positioned_info[i].text.y, 0xffffffff); + self->drawString(self->font, text, positioned_info[i].text.x, positioned_info[i].text.y, 0xffffffff); } }; // Positioning diff --git a/mods/src/options/ui.cpp b/mods/src/options/ui.cpp index 3da803a279..24c4538adb 100644 --- a/mods/src/options/ui.cpp +++ b/mods/src/options/ui.cpp @@ -100,7 +100,7 @@ static void OptionsScreen_init_injection(OptionsScreen_init_t original, OptionsS Touch_TButton *button = new Touch_TButton; ALLOC_CHECK(button); std::string name = "Reborn"; - button->constructor(INFO_BUTTON_ID, &name); + button->constructor(INFO_BUTTON_ID, name); self->rendered_buttons.push_back((Button *) button); self->selectable_buttons.push_back((Button *) button); } diff --git a/mods/src/screenshot/screenshot.cpp b/mods/src/screenshot/screenshot.cpp index fddb59759d..439b6f42ae 100644 --- a/mods/src/screenshot/screenshot.cpp +++ b/mods/src/screenshot/screenshot.cpp @@ -95,7 +95,7 @@ void screenshot_take(Gui *gui) { if (gui) { std::string chat_msg = "Saved screenshot as "; chat_msg += filename; - gui->addMessage(&chat_msg); + gui->addMessage(chat_msg); } } diff --git a/mods/src/server/server.cpp b/mods/src/server/server.cpp index 2b20313dab..45de3eef3b 100644 --- a/mods/src/server/server.cpp +++ b/mods/src/server/server.cpp @@ -77,7 +77,7 @@ static void start_world(Minecraft *minecraft) { settings.seed = seed; // Select Level - minecraft->selectLevel(&world_name, &world_name, &settings); + minecraft->selectLevel(world_name, world_name, settings); // Don't Open Port When Using --only-generate if (!only_generate) { @@ -304,7 +304,7 @@ static void handle_commands(Minecraft *minecraft) { char *safe_message = to_cp437(message.c_str()); std::string cpp_string = safe_message; // Post Message To Chat - server_side_network_handler->displayGameMessage(&cpp_string); + server_side_network_handler->displayGameMessage(cpp_string); // Free free(safe_message); } else if (data == list_command) { @@ -409,7 +409,7 @@ static bool RakNet_RakPeer_IsBanned_injection(__attribute__((unused)) RakNet_Rak } // Log IPs -static Player *ServerSideNetworkHandler_onReady_ClientGeneration_ServerSideNetworkHandler_popPendingPlayer_injection(ServerSideNetworkHandler *server_side_network_handler, RakNet_RakNetGUID *guid) { +static Player *ServerSideNetworkHandler_onReady_ClientGeneration_ServerSideNetworkHandler_popPendingPlayer_injection(ServerSideNetworkHandler *server_side_network_handler, const RakNet_RakNetGUID &guid) { // Call Original Method Player *player = server_side_network_handler->popPendingPlayer(guid); @@ -419,7 +419,7 @@ static Player *ServerSideNetworkHandler_onReady_ClientGeneration_ServerSideNetwo std::string *username = &player->username; Minecraft *minecraft = server_side_network_handler->minecraft; RakNet_RakPeer *rak_peer = get_rak_peer(minecraft); - char *ip = get_rak_net_guid_ip(rak_peer, *guid); + char *ip = get_rak_net_guid_ip(rak_peer, guid); // Log INFO("%s Has Joined (IP: %s)", username->c_str(), ip); diff --git a/mods/src/skin/loader.cpp b/mods/src/skin/loader.cpp index aa50ee8705..ff999c064d 100644 --- a/mods/src/skin/loader.cpp +++ b/mods/src/skin/loader.cpp @@ -114,14 +114,14 @@ static void *loader_thread(void *user_data) { } // Intercept Texture Creation -static int32_t Textures_assignTexture_injection(Textures_assignTexture_t original, Textures *textures, std::string *name, unsigned char *data) { +static int32_t Textures_assignTexture_injection(Textures_assignTexture_t original, Textures *textures, const std::string &name, unsigned char *data) { // Call Original Method int32_t id = original(textures, name, data); // Load Skin - if (starts_with(name->c_str(), "$")) { + if (starts_with(name.c_str(), "$")) { loader_data *user_data = new loader_data; - user_data->name = name->substr(1); + user_data->name = name.substr(1); DEBUG("Loading Skin: %s", user_data->name.c_str()); user_data->texture_id = id; // Start Thread diff --git a/mods/src/skin/skin.cpp b/mods/src/skin/skin.cpp index f86904df69..759e0ceb04 100644 --- a/mods/src/skin/skin.cpp +++ b/mods/src/skin/skin.cpp @@ -6,7 +6,7 @@ #include "skin-internal.h" // Base64 Encode (https://gist.github.com/tomykaira/f0fd86b6c73063283afe550bc5d77594) -static std::string base64_encode(const std::string data) { +static std::string base64_encode(const std::string &data) { static constexpr char encoding_table[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', @@ -22,7 +22,7 @@ static std::string base64_encode(const std::string data) { size_t out_len = 4 * ((in_len + 2) / 3); std::string ret(out_len, '\0'); size_t i; - char *p = const_cast(ret.c_str()); + char *p = const_cast(ret.c_str()); for (i = 0; i < in_len - 2; i += 3) { *p++ = encoding_table[(data[i] >> 2) & 0x3f]; @@ -74,7 +74,7 @@ static int32_t Textures_loadAndBindTexture_injection(Textures *textures, __attri } // Call Original Method - return textures->loadAndBindTexture(&new_texture); + return textures->loadAndBindTexture(new_texture); } // Init diff --git a/mods/src/sound/repository.cpp b/mods/src/sound/repository.cpp index 7ce6fe564a..8383a656f2 100644 --- a/mods/src/sound/repository.cpp +++ b/mods/src/sound/repository.cpp @@ -353,8 +353,8 @@ __attribute__((constructor)) static void init_rand_seed() { srand(time(nullptr)); } // Pick Sound -std::string _sound_pick(std::string sound) { - if (sound_repository.count(sound) > 0) { +std::string _sound_pick(const std::string &sound) { + if (sound_repository.contains(sound)) { // Sound Exists std::vector &options = sound_repository[sound]; return options[rand() % options.size()]; @@ -367,8 +367,8 @@ std::string _sound_pick(std::string sound) { // Resolve All Sounds void _sound_resolve_all() { - std::string source = _sound_get_source_file(); - if (source.size() > 0) { + const std::string source = _sound_get_source_file(); + if (!source.empty()) { for (auto &it : sound_repository) { for (std::string &name : it.second) { // Zero Volume Prevents An OpenAL Source From Being Allocated While Still Resolving The Sound diff --git a/mods/src/sound/sound-internal.h b/mods/src/sound/sound-internal.h index 66c0f992f0..81dd9f7774 100644 --- a/mods/src/sound/sound-internal.h +++ b/mods/src/sound/sound-internal.h @@ -4,4 +4,4 @@ __attribute__((visibility("internal"))) std::string _sound_get_source_file(); __attribute__((visibility("internal"))) void _sound_resolve_all(); -__attribute__((visibility("internal"))) std::string _sound_pick(std::string sound); +__attribute__((visibility("internal"))) std::string _sound_pick(const std::string &sound); diff --git a/mods/src/sound/sound.cpp b/mods/src/sound/sound.cpp index 45014e5a6b..9d0a7ccecf 100644 --- a/mods/src/sound/sound.cpp +++ b/mods/src/sound/sound.cpp @@ -69,11 +69,11 @@ static void play(std::string name, float x, float y, float z, float volume, floa media_audio_play(source.c_str(), resolved_name.c_str(), x, y, z, pitch, volume, is_ui); } } -static void SoundEngine_playUI_injection(__attribute__((unused)) SoundEngine_playUI_t original, __attribute__((unused)) SoundEngine *sound_engine, std::string *name, float volume, float pitch) { - play(*name, 0, 0, 0, volume, pitch, true); +static void SoundEngine_playUI_injection(__attribute__((unused)) SoundEngine_playUI_t original, __attribute__((unused)) SoundEngine *sound_engine, const std::string &name, float volume, float pitch) { + play(name, 0, 0, 0, volume, pitch, true); } -static void SoundEngine_play_injection(__attribute__((unused)) SoundEngine_play_t original, __attribute__((unused)) SoundEngine *sound_engine, std::string *name, float x, float y, float z, float volume, float pitch) { - play(*name, x, y, z, volume, pitch, false); +static void SoundEngine_play_injection(__attribute__((unused)) SoundEngine_play_t original, __attribute__((unused)) SoundEngine *sound_engine, const std::string &name, float x, float y, float z, float volume, float pitch) { + play(name, x, y, z, volume, pitch, false); } // Refresh Data diff --git a/mods/src/text-input-box/TextInputBox.cpp b/mods/src/text-input-box/TextInputBox.cpp index a13f01be8b..eca3f1df7b 100644 --- a/mods/src/text-input-box/TextInputBox.cpp +++ b/mods/src/text-input-box/TextInputBox.cpp @@ -168,7 +168,7 @@ void TextInputBox::charPressed(int k) { static std::string get_rendered_text(Font *font, int width, int scroll_pos, std::string text) { std::string rendered_text = text.substr(scroll_pos); int max_width = width - (PADDING * 2); - while (font->width(&rendered_text) > max_width) { + while (font->width(rendered_text) > max_width) { rendered_text.pop_back(); } return rendered_text; @@ -195,17 +195,17 @@ void TextInputBox::render() { rendered_text = get_rendered_text(m_pFont, m_width, scroll_pos, rendered_text); int textYPos = (m_height - 8) / 2; - super.drawString(m_pFont, &rendered_text, m_xPos + PADDING, m_yPos + textYPos, text_color); + super.drawString(m_pFont, rendered_text, m_xPos + PADDING, m_yPos + textYPos, text_color); if (m_bCursorOn) { int cursor_pos = m_insertHead - m_scrollPos; if (cursor_pos >= 0 && cursor_pos <= int(rendered_text.length())) { std::string substr = rendered_text.substr(0, cursor_pos); - int xPos = PADDING + m_pFont->width(&substr); + int xPos = PADDING + m_pFont->width(substr); std::string str; str += CURSOR_CHAR; - super.drawString(m_pFont, &str, m_xPos + xPos, m_yPos + textYPos + 2, 0xffffff); + super.drawString(m_pFont, str, m_xPos + xPos, m_yPos + textYPos + 2, 0xffffff); } } } diff --git a/mods/src/textures/headless.cpp b/mods/src/textures/headless.cpp index 8ff4df20e9..e77160a26f 100644 --- a/mods/src/textures/headless.cpp +++ b/mods/src/textures/headless.cpp @@ -4,7 +4,7 @@ #include "textures-internal.h" // Disable Texture Loading -static Texture AppPlatform_linux_loadTexture_injection(__attribute__((unused)) AppPlatform_linux_loadTexture_t original, __attribute__((unused)) AppPlatform_linux *app_platform, __attribute__((unused)) std::string *path, __attribute__((unused)) bool b) { +static Texture AppPlatform_linux_loadTexture_injection(__attribute__((unused)) AppPlatform_linux_loadTexture_t original, __attribute__((unused)) AppPlatform_linux *app_platform, __attribute__((unused)) const std::string &path, __attribute__((unused)) bool b) { Texture out; out.width = 0; out.height = 0; diff --git a/mods/src/textures/lava.cpp b/mods/src/textures/lava.cpp index ab7b2a81f8..5f6bd37755 100644 --- a/mods/src/textures/lava.cpp +++ b/mods/src/textures/lava.cpp @@ -5,7 +5,7 @@ #include "textures-internal.h" -// Lava texture code was originally decompield by @iProgramMC as part of ReMinecraftPE. +// Lava texture code was originally decompiled by @iProgramMC as part of ReMinecraftPE. // See: https://github.com/ReMinecraftPE/mcpe // Structures diff --git a/mods/src/textures/textures.cpp b/mods/src/textures/textures.cpp index d5cbb8d7e4..954cd81a92 100644 --- a/mods/src/textures/textures.cpp +++ b/mods/src/textures/textures.cpp @@ -167,9 +167,9 @@ static void Textures_tick_glTexSubImage2D_injection(GLenum target, GLint level, } // Load Textures -static Texture AppPlatform_linux_loadTexture_injection(__attribute__((unused)) AppPlatform_linux_loadTexture_t original, __attribute__((unused)) AppPlatform_linux *app_platform, std::string *path, bool b) { +static Texture AppPlatform_linux_loadTexture_injection(__attribute__((unused)) AppPlatform_linux_loadTexture_t original, __attribute__((unused)) AppPlatform_linux *app_platform, const std::string &path, bool b) { Texture out; - std::string real_path = *path; + std::string real_path = path; if (b) { real_path = "data/images/" + real_path; } diff --git a/mods/src/title-screen/title-screen.cpp b/mods/src/title-screen/title-screen.cpp index 2a28d6c894..d9dba760b1 100644 --- a/mods/src/title-screen/title-screen.cpp +++ b/mods/src/title-screen/title-screen.cpp @@ -19,7 +19,7 @@ static void StartMenuScreen_render_Screen_renderBackground_injection(Screen *scr Minecraft *minecraft = screen->minecraft; Textures *textures = minecraft->textures; std::string texture = "gui/titleBG.png"; - textures->loadAndBindTexture(&texture); + textures->loadAndBindTexture(texture); screen->blit(0, 0, 0, 0, screen->width, screen->height, 0x100, 0x100); } @@ -101,7 +101,7 @@ static void StartMenuScreen_render_Screen_render_injection(Screen *screen, int x glTranslatef(splash_x, splash_y, 0.0f); glRotatef(-20.0f, 0.0f, 0.0f, 1.0f); // Scale - int textWidth = screen->font->width(¤t_splash); + int textWidth = screen->font->width(current_splash); float timeMS = float(Common::getTimeMs() % 1000) / 1000.0f; float scale = max_scale - Mth::abs(0.1f * Mth::sin(2.0f * float(M_PI) * timeMS)); float real_text_width = textWidth * max_scale; @@ -112,7 +112,7 @@ static void StartMenuScreen_render_Screen_render_injection(Screen *screen, int x glScalef(scale, scale, scale); // Render static int line_height = 8; - screen->drawCenteredString(screen->font, ¤t_splash, 0, -(float(line_height) / 2), 0xffff00); + screen->drawCenteredString(screen->font, current_splash, 0, -(float(line_height) / 2), 0xffff00); // Finish glPopMatrix(); } diff --git a/mods/src/title-screen/welcome.cpp b/mods/src/title-screen/welcome.cpp index 5a9fc12bd2..db43c4b578 100644 --- a/mods/src/title-screen/welcome.cpp +++ b/mods/src/title-screen/welcome.cpp @@ -95,7 +95,7 @@ CUSTOM_VTABLE(welcome_screen, Screen) { // Call Original Method original_render(self, x, y, param_1); // Text - self->drawCenteredString(self->font, &line1, self->width / 2, text_y, 0xFFFFFFFF); + self->drawCenteredString(self->font, line1, self->width / 2, text_y, 0xFFFFFFFF); }; // Positioning vtable->setupPositions = [](Screen *self) { diff --git a/mods/src/touch/touch.cpp b/mods/src/touch/touch.cpp index 47ef6a77f3..85cb681312 100644 --- a/mods/src/touch/touch.cpp +++ b/mods/src/touch/touch.cpp @@ -31,7 +31,7 @@ static int32_t Button_hovered_injection(__attribute__((unused)) Button_hovered_t // Check return x >= button_x1 && x < button_x2 && y >= button_y1 && y < button_y2; } -static void LargeImageButton_render_GuiComponent_drawCenteredString_injection(GuiComponent *component, Font *font, std::string *text, int32_t x, int32_t y, int32_t color) { +static void LargeImageButton_render_GuiComponent_drawCenteredString_injection(GuiComponent *component, Font *font, const std::string &text, int32_t x, int32_t y, int32_t color) { // Change Color On Hover if (color == 0xe0e0e0 && Button_hovered_injection(nullptr, (Button *) component, nullptr, 0, 0)) { color = 0xffffa0; @@ -47,7 +47,7 @@ template static Button *create_button(int id, std::string text) { T *button = new T; ALLOC_CHECK(button); - button->constructor(id, &text); + button->constructor(id, text); return (Button *) button; } Button *touch_create_button(int id, std::string text) { diff --git a/mods/src/version/version.cpp b/mods/src/version/version.cpp index 4acddcddd5..322ddd9918 100644 --- a/mods/src/version/version.cpp +++ b/mods/src/version/version.cpp @@ -16,7 +16,7 @@ const char *version_get() { } // Injection For Touch GUI Version -static std::string Common_getGameVersionString_injection(__attribute__((unused)) Common_getGameVersionString_t original, __attribute__((unused)) std::string *version_suffix) { +static std::string Common_getGameVersionString_injection(__attribute__((unused)) Common_getGameVersionString_t original, __attribute__((unused)) const std::string &version_suffix) { // Set Version return version_get(); } diff --git a/symbols/CMakeLists.txt b/symbols/CMakeLists.txt index 246f78bfee..926003c51c 100644 --- a/symbols/CMakeLists.txt +++ b/symbols/CMakeLists.txt @@ -92,6 +92,7 @@ set(SRC src/level/LevelSummary.def src/level/DistanceChunkSorter.def src/level/renderer/Chunk.def + src/level/LevelStorage.def src/item/ItemRenderer.def src/item/ItemInHandRenderer.def src/item/AuxDataTileItem.def diff --git a/symbols/src/api/CommandServer.def b/symbols/src/api/CommandServer.def index 950e41a8ac..77865a052f 100644 --- a/symbols/src/api/CommandServer.def +++ b/symbols/src/api/CommandServer.def @@ -1,4 +1,4 @@ -method std::string parse(ConnectedClient *client, std::string *command) = 0x6aa8c; +method std::string parse(ConnectedClient &client, const std::string &command) = 0x6aa8c; property Minecraft *minecraft = 0x18; property OffsetPosTranslator pos_translator = 0x1c; diff --git a/symbols/src/api/OffsetPosTranslator.def b/symbols/src/api/OffsetPosTranslator.def index a74e2d95c3..d8033b28d2 100644 --- a/symbols/src/api/OffsetPosTranslator.def +++ b/symbols/src/api/OffsetPosTranslator.def @@ -1,5 +1,5 @@ -method void from(int *x, int *y, int *z) = 0x27c98; -method void to(float *x, float *y, float *z) = 0x27be0; +method void from(int &x, int &y, int &z) = 0x27c98; +method void to(float &x, float &y, float &z) = 0x27be0; property float x = 0x4; property float y = 0x8; diff --git a/symbols/src/app-platform/AppPlatform.def b/symbols/src/app-platform/AppPlatform.def index 3e4bd72d70..1ef9d17b54 100644 --- a/symbols/src/app-platform/AppPlatform.def +++ b/symbols/src/app-platform/AppPlatform.def @@ -1,6 +1,6 @@ vtable 0x1020d8; -virtual-method void saveScreenshot(std::string *path, int width, int height) = 0x8; -virtual-method AppPlatform_readAssetFile_return_value readAssetFile(std::string *path) = 0x34; -virtual-method Texture loadTexture(std::string *path, bool b) = 0xc; +virtual-method void saveScreenshot(const std::string &path, int width, int height) = 0x8; +virtual-method AppPlatform_readAssetFile_return_value readAssetFile(const std::string &path) = 0x34; +virtual-method Texture loadTexture(const std::string &path, bool b) = 0xc; virtual-method std::string getDateString(int time) = 0x24; diff --git a/symbols/src/entity/EntityRenderer.def b/symbols/src/entity/EntityRenderer.def index c02bbab668..79cea4d738 100644 --- a/symbols/src/entity/EntityRenderer.def +++ b/symbols/src/entity/EntityRenderer.def @@ -1,7 +1,7 @@ virtual-method void render(Entity *entity, float param_2, float param_3, float param_4, float param_5, float param_6) = 0x8; // Can be called without an EntityRenderer, just do EntityRenderer_bindTexture(NULL, &file); -method void bindTexture(std::string *file) = 0x62540; +method void bindTexture(const std::string &file) = 0x62540; // Globals static-property EntityRenderDispatcher *entityRenderDispatcher = 0x137bc0; diff --git a/symbols/src/entity/ItemEntity.def b/symbols/src/entity/ItemEntity.def index 733dc3b9fc..82463555b1 100644 --- a/symbols/src/entity/ItemEntity.def +++ b/symbols/src/entity/ItemEntity.def @@ -1,7 +1,7 @@ extends Entity; vtable 0x10c5b0; -constructor (Level *level, float x, float y, float z, ItemInstance *item) = 0x86d70; +constructor (Level *level, float x, float y, float z, const ItemInstance &item) = 0x86d70; property ItemInstance item = 0xd0; property int age = 0xdc; diff --git a/symbols/src/game/Minecraft.def b/symbols/src/game/Minecraft.def index 35229b93be..018a30f137 100644 --- a/symbols/src/game/Minecraft.def +++ b/symbols/src/game/Minecraft.def @@ -16,12 +16,12 @@ method uchar *getCreator() = 0x17538; method LevelStorageSource *getLevelSource() = 0x16e84; method void handleMouseDown(int param_1, bool can_destroy) = 0x1584c; method void handleBuildAction(uint *build_action_intention) = 0x15920; -method void joinMultiplayer(PingedCompatibleServer *server) = 0x165f4; +method void joinMultiplayer(const PingedCompatibleServer &server) = 0x165f4; virtual-method void update() = 0x24; virtual-method int handleBack(bool do_nothing) = 0x34; virtual-method void init() = 0x38; -virtual-method void selectLevel(std::string *level_dir, std::string *level_name, LevelSettings *settings) = 0x40; +virtual-method void selectLevel(const std::string &level_dir, const std::string &level_name, const LevelSettings &settings) = 0x40; property int screen_width = 0x20; property int screen_height = 0x24; diff --git a/symbols/src/gui/Font.def b/symbols/src/gui/Font.def index 663afb6824..09837fe668 100644 --- a/symbols/src/gui/Font.def +++ b/symbols/src/gui/Font.def @@ -1,2 +1,2 @@ -method int width(std::string *string) = 0x24d4c; -method void draw(std::string *string, float x, float y, uint color) = 0x250e0; \ No newline at end of file +method int width(const std::string &string) = 0x24d4c; +method void draw(const std::string &string, float x, float y, uint color) = 0x250e0; \ No newline at end of file diff --git a/symbols/src/gui/Gui.def b/symbols/src/gui/Gui.def index c37878dc0e..e931fc46c9 100644 --- a/symbols/src/gui/Gui.def +++ b/symbols/src/gui/Gui.def @@ -7,11 +7,11 @@ method void handleClick(int param_2, int param_3, int param_4) = 0x2599c; method void renderOnSelectItemNameText(int param_1, Font *font, int param_2) = 0x26aec; method void renderToolBar(float alpha, int slot_y, int screen_w) = 0x26c30; method void renderChatMessages(int y_offset, uint max_messages, bool disable_fading, Font *font) = 0x273d8; -method void onConfigChanged(Config *config) = 0x255bc; -method void addMessage(std::string *text) = 0x27820; -method void getSlotPos(int slot, int *x, int *y) = 0x25548; +method void onConfigChanged(const Config &config) = 0x255bc; +method void addMessage(const std::string &text) = 0x27820; +method void getSlotPos(int slot, int &x, int &y) = 0x25548; method void renderSlot(int slot, int x, int y, float alpha) = 0x25cc0; -method void renderSlotText(ItemInstance *item, float x, float y, bool finite, bool shadow) = 0x25df8; +method void renderSlotText(const ItemInstance *item, float x, float y, bool finite, bool shadow) = 0x25df8; method void handleKeyPressed(int key) = 0x25a08; method void renderHearts() = 0x2641c; method void renderDebugInfo() = 0x26958; diff --git a/symbols/src/gui/components/Button.def b/symbols/src/gui/components/Button.def index 2d1f2774ba..32f211e55d 100644 --- a/symbols/src/gui/components/Button.def +++ b/symbols/src/gui/components/Button.def @@ -1,7 +1,7 @@ extends GuiComponent; size 0x28; -constructor (int id, std::string *text) = 0x1bc54; +constructor (int id, const std::string &text) = 0x1bc54; method int hovered(Minecraft *minecraft, int click_x, int click_y) = 0x1be2c; diff --git a/symbols/src/gui/components/GuiComponent.def b/symbols/src/gui/components/GuiComponent.def index 46d23b21b7..d0923a579e 100644 --- a/symbols/src/gui/components/GuiComponent.def +++ b/symbols/src/gui/components/GuiComponent.def @@ -4,8 +4,8 @@ constructor () = 0x28204; vtable 0x1039b0; method void blit(int x_dest, int y_dest, int x_src, int y_src, int width_dest, int height_dest, int width_src, int height_src) = 0x282a4; -method void drawCenteredString(Font *font, std::string *text, int x, int y, uint color) = 0x2821c; -method void drawString(Font *font, std::string *text, int x, int y, uint color) = 0x28284; +method void drawCenteredString(Font *font, const std::string &text, int x, int y, uint color) = 0x2821c; +method void drawString(Font *font, const std::string &text, int x, int y, uint color) = 0x28284; method void fill(int x1, int y1, int x2, int y2, uint color) = 0x285f0; method void fillGradient(int x1, int y1, int x2, int y2, int color1, int color2) = 0x287c0; diff --git a/symbols/src/gui/components/OptionButton.def b/symbols/src/gui/components/OptionButton.def index abb60b26d5..614a719a0a 100644 --- a/symbols/src/gui/components/OptionButton.def +++ b/symbols/src/gui/components/OptionButton.def @@ -1,6 +1,6 @@ extends ImageButton; -constructor (Options_Option *option) = 0x1c968; +constructor (const Options_Option *option) = 0x1c968; method void updateImage(Options *options) = 0x1ca58; diff --git a/symbols/src/gui/components/ScrollingPane.def b/symbols/src/gui/components/ScrollingPane.def index f1442b88a9..8b36f1d273 100644 --- a/symbols/src/gui/components/ScrollingPane.def +++ b/symbols/src/gui/components/ScrollingPane.def @@ -1,6 +1,6 @@ extends GuiComponent; -constructor (int param_2, IntRectangle *bb, IntRectangle *itembb, int columns, int item_count, float scale, IntRectangle *itembb2) = 0x22b44; +constructor (int param_2, const IntRectangle &bb, const IntRectangle &itembb, int columns, int item_count, float scale, const IntRectangle &itembb2) = 0x22b44; method void setContentOffset(float x, float y) = 0x220a0; method void render(float param_1, float param_2, float alpha) = 0x22ee4; diff --git a/symbols/src/gui/components/Touch_TButton.def b/symbols/src/gui/components/Touch_TButton.def index 12ef89c636..9a760b89ad 100644 --- a/symbols/src/gui/components/Touch_TButton.def +++ b/symbols/src/gui/components/Touch_TButton.def @@ -1,4 +1,4 @@ extends Button; size 0x28; -constructor (int id, std::string *text) = 0x1c168; +constructor (int id, const std::string &text) = 0x1c168; diff --git a/symbols/src/gui/screens/FurnaceScreen.def b/symbols/src/gui/screens/FurnaceScreen.def index 3e9ca4b7b1..94aa9d14d9 100644 --- a/symbols/src/gui/screens/FurnaceScreen.def +++ b/symbols/src/gui/screens/FurnaceScreen.def @@ -1,5 +1,5 @@ extends Screen; -method int handleAddItem(int slot, ItemInstance *item) = 0x327a0; +method int handleAddItem(int slot, const ItemInstance *item) = 0x327a0; property FurnaceTileEntity *tile_entity = 0x1d0; diff --git a/symbols/src/gui/screens/SelectWorldScreen.def b/symbols/src/gui/screens/SelectWorldScreen.def index c4d0992d6e..fbd64f6fcd 100644 --- a/symbols/src/gui/screens/SelectWorldScreen.def +++ b/symbols/src/gui/screens/SelectWorldScreen.def @@ -2,7 +2,7 @@ extends Screen; vtable 0x104f50; -method std::string getUniqueLevelName(std::string *name) = 0x388ec; +method std::string getUniqueLevelName(const std::string &name) = 0x388ec; property bool should_create_world = 0xfc; property bool world_created = 0xf9; diff --git a/symbols/src/gui/screens/SimpleChooseLevelScreen.def b/symbols/src/gui/screens/SimpleChooseLevelScreen.def index cdc52983b9..be7eab9096 100644 --- a/symbols/src/gui/screens/SimpleChooseLevelScreen.def +++ b/symbols/src/gui/screens/SimpleChooseLevelScreen.def @@ -2,4 +2,4 @@ extends Screen; size 0x68; -constructor (std::string *world_name) = 0x31404; +constructor (const std::string &world_name) = 0x31404; diff --git a/symbols/src/gui/screens/Touch_SelectWorldScreen.def b/symbols/src/gui/screens/Touch_SelectWorldScreen.def index 0a901d38df..17e2e14063 100644 --- a/symbols/src/gui/screens/Touch_SelectWorldScreen.def +++ b/symbols/src/gui/screens/Touch_SelectWorldScreen.def @@ -4,7 +4,7 @@ size 0x158; vtable 0x105758; -method std::string getUniqueLevelName(std::string *name) = 0x3d82c; +method std::string getUniqueLevelName(const std::string &name) = 0x3d82c; property bool should_create_world = 0x154; property bool world_created = 0x151; diff --git a/symbols/src/item/ArmorItem.def b/symbols/src/item/ArmorItem.def index bc7749a03a..66d433cb9b 100644 --- a/symbols/src/item/ArmorItem.def +++ b/symbols/src/item/ArmorItem.def @@ -2,4 +2,4 @@ extends Item; size 0x34; -constructor (int id, ArmorMaterial *material, int param_3, int slot) = 0x9362c; +constructor (int id, const ArmorMaterial &material, int param_3, int slot) = 0x9362c; diff --git a/symbols/src/item/Item.def b/symbols/src/item/Item.def index 61fd3632a0..58ff9ed99f 100644 --- a/symbols/src/item/Item.def +++ b/symbols/src/item/Item.def @@ -12,7 +12,7 @@ virtual-method int useOn(ItemInstance *item_instance, Player *player, Level *lev // Normally returns 0 virtual-method int getUseDuration(ItemInstance *item_instance) = 0x24; virtual-method ItemInstance useTimeDepleted(ItemInstance *item_instance, Level *level, Player *player) = 0x28; -virtual-method int getDestorySpeed(ItemInstance *item_instance, Tile *tile) = 0x2c; +virtual-method int getDestroySpeed(ItemInstance *item_instance, Tile *tile) = 0x2c; virtual-method ItemInstance *use(ItemInstance *item_instance, Level *level, Player *player) = 0x30; virtual-method void hurtEnemy(ItemInstance *itemInstance, Mob *mob) = 0x44; virtual-method bool mineBlock(ItemInstance *instance, int tile_id, int x, int y, int z) = 0x48; @@ -20,8 +20,8 @@ virtual-method bool mineBlock(ItemInstance *instance, int tile_id, int x, int y, virtual-method void interactEnemy(ItemInstance *item_instance, Mob *mob) = 0x54; virtual-method bool isFood() = 0x64; virtual-method bool isArmor() = 0x68; -virtual-method void setDescriptionId(std::string *name) = 0x6c; -virtual-method std::string getDescriptionId(ItemInstance *item_instance) = 0x7c; +virtual-method void setDescriptionId(const std::string &name) = 0x6c; +virtual-method std::string getDescriptionId(const ItemInstance *item_instance) = 0x7c; // This returns an Item*, but it's never called normally so it doesn't matter if we invent a better system over top of it virtual-method ItemInstance *getCraftingRemainingItem(ItemInstance *item_instance) = 0x84; // Swing = 0, eating = 1, drinking = 2, bow = 4, anything else is nothing diff --git a/symbols/src/item/ItemInstance.def b/symbols/src/item/ItemInstance.def index 6726ce1a76..ca4f554ed4 100644 --- a/symbols/src/item/ItemInstance.def +++ b/symbols/src/item/ItemInstance.def @@ -1,9 +1,9 @@ size 0xc; -constructor item(Item *item) = 0x9992c; -constructor tile(Tile *item) = 0x998e4; -constructor tile_extra(Tile *item, int count, int auxiliary) = 0x99918; -constructor item_extra(Item *item, int count, int auxiliary) = 0x99960; +constructor item(const Item *item) = 0x9992c; +constructor tile(const Tile *item) = 0x998e4; +constructor tile_extra(const Tile *item, int count, int auxiliary) = 0x99918; +constructor item_extra(const Item *item, int count, int auxiliary) = 0x99960; static-method ItemInstance *fromTag(CompoundTag *tag) = 0x9a124; diff --git a/symbols/src/item/ItemRenderer.def b/symbols/src/item/ItemRenderer.def index 0d981ac392..f13f37c280 100644 --- a/symbols/src/item/ItemRenderer.def +++ b/symbols/src/item/ItemRenderer.def @@ -1,9 +1,9 @@ -static-method void renderGuiItem_one(Font *font, Textures *textures, ItemInstance *item_instance, float x, float y, bool param_3) = 0x63e58; -static-method void renderGuiItem_two(Font *font, Textures *textures, ItemInstance *item_instance, float x, float y, float w, float h, bool param_5) = 0x63be0; -static-method void renderGuiItemCorrect(Font *font, Textures *textures, ItemInstance *item_instance, int x, int y) = 0x639a0; -static-method void renderGuiItemDecorations(ItemInstance *item, float x, float y) = 0x63748; +static-method void renderGuiItem_one(Font *font, Textures *textures, const ItemInstance *item_instance, float x, float y, bool param_3) = 0x63e58; +static-method void renderGuiItem_two(Font *font, Textures *textures, const ItemInstance *item_instance, float x, float y, float w, float h, bool param_5) = 0x63be0; +static-method void renderGuiItemCorrect(Font *font, Textures *textures, const ItemInstance *item_instance, int x, int y) = 0x639a0; +static-method void renderGuiItemDecorations(const ItemInstance *item, float x, float y) = 0x63748; static-method void blit(float x, float y, float texture_x, float texture_y, float w, float h) = 0x638c0; -// This doesn't include things that it doesn't need for item renderering (like the level) +// This doesn't include things that it doesn't need for item rendering (like the level) // So if you are (ab)using it for something else, be sure to set what you need static-property TileRenderer *tileRenderer = 0x137c18; diff --git a/symbols/src/level/Biome.def b/symbols/src/level/Biome.def index 8747634a67..a35649ec79 100644 --- a/symbols/src/level/Biome.def +++ b/symbols/src/level/Biome.def @@ -10,7 +10,7 @@ virtual-method Feature *getGrassFeature(Random *random) = 0xc; virtual-method float adjustScale(float scale) = 0x10; virtual-method float adjustDepth(float depth) = 0x14; virtual-method uint getSkyColor(float temp) = 0x18; -//virtual-method ??? *getMobs(MobCategory *category) = 0x1c; +//virtual-method ??? *getMobs(const MobCategory &category) = 0x1c; virtual-method float getCreatureProbability() = 0x20; property int color = 0x2c; diff --git a/symbols/src/level/ChunkStorage.def b/symbols/src/level/ChunkStorage.def index 653dd22c1b..ebacde6f71 100644 --- a/symbols/src/level/ChunkStorage.def +++ b/symbols/src/level/ChunkStorage.def @@ -1,6 +1,6 @@ virtual-method LevelChunk *load(Level *level, int chunk_x, int chunk_z) = 0x8; virtual-method void save(Level *level, LevelChunk *level_chunk) = 0xc; virtual-method void saveEntities(Level *level, LevelChunk *level_chunk) = 0x10; -virtual-method void saveAll(Level *level, std::vector *level_chunks) = 0x14; +virtual-method void saveAll(Level *level, std::vector &level_chunks) = 0x14; virtual-method void tick() = 0x18; virtual-method void flush() = 0x1c; diff --git a/symbols/src/level/Level.def b/symbols/src/level/Level.def index d5eb56050a..9bb9a4dfd5 100644 --- a/symbols/src/level/Level.def +++ b/symbols/src/level/Level.def @@ -17,22 +17,22 @@ method void updateNearbyTiles(int x, int y, int z, int id) = 0xa36cc; method void neighborChanged(int x, int y, int z, int id) = 0xa3658; // clip_liquids and clip_hitboxes default to true // If clip_hitboxes is true it will ignore blocks that have their getAABB return NULL -method HitResult clip(uchar *param_1, uchar *param_2, bool clip_liquids, bool clip_hitboxes) = 0xa3db0; +method HitResult clip(const Vec3 ¶m_1, const Vec3 ¶m_2, bool clip_liquids, bool clip_hitboxes) = 0xa3db0; // Valid particles are crit, flame, lava, smoke, largesmoke, reddust, snowballpoof, and explode // There is also bubble which only works under water and ironcrack which will crash the game -method void addParticle(std::string *particle, float x, float y, float z, float deltaX, float deltaY, float deltaZ, int count) = 0xa449c; +method void addParticle(const 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; -method int getBrightness2(LightLayer *layer, int x, int y, int z) = 0xa3c70; +method int getBrightness2(const LightLayer &layer, int x, int y, int z) = 0xa3c70; method int getRawBrightness(int x, int y, int z) = 0xa3b70; // See mods/src/sound/repository.cpp for a list of sounds -method void playSound(Entity *entity, std::string *name, float volume, float pitch) = 0xa42a8; +method void playSound(Entity *entity, const std::string &name, float volume, float pitch) = 0xa42a8; // Searches aabb for entities, ignores the entity "ignore", overwrites the same vector each time -method std::vector *getEntities(Entity *ignore, AABB *aabb) = 0xa5a4c; +method std::vector *getEntities(Entity *ignore, const AABB &aabb) = 0xa5a4c; // Searches aabb for entities of type type_id, adds then to buff, returns the number of entities added -method int getEntitiesOfType(int type_id, AABB *aabb, std::vector *buff) = 0xa612c; +method int getEntitiesOfType(int type_id, const AABB &aabb, std::vector &buff) = 0xa612c; // Searches aabb for entities of base type base_type, adds then to buff, returns the number of entities added -method int getEntitiesOfClass(int base_type, AABB *aabb, std::vector *buff) = 0xa6240; +method int getEntitiesOfClass(int base_type, const AABB &aabb, std::vector &buff) = 0xa6240; // This will implicitly make the tile entity if the tile at x, y, z doesn't have one and is an EntityTile method TileEntity *getTileEntity(int x, int y, int z) = 0xa55d4; method void setTileEntity(int x, int y, int z, TileEntity *tileEntity) = 0xa7b58; diff --git a/symbols/src/level/LevelStorage.def b/symbols/src/level/LevelStorage.def new file mode 100644 index 0000000000..724cb43882 --- /dev/null +++ b/symbols/src/level/LevelStorage.def @@ -0,0 +1 @@ +vtable 0x1108a8; \ No newline at end of file diff --git a/symbols/src/level/LevelStorageSource.def b/symbols/src/level/LevelStorageSource.def index 723f01becb..cb26d7bd2c 100644 --- a/symbols/src/level/LevelStorageSource.def +++ b/symbols/src/level/LevelStorageSource.def @@ -1,2 +1,2 @@ -virtual-method void deleteLevel(std::string *level_name) = 0x20; -virtual-method void getLevelList(std::vector *level_list) = 0xc; +virtual-method void deleteLevel(const std::string &level_name) = 0x20; +virtual-method void getLevelList(std::vector &level_list) = 0xc; diff --git a/symbols/src/level/ServerLevel.def b/symbols/src/level/ServerLevel.def index c562b23173..e8dfe48ee2 100644 --- a/symbols/src/level/ServerLevel.def +++ b/symbols/src/level/ServerLevel.def @@ -3,4 +3,4 @@ extends Level; vtable 0x109da0; size 0xb80; -constructor (uchar *storage, uchar *name, LevelSettings *settings, int param_4, Dimension *dimension) = 0x7692c; +constructor (LevelStorage *storage, const std::string &name, const LevelSettings &settings, int param_4, Dimension *dimension) = 0x7692c; diff --git a/symbols/src/level/renderer/Chunk.def b/symbols/src/level/renderer/Chunk.def index ffe95f15a6..9cc8d2460b 100644 --- a/symbols/src/level/renderer/Chunk.def +++ b/symbols/src/level/renderer/Chunk.def @@ -4,6 +4,6 @@ property int z = 0xc; property bool field_1c[3] = 0x1c; property bool visible = 0x4c; -method float distanceToSqr(Entity *entity) = 0x47ba0; +method float distanceToSqr(const Entity *entity) = 0x47ba0; method int getList(int a) = 0x47e48; method RenderChunk *getRenderChunk(int a) = 0x47e74; diff --git a/symbols/src/level/renderer/LevelRenderer.def b/symbols/src/level/renderer/LevelRenderer.def index 93789b37ca..ea8216f7ca 100644 --- a/symbols/src/level/renderer/LevelRenderer.def +++ b/symbols/src/level/renderer/LevelRenderer.def @@ -1,9 +1,9 @@ method void tick() = 0x4da1c; method void render(Mob *mob, int param_1, float delta) = 0x4f710; -method void renderDebug(AABB *aabb, float delta) = 0x4d310; +method void renderDebug(const AABB &aabb, float delta) = 0x4d310; method void generateSky() = 0x4d0d4; -method void renderHitSelect(Player *player, HitResult *hit_result, int i, void *vp, float f) = 0x4e318; -method void renderHitOutline(Player *player, HitResult *hit_result, int i, void *vp, float f) = 0x4dc14; +method void renderHitSelect(Player *player, const HitResult &hit_result, int i, void *vp, float f) = 0x4e318; +method void renderHitOutline(Player *player, const HitResult &hit_result, int i, void *vp, float f) = 0x4dc14; method int renderChunks(int start, int end, int a, float b) = 0x4f35c; property Minecraft *minecraft = 0xb4; diff --git a/symbols/src/level/renderer/RenderList.def b/symbols/src/level/renderer/RenderList.def index 568d41d32b..2109103f16 100644 --- a/symbols/src/level/renderer/RenderList.def +++ b/symbols/src/level/renderer/RenderList.def @@ -2,7 +2,7 @@ method void render() = 0x52800; method void renderChunks() = 0x52708; method void clear() = 0x5288c; method void init(float x, float y, float z) = 0x526bc; -method void addR(RenderChunk *chunk) = 0x526dc; +method void addR(const RenderChunk &chunk) = 0x526dc; property int size = 0x1c; property RenderChunk *chunks = 0x10; diff --git a/symbols/src/misc/Common.def b/symbols/src/misc/Common.def index d3c6b9bf5a..59fdbcae1c 100644 --- a/symbols/src/misc/Common.def +++ b/symbols/src/misc/Common.def @@ -1,4 +1,4 @@ -static-method std::string getGameVersionString(std::string *version_suffix) = 0x15068; +static-method std::string getGameVersionString(const std::string &version_suffix) = 0x15068; // These are not actually part of "Common", but they have to go somewhere. static-method void renderCursor(float x, float y, Minecraft *minecraft) = 0x480c4; diff --git a/symbols/src/misc/CompoundTag.def b/symbols/src/misc/CompoundTag.def index ebc4dda474..73efc476a3 100644 --- a/symbols/src/misc/CompoundTag.def +++ b/symbols/src/misc/CompoundTag.def @@ -4,10 +4,10 @@ vtable-size 0x34; size 0x24; constructor (std::string name) = 0x69740; -method bool getBoolean(std::string *name) = 0xd1b28; -method char getByte(std::string *name) = 0x7f00c; -method void putByte(std::string *name, char i) = 0x7d6d0; -method short getShort(std::string *name) = 0x459c0; -method void putShort(std::string *name, short i) = 0x7d60c; -method bool contains(std::string *name, int type) = 0x7d130; -method void put(std::string *name, Tag *tag) = 0x6a040; +method bool getBoolean(const std::string &name) = 0xd1b28; +method char getByte(const std::string &name) = 0x7f00c; +method void putByte(const std::string &name, char i) = 0x7d6d0; +method short getShort(const std::string &name) = 0x459c0; +method void putShort(const std::string &name, short i) = 0x7d60c; +method bool contains(const std::string &name, int type) = 0x7d130; +method void put(const std::string &name, Tag *tag) = 0x6a040; diff --git a/symbols/src/misc/I18n.def b/symbols/src/misc/I18n.def index e35e2bb518..966947dc43 100644 --- a/symbols/src/misc/I18n.def +++ b/symbols/src/misc/I18n.def @@ -1,3 +1,3 @@ -static-method void loadLanguage(AppPlatform *app, std::string language_name) = 0x680d0; +static-method void loadLanguage(AppPlatform *app, const std::string &language_name) = 0x680d0; static-property std::map _strings = 0x137d98; diff --git a/symbols/src/misc/SoundEngine.def b/symbols/src/misc/SoundEngine.def index ca0eff085a..49ee42f507 100644 --- a/symbols/src/misc/SoundEngine.def +++ b/symbols/src/misc/SoundEngine.def @@ -1,8 +1,8 @@ method void init(Minecraft *minecraft, Options *options) = 0x67760; method void enable(bool state) = 0x6776c; method void update(Mob *listener_mob, float listener_angle) = 0x67778; -method void playUI(std::string *name, float volume, float pitch) = 0x67864; -method void play(std::string *name, float x, float y, float z, float volume, float pitch) = 0x67860; +method void playUI(const std::string &name, float volume, float pitch) = 0x67864; +method void play(const std::string &name, float x, float y, float z, float volume, float pitch) = 0x67860; property Minecraft *minecraft = 0xa08; property Options *options = 0x4; diff --git a/symbols/src/misc/Util.def b/symbols/src/misc/Util.def index 4e6c6d4902..ac85dad2c0 100644 --- a/symbols/src/misc/Util.def +++ b/symbols/src/misc/Util.def @@ -1,3 +1,3 @@ -static-method std::string stringTrim(std::string *str) = 0x77c40; -static-method int hashCode(std::string *str) = 0x77a50; -static-method std::string *stringReplace(std::string *str, std::string *what, std::string *with, int param_1) = 0x779f0; +static-method std::string stringTrim(const std::string &str) = 0x77c40; +static-method int hashCode(const std::string &str) = 0x77a50; +static-method std::string &stringReplace(const std::string &str, const std::string &what, const std::string &with, int param_1) = 0x779f0; diff --git a/symbols/src/network/NetEventCallback.def b/symbols/src/network/NetEventCallback.def index 5610a0fb82..9edd060dc4 100644 --- a/symbols/src/network/NetEventCallback.def +++ b/symbols/src/network/NetEventCallback.def @@ -2,6 +2,6 @@ vtable-destructor-offset 0x4; // Why vtable 0x1090f0; virtual-method void levelGenerated(Level *level) = 0x0; -virtual-method void onDisconnect(RakNet_RakNetGUID *guid) = 0x18; -virtual-method void handle_SignUpdatePacket(RakNet_RakNetGUID *guid, SignUpdatePacket *packet) = 0xcc; -virtual-method void handle_ChatPacket(RakNet_RakNetGUID *rak_net_guid, ChatPacket *packet) = 0xc8; +virtual-method void onDisconnect(const RakNet_RakNetGUID &guid) = 0x18; +virtual-method void handle_SignUpdatePacket(const RakNet_RakNetGUID &guid, SignUpdatePacket *packet) = 0xcc; +virtual-method void handle_ChatPacket(const RakNet_RakNetGUID &rak_net_guid, ChatPacket *packet) = 0xc8; diff --git a/symbols/src/network/RakNetInstance.def b/symbols/src/network/RakNetInstance.def index 09ec176c8e..ddd0aa0e1e 100644 --- a/symbols/src/network/RakNetInstance.def +++ b/symbols/src/network/RakNetInstance.def @@ -2,8 +2,8 @@ vtable 0x109ae8; constructor () = 0x73b20; -virtual-method void sendTo(RakNet_RakNetGUID *guid, Packet *packet) = 0x3c; -virtual-method void send(Packet *packet) = 0x38; +virtual-method void sendTo(const RakNet_RakNetGUID &guid, Packet &packet) = 0x3c; +virtual-method void send(Packet &packet) = 0x38; virtual-method uint isServer() = 0x48; virtual-method void pingForHosts(int base_port) = 0x14; diff --git a/symbols/src/network/ServerSideNetworkHandler.def b/symbols/src/network/ServerSideNetworkHandler.def index 7feda4af3e..7b9c23bbc4 100644 --- a/symbols/src/network/ServerSideNetworkHandler.def +++ b/symbols/src/network/ServerSideNetworkHandler.def @@ -2,8 +2,8 @@ extends NetEventCallback; vtable 0x109b98; -method Player *getPlayer(RakNet_RakNetGUID *guid) = 0x75464; -method Player *popPendingPlayer(RakNet_RakNetGUID *guid) = 0x75db4; -method void displayGameMessage(std::string *message) = 0x750c4; +method Player *getPlayer(const RakNet_RakNetGUID &guid) = 0x75464; +method Player *popPendingPlayer(const RakNet_RakNetGUID &guid) = 0x75db4; +method void displayGameMessage(const std::string &message) = 0x750c4; property Minecraft *minecraft = 0x8; diff --git a/symbols/src/network/raknet/RakNet_BitStream.def b/symbols/src/network/raknet/RakNet_BitStream.def index 586e4d1d94..851a4ef29d 100644 --- a/symbols/src/network/raknet/RakNet_BitStream.def +++ b/symbols/src/network/raknet/RakNet_BitStream.def @@ -3,7 +3,7 @@ method void Write_int(int *i) = 0x18454; method void Write_ushort(ushort *i) = 0x45a68; method void Write_short(short *i) = 0x71918; // right_aligned should be true -method void WriteBits(uchar *buff, uint bits, bool right_aligned) = 0xd41b4; +method void WriteBits(const uchar *buff, uint bits, bool right_aligned) = 0xd41b4; method void Read_uchar(uchar *i) = 0x45ab0; method void Read_int(int *i) = 0x184ec; diff --git a/symbols/src/recipes/FurnaceRecipes.def b/symbols/src/recipes/FurnaceRecipes.def index 1329963a72..115b83238a 100644 --- a/symbols/src/recipes/FurnaceRecipes.def +++ b/symbols/src/recipes/FurnaceRecipes.def @@ -1,2 +1,2 @@ constructor () = 0xa0778; -method void addFurnaceRecipe(int input_item_id, ItemInstance *result) = 0xa0714; +method void addFurnaceRecipe(int input_item_id, const ItemInstance &result) = 0xa0714; diff --git a/symbols/src/recipes/Recipes.def b/symbols/src/recipes/Recipes.def index 3c660e0eb9..803a6abccf 100644 --- a/symbols/src/recipes/Recipes.def +++ b/symbols/src/recipes/Recipes.def @@ -1,6 +1,6 @@ constructor () = 0x9cabc; -method void addShapelessRecipe(ItemInstance *result, std::vector *ingredients) = 0x9c3dc; -method void addShapedRecipe_1(ItemInstance *result, std::string *line_1, std::vector *ingredients) = 0x9ca74; -method void addShapedRecipe_2(ItemInstance *result, std::string *line_1, std::string *line_2, std::vector *ingredients) = 0x9ca24; -method void addShapedRecipe_3(ItemInstance *result, std::string *line_1, std::string *line_2, std::string *line_3, std::vector *ingredients) = 0x9c9d0; +method void addShapelessRecipe(const ItemInstance &result, const std::vector &ingredients) = 0x9c3dc; +method void addShapedRecipe_1(const ItemInstance &result, const std::string &line_1, const std::vector &ingredients) = 0x9ca74; +method void addShapedRecipe_2(const ItemInstance &result, const std::string &line_1, const std::string &line_2, const std::vector &ingredients) = 0x9ca24; +method void addShapedRecipe_3(const ItemInstance &result, const std::string &line_1, const std::string &line_2, const std::string &line_3, const std::vector &ingredients) = 0x9c9d0; diff --git a/symbols/src/textures/Textures.def b/symbols/src/textures/Textures.def index f906892c10..6795f8d65e 100644 --- a/symbols/src/textures/Textures.def +++ b/symbols/src/textures/Textures.def @@ -1,4 +1,4 @@ method void tick(bool param_1) = 0x531c4; -method int loadAndBindTexture(std::string *name) = 0x539cc; -method int assignTexture(std::string *name, uchar *data) = 0x5354c; +method int loadAndBindTexture(const std::string &name) = 0x539cc; +method int assignTexture(const std::string &name, uchar *data) = 0x5354c; method void addDynamicTexture(DynamicTexture *texture) = 0x534f8; diff --git a/symbols/src/tile/Tile.def b/symbols/src/tile/Tile.def index a64e59820b..0fb586d3ea 100644 --- a/symbols/src/tile/Tile.def +++ b/symbols/src/tile/Tile.def @@ -3,7 +3,7 @@ static-method void initTiles() = 0xc358c; vtable 0x115670; vtable-size 0x104; -constructor (int id, int texture, Material *material) = 0xc33a0; +constructor (int id, int texture, const Material *material) = 0xc33a0; size 0x5c; method Tile *init() = 0xc34dc; @@ -19,7 +19,7 @@ virtual-method int getTexture2(int face, int data) = 0x2c; virtual-method int getTexture3(LevelSource *level, int x, int y, int z, int face) = 0x30; virtual-method AABB *getAABB(Level *level, int x, int y, int z) = 0x34; // Chain Tile_setShape_non_virtual and Tile_addAABBs_non_virtual, look at how stairs and fences do it -virtual-method void addAABBs(Level *level, int x, int y, int z, AABB *intersecting, std::vector *aabbs) = 0x38; +virtual-method void addAABBs(Level *level, int x, int y, int z, const AABB *intersecting, std::vector &aabbs) = 0x38; virtual-method bool isSolidRender() = 0x40; virtual-method bool mayPlace(Level *level, int x, int y, int z, uchar face) = 0x4c; virtual-method bool mayPlace2(Level *level, int x, int y, int z) = 0x50; @@ -49,8 +49,8 @@ virtual-method bool getSignal2(LevelSource *level, int x, int y, int z, int dire virtual-method bool getDirectSignal(Level *level, int x, int y, int z, int direction) = 0xc8; virtual-method void entityInside(Level *level, int x, int y, int z, Entity *entity) = 0xcc; virtual-method std::string getDescriptionId() = 0xdc; -virtual-method Tile *setDescriptionId(std::string *description_id) = 0xe0; -virtual-method Tile *setSoundType(Tile_SoundType *sound_type) = 0xe8; +virtual-method Tile *setDescriptionId(const std::string &description_id) = 0xe0; +virtual-method Tile *setSoundType(const Tile_SoundType &sound_type) = 0xe8; virtual-method Tile *setLightEmission(float light) = 0xf0; virtual-method Tile *setExplodeable(float explodeable) = 0xf4; virtual-method Tile *setDestroyTime(float destroy_time) = 0xf8; diff --git a/symbols/src/tile/entity/FurnaceTileEntity.def b/symbols/src/tile/entity/FurnaceTileEntity.def index 4c36be47f8..652f22e29e 100644 --- a/symbols/src/tile/entity/FurnaceTileEntity.def +++ b/symbols/src/tile/entity/FurnaceTileEntity.def @@ -1,5 +1,5 @@ extends TileEntity; virtual-method ItemInstance *getItem(int slot) = 0x2c; -static-method int getBurnDuration(ItemInstance *item_instance) = 0xd33f8; +static-method int getBurnDuration(const ItemInstance &item_instance) = 0xd33f8; method int getLitProgress(int max) = 0xd3240; diff --git a/symbols/src/tile/entity/TileEntity.def b/symbols/src/tile/entity/TileEntity.def index a3f6a45f11..30eb1f3f57 100644 --- a/symbols/src/tile/entity/TileEntity.def +++ b/symbols/src/tile/entity/TileEntity.def @@ -3,7 +3,7 @@ vtable-size 0x28; vtable 0x115d78; constructor (int type) = 0xd2308; -static-method void setId(int id, std::string *name) = 0xd26fc; +static-method void setId(int id, const std::string &name) = 0xd26fc; static-method void initTileEntities() = 0xd2834; virtual-method bool shouldSave() = 0x8; diff --git a/symbols/src/tile/entity/TileEntityRenderer.def b/symbols/src/tile/entity/TileEntityRenderer.def index 766af4ee0e..98cfd13866 100644 --- a/symbols/src/tile/entity/TileEntityRenderer.def +++ b/symbols/src/tile/entity/TileEntityRenderer.def @@ -8,6 +8,6 @@ virtual-method void render(TileEntity *tileentity, float x, float y, float z, fl virtual-method void onGraphicsReset() = 0xc; virtual-method void onNewLevel(Level *level) = 0x10; -method void bindTexture(std::string *file) = 0x67638; +method void bindTexture(const std::string &file) = 0x67638; property TileEntityRenderDispatcher *tileEntityRenderDispatcher = 0x4;