From be1f3bf50ef36978e749604c03c3531115e7b5f3 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Sat, 21 Sep 2024 01:49:47 -0400 Subject: [PATCH] Fix Chat Example Mod --- example-mods/chat-commands/chat-commands.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/example-mods/chat-commands/chat-commands.cpp b/example-mods/chat-commands/chat-commands.cpp index 20c2ccd8cd..14aebfaaf4 100644 --- a/example-mods/chat-commands/chat-commands.cpp +++ b/example-mods/chat-commands/chat-commands.cpp @@ -5,13 +5,14 @@ #include // The Actual Mod -HOOK(chat_handle_packet_send, void, (Minecraft *minecraft, ChatPacket *packet)) { +HOOK(chat_handle_packet_send, void, (const Minecraft *minecraft, ChatPacket *packet)) { // Get Message const char *message = packet->message.c_str(); if (message[0] == '/') { // API Command - Gui *gui = &minecraft->gui; - std::string out = chat_send_api_command(minecraft, (char *) &message[1]); + Minecraft *mc = (Minecraft *) minecraft; + Gui *gui = &mc->gui; + std::string out = chat_send_api_command(mc, (char *) &message[1]); if (out.length() > 0 && out[out.length() - 1] == '\n') { out[out.length() - 1] = '\0'; }