mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-28 11:01:28 +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);
|
currentGMTimes.changeState(currentGamemode, changeTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (GMTimes gmTimes : worldTimes.values()) {
|
for (GMTimes gmTimes : worldTimes.values()) {
|
||||||
gmTimes.setLastStateChange(changeTime);
|
gmTimes.setLastStateChange(changeTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
currentWorld = worldName;
|
currentWorld = worldName;
|
||||||
currentGamemode = gameMode;
|
currentGamemode = gameMode;
|
||||||
}
|
}
|
||||||
@ -76,10 +78,7 @@ public class WorldTimes {
|
|||||||
*/
|
*/
|
||||||
public long getWorldPlaytime(String world) {
|
public long getWorldPlaytime(String world) {
|
||||||
GMTimes gmTimes = worldTimes.get(world);
|
GMTimes gmTimes = worldTimes.get(world);
|
||||||
if (gmTimes != null) {
|
return gmTimes != null ? gmTimes.getTotal() : 0;
|
||||||
return gmTimes.getTotal();
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getTotal() {
|
public long getTotal() {
|
||||||
@ -99,11 +98,7 @@ public class WorldTimes {
|
|||||||
* @return GMTimes object with play times of each GameMode.
|
* @return GMTimes object with play times of each GameMode.
|
||||||
*/
|
*/
|
||||||
public GMTimes getGMTimes(String world) {
|
public GMTimes getGMTimes(String world) {
|
||||||
GMTimes gmTimes = worldTimes.get(world);
|
return worldTimes.getOrDefault(world, new GMTimes());
|
||||||
if (gmTimes != null) {
|
|
||||||
return gmTimes;
|
|
||||||
}
|
|
||||||
return new GMTimes();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user