mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-08 11:50:36 +01:00
Use method reference to create tick threads
This commit is contained in:
parent
a25a764991
commit
2608071ee4
@ -33,7 +33,7 @@ public final class ThreadDispatcher<P> {
|
|||||||
private ThreadDispatcher(ThreadProvider<P> provider, int threadCount) {
|
private ThreadDispatcher(ThreadProvider<P> provider, int threadCount) {
|
||||||
this.provider = provider;
|
this.provider = provider;
|
||||||
TickThread[] threads = new TickThread[threadCount];
|
TickThread[] threads = new TickThread[threadCount];
|
||||||
Arrays.setAll(threads, i -> new TickThread(i));
|
Arrays.setAll(threads, TickThread::new);
|
||||||
this.threads = List.of(threads);
|
this.threads = List.of(threads);
|
||||||
this.threads.forEach(Thread::start);
|
this.threads.forEach(Thread::start);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user