Rename optional to local

This commit is contained in:
TheMode 2021-04-24 19:56:39 +02:00
parent 34d10e57fa
commit 2509085dc2

View File

@ -43,7 +43,7 @@ public interface Acquirable<T> {
}
default @NotNull Acquired<T> lock() {
var optional = optional();
var optional = local();
if (optional.isPresent()) {
return new Acquired<>(optional.get(), false, null);
} else {
@ -65,7 +65,7 @@ public interface Acquirable<T> {
AsyncUtils.runAsync(() -> sync(consumer));
}
default @NotNull Optional<T> optional() {
default @NotNull Optional<T> local() {
final Thread currentThread = Thread.currentThread();
final TickThread tickThread = getHandler().getTickThread();
if (Objects.equals(currentThread, tickThread)) {