mirror of https://github.com/Minestom/Minestom.git
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