File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/main/java/io/github/opencubicchunks/cubicchunks/core/server Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 6565import java .util .Iterator ;
6666import java .util .List ;
6767import java .util .Optional ;
68+ import java .util .Random ;
6869import java .util .Set ;
70+ import java .util .function .BooleanSupplier ;
6971import java .util .function .Consumer ;
7072
7173import 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
You can’t perform that action at this time.
0 commit comments