mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
parent
7c9c12bee7
commit
dc09896959
8 changed files with 28 additions and 11 deletions
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MinecraftClient.Protocol.Handlers
|
||||
namespace MinecraftClient.Protocol
|
||||
{
|
||||
/// <summary>
|
||||
/// This class parses JSON chat data from MC 1.6+ and returns the appropriate string to be printed.
|
||||
|
|
@ -88,9 +88,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
case 0x02: readData(1); readNextString(); readNextString(); readData(4); break;
|
||||
case 0x03:
|
||||
string message = readNextString();
|
||||
List<string> links = new List<string>();
|
||||
if (protocolversion >= 72) { message = ChatParser.ParseText(message, links); }
|
||||
handler.OnTextReceived(message, links); break;
|
||||
handler.OnTextReceived(message, protocolversion >= 72); break;
|
||||
case 0x04: readData(16); break;
|
||||
case 0x05: readData(6); readNextItemSlot(); break;
|
||||
case 0x06: readData(12); break;
|
||||
|
|
|
|||
|
|
@ -258,8 +258,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
break;
|
||||
}
|
||||
catch (ArgumentOutOfRangeException) { /* No message type */ }
|
||||
List<string> links = new List<string>();
|
||||
handler.OnTextReceived(ChatParser.ParseText(message, links), links);
|
||||
handler.OnTextReceived(message, true);
|
||||
break;
|
||||
case PacketIncomingType.Respawn:
|
||||
this.currentDimension = readNextInt(packetData);
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ namespace MinecraftClient.Protocol
|
|||
/// This method is called when the protocol handler receives a chat message
|
||||
/// </summary>
|
||||
/// <param name="text">Text received from the server</param>
|
||||
/// <param name="links">Links embedded in text (for click events)</param>
|
||||
void OnTextReceived(string text, IEnumerable<string> links);
|
||||
/// <param name="isJson">TRUE if the text is JSON-Encoded</param>
|
||||
void OnTextReceived(string text, bool isJson);
|
||||
|
||||
/// <summary>
|
||||
/// This method is called when a new player joins the game
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue