/** * Add a listening channel to this player. * * @param channel The channel to add. */ public void addChannel(String channel) { checkArgument(listeningChannels.size() < 128, "Cannot add more than 127 channels!"); if (listeningChannels.add(channel)) { EventFactory.getInstance().callEvent(new PlayerRegisterChannelEvent(this, channel)); } }
@EventHandler public void onPlayerRegisterChannel(PlayerRegisterChannelEvent event) { // Sends custom colors on join if (event.getChannel().equals(PluginStandardValues.ChannelName)) { tcSender.send(event.getPlayer()); } }