All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.cwcode.commands.velocityplatform.argument.OnlinePlayersWithoutSender Maven / Gradle / Ivy

package ru.cwcode.commands.velocityplatform.argument;

import ru.cwcode.commands.api.Sender;
import ru.cwcode.commands.velocityplatform.velocity.VelocitySender;

import java.util.List;

public class OnlinePlayersWithoutSender extends OnlinePlayers {
  @Override
  public List completions(Sender sender) {
    List completions = super.completions(sender);
    
    if (sender.isPlayer() && sender instanceof VelocitySender velocitySender) {
      completions.remove(velocitySender.getPlayer().getUsername());
    }
    
    return completions;
  }
  
  @Override
  public String argumentName() {
    return super.argumentName();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy