@Override
    protected void keyTyped(char var1, int var2) {
        if (var2 == 1) {
            this.mc.displayGuiScreen((GuiScreen) null);
        } else if (var2 == 28) {
            String var3 = this.message.trim();
            if (!var3.isEmpty()) {
                String var4 = this.message.trim();
                this.mc.thePlayer.sendChatMessage(var4);
            }

            this.mc.displayGuiScreen((GuiScreen) null);
        } else {
            if (var2 == 14 && this.message.length() > 0) {
                this.message = this.message.substring(0, this.message.length() - 1);
            }

            if (allowedCharacters.indexOf(var1) >= 0 && this.message.length() < 100) {
                this.message = this.message + var1;
            }

        }
    }