NPE on /irc say
robxu9 opened this issue ยท 10 comments
2012-01-28 16:43:27 [SEVERE] null
org.bukkit.command.CommandException: Unhandled exception executing command 'irc' in plugin MonsterIRC v1.105
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:42)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:168)
at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:386)
at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:777)
at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:737)
at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:725)
at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:178)
at net.minecraft.server.Packet3Chat.handle(Packet3Chat.java:33)
at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:100)
at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:587)
at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:78)
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:536)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:434)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 3
at org.monstercraft.irc.command.gamecommands.Say.execute(Say.java:42)
at org.monstercraft.irc.managers.CommandManager.onGameCommand(CommandManager.java:82)
at org.monstercraft.irc.IRC.onCommand(IRC.java:71)
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40)
... 14 more
Also, with no chat plugin (except bChatManager), no chat is being relayed back :(
I just had a look at the code. It's happening whenever the message you want to say doesn't have a space in it.
'Clever.'
Found it.
for (IRCChannel c : Variables.channels) {
if (c.getChannel().equalsIgnoreCase(split[3])) {
IRC.getHandleManager().getIRCHandler()
.sendMessage(result.toString(), c.getChannel());
if (c.getChatType() == ChatType.HEROCHAT
&& IRC.getHookManager().getHeroChatHook() != null) {
c.getHeroChatChannel().sendMessage(
"<" + sender.getName() + ">", result2.toString(),
c.getHeroChatChannel().getMsgFormat(), false);
}
}
}
What the hell was the author thinking here?
If you include the full name of the channel in your /irc say as the FOURTH PARAMETER then you will say the THIRD+.
Example channel: #abc
/irc say WTF #abc WTF WTF WTF.
Output to channel:
<yourname> WTF #abc WTF WTF WTF
Fletch, please learn how to use zero indexed arrays!
[0] irc
[1] say
[2] WTF
[3] #abc
[4] WTF
[5] WTF
[6] WTF
Besides who uses /irc say anyways lol..
That would be the confused people who can't get the plugin to do anything.
Its all fixed, some reason github wasn't sending me email when someone commented or created an issue before but now it is :D
@Psithief +1 lol ;)