Skip to content

Commit 6073966

Browse files
committed
fix: no-tick pending chunk loads counter
1 parent 2204d33 commit 6073966

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

c2me-notickvd/src/main/java/com/ishland/c2me/notickvd/common/PlayerNoTickLoader.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,6 @@ public void tick() {
114114
}
115115

116116
this.tickFutures();
117-
118-
{
119-
long pendingLoadsCount = 0L;
120-
ObjectBidirectionalIterator<Long2ReferenceMap.Entry<ChunkIterator>> iterator = this.iterators.long2ReferenceEntrySet().fastIterator();
121-
while (iterator.hasNext()) {
122-
Long2ReferenceMap.Entry<ChunkIterator> entry = iterator.next();
123-
pendingLoadsCount += entry.getValue().remaining();
124-
}
125-
this.pendingLoadsCountSnapshot = pendingLoadsCount;
126-
}
127117
}
128118

129119
private void clearTickets() {
@@ -142,6 +132,16 @@ void tickFutures() {
142132

143133
if (this.closing.get()) return;
144134
while (this.chunkLoadFutures.size() < Config.maxConcurrentChunkLoads && this.addOneTicket());
135+
136+
{
137+
long pendingLoadsCount = 0L;
138+
ObjectBidirectionalIterator<Long2ReferenceMap.Entry<ChunkIterator>> iterator = this.iterators.long2ReferenceEntrySet().fastIterator();
139+
while (iterator.hasNext()) {
140+
Long2ReferenceMap.Entry<ChunkIterator> entry = iterator.next();
141+
pendingLoadsCount += entry.getValue().remaining();
142+
}
143+
this.pendingLoadsCountSnapshot = pendingLoadsCount;
144+
}
145145
}
146146

147147
private boolean addOneTicket() {

0 commit comments

Comments
 (0)