Skip to content

Commit 8e769a1

Browse files
committed
Readd accidentally comitted code
1 parent a3a7339 commit 8e769a1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/main/java/io/github/opencubicchunks/cubicchunks/core/server/CubeProviderServer.java

+13
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@
6565
import java.util.Iterator;
6666
import java.util.List;
6767
import java.util.Optional;
68+
import java.util.Random;
6869
import java.util.Set;
70+
import java.util.function.BooleanSupplier;
6971
import java.util.function.Consumer;
7072

7173
import javax.annotation.Detainted;
@@ -225,6 +227,17 @@ public boolean saveChunks(boolean alwaysTrue) {
225227

226228
@Override
227229
public boolean tick() {
230+
// NOTE: the return value is completely ignored
231+
profiler.startSection("providerTick");
232+
long i = System.currentTimeMillis();
233+
Random rand = this.world.rand;
234+
PlayerCubeMap playerCubeMap = ((PlayerCubeMap) this.world.getPlayerChunkMap());
235+
Iterator<Cube> watchersIterator = playerCubeMap.getCubeIterator();
236+
BooleanSupplier tickFaster = () -> System.currentTimeMillis() - i > 40;
237+
while (watchersIterator.hasNext()) {
238+
watchersIterator.next().tickCubeServer(tickFaster, rand);
239+
}
240+
profiler.endSection();
228241
return false;
229242
}
230243

0 commit comments

Comments
 (0)