diff --git a/example-mods/chat-commands/chat-commands.cpp b/example-mods/chat-commands/chat-commands.cpp index 64e0f6ac9a..a6d6771bfb 100644 --- a/example-mods/chat-commands/chat-commands.cpp +++ b/example-mods/chat-commands/chat-commands.cpp @@ -1,17 +1,16 @@ // Headers - #include #include #include #include // The Actual Mod -HOOK(chat_handle_packet_send, void, (unsigned char *minecraft, unsigned char *packet)) { +HOOK(chat_handle_packet_send, void, (Minecraft *minecraft, ChatPacket *packet)) { // Get Message - char *message = *(char **) (packet + ChatPacket_message_property_offset); + char *message = packet->message; if (message[0] == '/') { // API Command - unsigned char *gui = minecraft + Minecraft_gui_property_offset; + Gui *gui = &minecraft->gui; std::string out = chat_send_api_command(minecraft, &message[1]); if (out.length() > 0 && out[out.length() - 1] == '\n') { out[out.length() - 1] = '\0'; diff --git a/example-mods/expanded-creative/expanded-creative.cpp b/example-mods/expanded-creative/expanded-creative.cpp index bda94624e2..5a6b421b50 100644 --- a/example-mods/expanded-creative/expanded-creative.cpp +++ b/example-mods/expanded-creative/expanded-creative.cpp @@ -1,12 +1,10 @@ // Headers - #include #include #include // The Actual Mod - -static void Inventory_setupDefault_FillingContainer_addItem_call_injection(unsigned char *filling_container) { +static void Inventory_setupDefault_FillingContainer_addItem_call_injection(FillingContainer *filling_container) { ItemInstance *fire_instance = new ItemInstance; ALLOC_CHECK(fire_instance); fire_instance->count = 255; diff --git a/example-mods/recipes/recipes.cpp b/example-mods/recipes/recipes.cpp index f0e6aca0e5..f48087a76b 100644 --- a/example-mods/recipes/recipes.cpp +++ b/example-mods/recipes/recipes.cpp @@ -1,11 +1,10 @@ // Headers - #include #include #include // Custom Crafting Recipes -static void Recipes_injection(unsigned char *recipes) { +static void Recipes_injection(Recipes *recipes) { // Add Recipes_Type type1 = { .item = 0, @@ -32,13 +31,19 @@ static void Recipes_injection(unsigned char *recipes) { .id = 344, .auxiliary = 0 }; - (*Recipes_addShapelessRecipe)(recipes, result, {type1, type2}); + std::vector types = {type1, type2}; + (*Recipes_addShapelessRecipe)(recipes, &result, &types); } // Custom Furnace Recipes -static void FurnaceRecipes_injection(unsigned char *recipes) { +static void FurnaceRecipes_injection(FurnaceRecipes *recipes) { // Add - (*FurnaceRecipes_addFurnaceRecipe)(recipes, 49, {.count = 1, .id = 246, .auxiliary = 0}); + ItemInstance result = { + .count = 1, + .id = 246, + .auxiliary = 0 + }; + (*FurnaceRecipes_addFurnaceRecipe)(recipes, 49, &result); } // Init