Ejemplo n.º 1
0
 /**
  * Removes a channel from a player without unsubscribing
  *
  * @return
  * @throws LeaveChannelException
  */
 public void removeChannel(Channel channel) throws LeaveChannelException {
   if (channel != null) {
     channels.remove(channel.getShortName().toLowerCase());
     if (channels.size() > 0) {
       setFocused(FancyChat.getChannelRegistry().getChannel(channels.get(0)));
     }
     return;
   }
   throw new LeaveChannelException("Removing channel player is not subscribed to.");
 }
Ejemplo n.º 2
0
 /** @return */
 public ArrayList<Channel> getChannels() {
   ArrayList<Channel> playerChannels = new ArrayList<>();
   if (!channels.isEmpty()) {
     for (String alias : channels) {
       Channel c = FancyChat.getChannelRegistry().getChannel(alias);
       if (c != null) {
         playerChannels.add(c);
       }
     }
   }
   return playerChannels;
 }
Ejemplo n.º 3
0
 /** @return */
 public Channel getFocused() {
   if (focusedChannel != null) {
     return FancyChat.getChannelRegistry().getChannel(focusedChannel);
   }
   return null;
 }