Fix minor checkstyle issues
- Add JavaDoc where checkstyle expects it - Fix line too long issues - ...
This commit is contained in:
@@ -234,6 +234,11 @@ public class PlayerAuth {
|
||||
private float yaw;
|
||||
private float pitch;
|
||||
|
||||
/**
|
||||
* Creates a PlayerAuth object.
|
||||
*
|
||||
* @return the generated PlayerAuth
|
||||
*/
|
||||
public PlayerAuth build() {
|
||||
PlayerAuth auth = new PlayerAuth();
|
||||
auth.nickname = checkNotNull(name).toLowerCase();
|
||||
@@ -277,6 +282,12 @@ public class PlayerAuth {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the location info based on the argument.
|
||||
*
|
||||
* @param location the location info to set
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder location(Location location) {
|
||||
this.x = location.getX();
|
||||
this.y = location.getY();
|
||||
|
||||
+5
-5
@@ -57,7 +57,7 @@ class DistributedFilesPersistenceHandler implements LimboPersistenceHandler {
|
||||
|
||||
@Override
|
||||
public LimboPlayer getLimboPlayer(Player player) {
|
||||
String uuid = PlayerUtils.getUUIDorName(player);
|
||||
String uuid = PlayerUtils.getUuidOrName(player);
|
||||
File file = getPlayerSegmentFile(uuid);
|
||||
Map<String, LimboPlayer> entries = readLimboPlayers(file);
|
||||
return entries == null ? null : entries.get(uuid);
|
||||
@@ -65,7 +65,7 @@ class DistributedFilesPersistenceHandler implements LimboPersistenceHandler {
|
||||
|
||||
@Override
|
||||
public void saveLimboPlayer(Player player, LimboPlayer limbo) {
|
||||
String uuid = PlayerUtils.getUUIDorName(player);
|
||||
String uuid = PlayerUtils.getUuidOrName(player);
|
||||
File file = getPlayerSegmentFile(uuid);
|
||||
|
||||
Map<String, LimboPlayer> entries = null;
|
||||
@@ -79,17 +79,17 @@ class DistributedFilesPersistenceHandler implements LimboPersistenceHandler {
|
||||
entries = new HashMap<>();
|
||||
}
|
||||
|
||||
entries.put(PlayerUtils.getUUIDorName(player), limbo);
|
||||
entries.put(PlayerUtils.getUuidOrName(player), limbo);
|
||||
saveEntries(entries, file);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeLimboPlayer(Player player) {
|
||||
String uuid = PlayerUtils.getUUIDorName(player);
|
||||
String uuid = PlayerUtils.getUuidOrName(player);
|
||||
File file = getPlayerSegmentFile(uuid);
|
||||
if (file.exists()) {
|
||||
Map<String, LimboPlayer> entries = readLimboPlayers(file);
|
||||
if (entries != null && entries.remove(PlayerUtils.getUUIDorName(player)) != null) {
|
||||
if (entries != null && entries.remove(PlayerUtils.getUuidOrName(player)) != null) {
|
||||
saveEntries(entries, file);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -39,7 +39,7 @@ class IndividualFilesPersistenceHandler implements LimboPersistenceHandler {
|
||||
|
||||
@Override
|
||||
public LimboPlayer getLimboPlayer(Player player) {
|
||||
String id = PlayerUtils.getUUIDorName(player);
|
||||
String id = PlayerUtils.getUuidOrName(player);
|
||||
File file = new File(cacheDir, id + File.separator + "data.json");
|
||||
if (!file.exists()) {
|
||||
return null;
|
||||
@@ -56,7 +56,7 @@ class IndividualFilesPersistenceHandler implements LimboPersistenceHandler {
|
||||
|
||||
@Override
|
||||
public void saveLimboPlayer(Player player, LimboPlayer limboPlayer) {
|
||||
String id = PlayerUtils.getUUIDorName(player);
|
||||
String id = PlayerUtils.getUuidOrName(player);
|
||||
try {
|
||||
File file = new File(cacheDir, id + File.separator + "data.json");
|
||||
Files.createParentDirs(file);
|
||||
@@ -75,7 +75,7 @@ class IndividualFilesPersistenceHandler implements LimboPersistenceHandler {
|
||||
*/
|
||||
@Override
|
||||
public void removeLimboPlayer(Player player) {
|
||||
String id = PlayerUtils.getUUIDorName(player);
|
||||
String id = PlayerUtils.getUuidOrName(player);
|
||||
File file = new File(cacheDir, id);
|
||||
if (file.exists()) {
|
||||
FileUtils.purgeDirectory(file);
|
||||
|
||||
Reference in New Issue
Block a user