bane mechanic complete - working

This commit is contained in:
FatBoy committed 2025-01-03 20:41:11 -06:00
1 parent 25c1f34c23
commit 1926deb7f9
2 files changed
+12 -6

No files matched your search

+6 -2
View File
@@ -1063,15 +1063,19 @@ public class City extends AbstractWorldObject {
private void onExitBane() {
Iterator<Integer> iterator = this.baneAttendees.keySet().iterator();
ArrayList<Integer> toRemove = new ArrayList<>();
while (iterator.hasNext()) {
Integer uuid = iterator.next();
if (!_playerMemory.contains(uuid)) {
long timeGone = System.currentTimeMillis() - this.baneAttendees.get(uuid).longValue();
if (timeGone > 180000) { // 3 minutes
iterator.remove();
if (timeGone > 180000L) { // 3 minutes
toRemove.add(uuid);
}
}
}
for(int uuid : toRemove){
this.baneAttendees.remove(uuid);
}
}