if (packet instanceof Packet3Chat) {
boolean cancelled = false;
String s = Obfuscation.getChatFromPacket((Packet3Chat) packet);
OutgoingChatEvent chatevent = new OutgoingChatEvent(controller, s);
controller.getEventManager().callEvent(chatevent);
if (!chatevent.isCancelled() && s.startsWith("/") && s.length() > 1) {
ChatCommandEvent commandevent = new ChatCommandEvent(controller, s);
controller.getEventManager().callEvent(commandevent);
if (commandevent.isHandled() || commandevent.isCancelled()) {
cancelled = true;
}