mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-27 22:16:28 +01: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() {
|
||||
Thread current = Thread.currentThread();
|
||||
if (current instanceof MinestomThread) {
|
||||
return ((MinestomThread) current).localCache(tickIndex, supplier);
|
||||
if (current instanceof MinestomThread minestomThread) {
|
||||
return minestomThread.localCache(tickIndex, supplier);
|
||||
}
|
||||
return fallback.get();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user