mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-23 00:21:43 +01:00
Removes redundant casts and array creations
This commit is contained in:
parent
0f14efbc46
commit
f1ae1c3f8f
@ -58,7 +58,7 @@ public class PlanDeathEventListener implements Listener {
|
||||
handler.addToPool(new KillInfo(killer.getUniqueId(), time, dead, itemInHand.name()));
|
||||
}
|
||||
if (dead instanceof Player) {
|
||||
handler.addToPool(new DeathInfo(((Player) dead).getUniqueId()));
|
||||
handler.addToPool(new DeathInfo(dead.getUniqueId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ public class PunchCardGraphCreator {
|
||||
for (int j = 0; j < 24; j++) {
|
||||
int value = dataArray[i][j];
|
||||
if (value - avg > 3 * standardDiviation) {
|
||||
dataArray[i][j] = (int) (avg);
|
||||
dataArray[i][j] = avg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ public class NewPlayerCreator {
|
||||
* @return a new UserData object
|
||||
*/
|
||||
public static UserData createNewPlayer(IPlayer player) {
|
||||
return createNewPlayer((IOfflinePlayer) player, player.getGamemode());
|
||||
return createNewPlayer(player, player.getGamemode());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -45,7 +45,7 @@ public class DouglasPeckerAlgorithm {
|
||||
results.addAll(results1.subList(0, results1.size() - 1));
|
||||
results.addAll(results2);
|
||||
} else {
|
||||
return Arrays.asList(new Point[]{points.get(0), points.get(lastIndex)});
|
||||
return Arrays.asList(points.get(0), points.get(lastIndex));
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ public class ExportUtility {
|
||||
String playersHtml = PlayersPageResponse.buildContent(rawData);
|
||||
playersfolder.mkdirs();
|
||||
File playersHtmlFile = new File(playersfolder, "index.html");
|
||||
Files.write(playersHtmlFile.toPath(), Arrays.asList(new String[]{playersHtml}));
|
||||
Files.write(playersHtmlFile.toPath(), Arrays.asList(playersHtml));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ public class DatabaseTest {
|
||||
c.put("/roiergbnougbierubieugbeigubeigubgierbgeugeg", 3);
|
||||
db.saveCommandUse(c);
|
||||
assertTrue(db.removeAllData());
|
||||
assertTrue("Contains the user", db.getUserDataForUUIDS(Arrays.asList(new UUID[]{MockUtils.getPlayerUUID(), MockUtils.getPlayer2UUID()})).isEmpty());
|
||||
assertTrue("Contains the user", db.getUserDataForUUIDS(Arrays.asList(MockUtils.getPlayerUUID(), MockUtils.getPlayer2UUID())).isEmpty());
|
||||
assertTrue("Contains commandUse", db.getCommandUse().isEmpty());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user