Using pIRCBot.
Class: pIRC.java
protected void onJoin(String channeljoined, String sender, String login, String hostname) {
Bukkit.getLogger().log(Level.INFO, "Channel joined: " + channeljoined + ". IRC channel: " + IRC.channel + "." );
if(channeljoined == IRC.channel)
{
Bukkit.getLogger().log(Level.INFO, "--");
for (Player player : Bukkit.getOnlinePlayers()) {
player.sendMessage(ChatColor.translateAlternateColorCodes('&',"&c[IRC]&e " + sender + "&f has joined the IRC channel."));
}
}
}
My IRC class has this:
Class: IRC.java
public static String channel;
Then I change the channel to a String got from a config file:
Class: IRC.java
channel = this.getConfig().getString("publicchannel");
And now whenever a user joins the IRC channel it prints:
[11:03:53 INFO]: Channel joined: #MoMoMC. IRC channel: #MoMoMC.
But it won't proceed to the next if statement. Am I doing something wrong?