msg.srcChannel = channel;
msg.message = message.substring(cmdPrefix.length());
msg.updateTag();
// PLUGIN INTEROP
msg.setTarget(EndPoint.PLUGIN);
Event ie = new IRCEvent(Mode.AUTHED_COMMAND, msg);
this.plugin.getServer().getPluginManager().callEvent(ie);
if (((IRCEvent)ie).isHandled()) return;
} // End admin commands
// Begin public commands
// Send all IRC chatter (no command prefixes or ignored command prefixes)
if (!ircCmdPrefixes.contains(message.substring(0, 0)) && !message.startsWith(cmdPrefix)) {
if (this.plugin.isDebug()) {
CraftIRC.log.info(String.format(CraftIRC.NAME + " Minebot allchat"));
}
RelayedMessage msg = this.plugin.newMsg(EndPoint.IRC, EndPoint.BOTH);
msg.formatting = "chat";
msg.sender = sender;
msg.srcBot = botId;
msg.srcChannel = channel;
msg.message = message;
msg.updateTag();
this.plugin.sendMessage(msg, null, "all-chat");
// PLUGIN INTEROP
if (this.plugin.isDebug())
CraftIRC.log.info(String.format(CraftIRC.NAME + " Minebot IRCEVENT.MSG"));
msg.setTarget(EndPoint.PLUGIN);
Event ie = new IRCEvent(Mode.MSG, msg);
this.plugin.getServer().getPluginManager().callEvent(ie);
return;
}
// .say - Send single message to the game
else if (message.startsWith(cmdPrefix + "say ") || message.startsWith(cmdPrefix + "mc ")) {
if (splitMessage.length > 1) {
RelayedMessage msg = this.plugin.newMsg(EndPoint.IRC, EndPoint.GAME);
msg.formatting = "chat";
msg.sender = sender;
msg.srcBot = botId;
msg.srcChannel = channel;
msg.message = command;
msg.updateTag();
this.plugin.sendMessage(msg, null, null);
this.sendNotice(sender, "Message sent to game");
return;
}
} else if (message.startsWith(cmdPrefix + "players")) {
if (this.plugin.isDebug()) {
CraftIRC.log.info(String.format(CraftIRC.NAME + " Minebot .players command"));
}
String playerListing = this.getPlayerList();
this.sendMessage(channel, playerListing);
return;
} else {
// IRCEvent - COMMAND
if (this.plugin.isDebug()) {
CraftIRC.log.info(String.format(CraftIRC.NAME + " Minebot IRCEVENT.COMMAND"));
}
RelayedMessage msg = this.plugin.newMsg(EndPoint.IRC, EndPoint.BOTH);
msg.formatting = "";
msg.sender = sender;
msg.srcBot = botId;
msg.srcChannel = channel;
msg.message = message.substring(cmdPrefix.length());
msg.updateTag();
// PLUGIN INTEROP
msg.setTarget(EndPoint.PLUGIN);
Event ie = new IRCEvent(Mode.COMMAND, msg);
this.plugin.getServer().getPluginManager().callEvent(ie);
}
} catch (Exception e) {
e.printStackTrace();