mirror of
https://github.com/Minestom/Minestom.git
synced 2024-09-28 14:37:31 +02:00
instanceof pattern matching in LocalCache
This commit is contained in:
parent
d46db09080
commit
72461ade73
@ -37,8 +37,8 @@ public final class LocalCache<T> {
|
|||||||
|
|
||||||
public T get() {
|
public T get() {
|
||||||
Thread current = Thread.currentThread();
|
Thread current = Thread.currentThread();
|
||||||
if (current instanceof MinestomThread) {
|
if (current instanceof MinestomThread minestomThread) {
|
||||||
return ((MinestomThread) current).localCache(tickIndex, supplier);
|
return minestomThread.localCache(tickIndex, supplier);
|
||||||
}
|
}
|
||||||
return fallback.get();
|
return fallback.get();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user