use of io.github.nucleuspowered.nucleus.api.exceptions.NoSuchLocationException in project Nucleus by NucleusPowered.
the class JailHandler method jailPlayer.
@Override
public boolean jailPlayer(User victim, String jail, CommandSource jailer, String reason) throws NoSuchLocationException {
Preconditions.checkNotNull(victim);
Preconditions.checkNotNull(jail);
Preconditions.checkNotNull(jailer);
Preconditions.checkNotNull(reason);
NamedLocation location = getJail(jail).orElseThrow(NoSuchLocationException::new);
return jailPlayer(victim, new JailData(Util.getUUID(jailer), location.getName(), reason, victim.getPlayer().map(Locatable::getLocation).orElse(null)));
}
Aggregations