mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-03 22:24:43 +02:00
Initial annotation usage cleanup + EditorConfig
This commit is contained in:
@ -31,8 +31,8 @@ import com.plotsquared.core.uuid.UUIDMapping;
|
||||
import com.plotsquared.core.uuid.UUIDService;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@ -43,7 +43,8 @@ import java.util.UUID;
|
||||
*/
|
||||
public class OfflinePlayerUUIDService implements UUIDService {
|
||||
|
||||
@Override @Nonnull public List<UUIDMapping> getNames(@Nonnull final List<UUID> uuids) {
|
||||
@Override
|
||||
public @NonNull List<UUIDMapping> getNames(final @NonNull List<UUID> uuids) {
|
||||
if (Settings.UUID.FORCE_LOWERCASE || Bukkit.getWorlds().isEmpty()) {
|
||||
return Collections.emptyList(); // This is useless now
|
||||
}
|
||||
@ -54,14 +55,16 @@ public class OfflinePlayerUUIDService implements UUIDService {
|
||||
if (offlinePlayer.hasPlayedBefore()) {
|
||||
wrappers.add(new UUIDMapping(uuid, offlinePlayer.getName()));
|
||||
}
|
||||
} catch (final Exception ignored) {} /* This can be safely ignored. If this happens, it is
|
||||
} catch (final Exception ignored) {
|
||||
} /* This can be safely ignored. If this happens, it is
|
||||
probably because it's called before the worlds have
|
||||
been loaded. This is bad, but does not break anything */
|
||||
}
|
||||
return wrappers;
|
||||
}
|
||||
|
||||
@Override @Nonnull public List<UUIDMapping> getUUIDs(@Nonnull final List<String> usernames) {
|
||||
@Override
|
||||
public @NonNull List<UUIDMapping> getUUIDs(final @NonNull List<String> usernames) {
|
||||
final List<UUIDMapping> wrappers = new ArrayList<>(usernames.size());
|
||||
for (final String username : usernames) {
|
||||
if (Settings.UUID.OFFLINE) {
|
||||
|
Reference in New Issue
Block a user