Skip to content

Commit

Permalink
Fix chunk decay not working for teams that have been inactive for ages (
Browse files Browse the repository at this point in the history
#182)

Signed-off-by: Lyfts <127234178+Lyfts@users.noreply.github.com>
  • Loading branch information
Lyfts authored Jan 23, 2025
1 parent 6c23d5b commit 06385f8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/serverutils/lib/data/ForgeTeam.java
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,13 @@ public List<EntityPlayerMP> getOnlineMembers() {
}

public long getLastActivity() {
if (lastActivity == 0) {
long latestActivity = 0;
for (ForgePlayer player : getMembers()) {
latestActivity = Math.max(player.getLastTimeSeen(), latestActivity);
}
lastActivity = System.currentTimeMillis() - Ticks.get(universe.ticks.ticks() - latestActivity).millis();
}
return lastActivity;
}

Expand Down

0 comments on commit 06385f8

Please # to comment.