mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-03 23:17:48 +01:00
Rename optional to local
This commit is contained in:
parent
34d10e57fa
commit
2509085dc2
@ -43,7 +43,7 @@ public interface Acquirable<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
default @NotNull Acquired<T> lock() {
|
default @NotNull Acquired<T> lock() {
|
||||||
var optional = optional();
|
var optional = local();
|
||||||
if (optional.isPresent()) {
|
if (optional.isPresent()) {
|
||||||
return new Acquired<>(optional.get(), false, null);
|
return new Acquired<>(optional.get(), false, null);
|
||||||
} else {
|
} else {
|
||||||
@ -65,7 +65,7 @@ public interface Acquirable<T> {
|
|||||||
AsyncUtils.runAsync(() -> sync(consumer));
|
AsyncUtils.runAsync(() -> sync(consumer));
|
||||||
}
|
}
|
||||||
|
|
||||||
default @NotNull Optional<T> optional() {
|
default @NotNull Optional<T> local() {
|
||||||
final Thread currentThread = Thread.currentThread();
|
final Thread currentThread = Thread.currentThread();
|
||||||
final TickThread tickThread = getHandler().getTickThread();
|
final TickThread tickThread = getHandler().getTickThread();
|
||||||
if (Objects.equals(currentThread, tickThread)) {
|
if (Objects.equals(currentThread, tickThread)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user