mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-14 04:01:58 +01:00
Change some WorldTimes methods
This commit is contained in:
parent
9ccee9a9d6
commit
b0a4d67782
@ -61,9 +61,11 @@ public class WorldTimes {
|
||||
}
|
||||
currentGMTimes.changeState(currentGamemode, changeTime);
|
||||
}
|
||||
|
||||
for (GMTimes gmTimes : worldTimes.values()) {
|
||||
gmTimes.setLastStateChange(changeTime);
|
||||
}
|
||||
|
||||
currentWorld = worldName;
|
||||
currentGamemode = gameMode;
|
||||
}
|
||||
@ -76,10 +78,7 @@ public class WorldTimes {
|
||||
*/
|
||||
public long getWorldPlaytime(String world) {
|
||||
GMTimes gmTimes = worldTimes.get(world);
|
||||
if (gmTimes != null) {
|
||||
return gmTimes.getTotal();
|
||||
}
|
||||
return 0;
|
||||
return gmTimes != null ? gmTimes.getTotal() : 0;
|
||||
}
|
||||
|
||||
public long getTotal() {
|
||||
@ -99,11 +98,7 @@ public class WorldTimes {
|
||||
* @return GMTimes object with play times of each GameMode.
|
||||
*/
|
||||
public GMTimes getGMTimes(String world) {
|
||||
GMTimes gmTimes = worldTimes.get(world);
|
||||
if (gmTimes != null) {
|
||||
return gmTimes;
|
||||
}
|
||||
return new GMTimes();
|
||||
return worldTimes.getOrDefault(world, new GMTimes());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user