Exemplo n.º 1
0
 public void postLoad(Channel channel) {
   String path = "channels." + channel.getName();
   for (String n : getNode(path + ".listeners").getStringList()) {
     Chatter chatter = plugin.getChatters().get(n);
     if (chatter == null) {
       continue;
     }
     channel.addListener(chatter);
   }
 }
Exemplo n.º 2
0
 /**
  * Bans a name from the channel
  *
  * @param name of chatter
  * @param kick whether to kick if online
  * @param reason for kick
  */
 public void ban(String name, boolean kick, ChatArguments reason) {
   ChannelBanEvent event =
       plugin
           .getEngine()
           .getEventManager()
           .callEvent(new ChannelBanEvent(this, name, kick, reason));
   if (event.isCancelled()) {
     return;
   }
   name = event.getName();
   if (event.isKicked()) {
     Chatter chatter = plugin.getChatters().get(name);
     if (chatter == null) {
       return;
     }
     chatter.kick(this, event.getReason());
   }
   banned.add(name);
   if (autoSave) {
     save();
   }
 }