- Joined
- Jul 11, 2020
- Messages
- 0
- Reaction score
- 25
- Points
- 0
Ich wollte wissen wo ich die Chat Messages abfangen kann also nicht die die der Spieler sendet sonder die die der Server sendet!
Danke xDI wants to know where you can catch chat messages of the server.
RecievedPacket S02PacketChat? Is that what he wantsHe wants to know where you can catch chat messages of the server.
RecievedPacket S02PacketChat? Is that what he wants
/**
* Prints a chatmessage in the chat GUI
*/
public void handleChat(SPacketChat packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
if (packetIn.getType() == 2)
{
this.gameController.ingameGUI.setOverlayMessage(packetIn.getChatComponent(), false);
}
else
{
this.gameController.ingameGUI.getChatGUI().printChatMessage(packetIn.getChatComponent());
}
}
@EventTarget
public void onrecive(EventReceivePacket e){
if(e.getPacket() instanceof S02PacketChat){
S02PacketChat test = (S02PacketChat) e.getPacket();
msg = test.func_148915_c().getUnformattedText();
}
}