MonsterIRC

MonsterIRC

24.4k Downloads

No chat from minecraft.

Psithief opened this issue ยท 2 comments

commented

I'm not receiving any chat from minecraft.

Does the channel have to have a specific mode?

Does ALL_CHAT.ENABLED exist?
I can't find it in the source. Is it a lie?

Config.yml

ALL_CHAT:
  ENABLED: true
commented

You misplaced a closing bracket, making else if (c.getChatType() == ChatType.ALL) unreachable.

https://github.com/Monstercraft/MonsterIRC/blob/master/src/org/monstercraft/irc/listeners/IRCListener.java

@EventHandler(priority = EventPriority.NORMAL)
    public void onPlayerChat(PlayerChatEvent event) {
        try {
            if (plugin.isEnabled()) {
                Player player = event.getPlayer();
                for (IRCChannel c : Variables.channels) {
                    if (c.getChatType() == ChatType.ADMINCHAT) {
                        if (IRC.getHookManager().getmcMMOHook() != null) {
                            if (IRC.getHookManager().getmcMMOHook()
                                    .getPlayerProfile(player)
                                    .getAdminChatMode()) {
                                StringBuffer result = new StringBuffer();
                                result.append("<" + player.getName() + ">"
                                        + " ");
                                result.append(event.getMessage());
                                IRC.getHandleManager()
                                        .getIRCHandler()
                                        .sendMessage(result.toString(),
                                                c.getChannel());
                            }
                        }
                    } else if (c.getChatType() == ChatType.HEROCHAT
                            && IRC.getHookManager().getHeroChatHook() != null) {
                        if (IRC.getHookManager().getHeroChatHook().isEnabled()) {
                            if (IRC.getHookManager().getmcMMOHook() != null) {
                                if (IRC.getHookManager().getmcMMOHook()
                                        .getPlayerProfile(player)
                                        .getAdminChatMode()) {
                                    continue;
                                }
                            }
                            if (IRC.getHookManager().getHeroChatHook()
                                    .getChannelManager()
                                    .getActiveChannel(player.getName())
                                    .getName()
                                    .equals(c.getHeroChatChannel().getName())
                                    && c.getHeroChatChannel().isEnabled()
                                    && !IRC.getHookManager().getHeroChatHook()
                                            .getChannelManager().getMutelist()
                                            .contains(player.getName())
                                    && !c.getHeroChatChannel().getMutelist()
                                            .contains(player.getName())) {
                                if (IRC.getHandleManager()
                                        .getPermissionsHandler()
                                        .anyGroupsInList(
                                                player,
                                                IRC.getHookManager()
                                                        .getHeroChatHook()
                                                        .getChannelManager()
                                                        .getActiveChannel(
                                                                player.getName())
                                                        .getVoicelist())
                                        || IRC.getHookManager()
                                                .getHeroChatHook()
                                                .getChannelManager()
                                                .getActiveChannel(
                                                        player.getName())
                                                .getVoicelist().isEmpty()) {
                                    StringBuffer result = new StringBuffer();
                                    result.append("<" + player.getName() + ">"
                                            + " ");
                                    result.append(event.getMessage());
                                    IRC.getHandleManager()
                                            .getIRCHandler()
                                            .sendMessage(result.toString(),
                                                    c.getChannel());
                                }
                            }
                        } else if (c.getChatType() == ChatType.ALL) {
                            if (IRC.getHookManager().getmcMMOHook() != null) {
                                if (IRC.getHookManager().getmcMMOHook()
                                        .getPlayerProfile(player)
                                        .getAdminChatMode()) {
                                    continue;
                                }
                            }
                            StringBuffer result = new StringBuffer();
                            result.append("<" + player.getName() + ">" + " ");
                            result.append(event.getMessage());
                            IRC.getHandleManager()
                                    .getIRCHandler()
                                    .sendMessage(result.toString(),
                                            c.getChannel());
                        }
                    }
                }
            }
        } catch (Exception e) {
            debug(e.toString());
        }
    }
commented

This will be fixed in the next update.. been busy with exams and stuff..