From 2509085dc2d30c92f25506db2db75dd861febd3e Mon Sep 17 00:00:00 2001 From: TheMode Date: Sat, 24 Apr 2021 19:56:39 +0200 Subject: [PATCH] Rename optional to local --- src/main/java/net/minestom/server/acquirable/Acquirable.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minestom/server/acquirable/Acquirable.java b/src/main/java/net/minestom/server/acquirable/Acquirable.java index a3c4c6a22..29e4963fa 100644 --- a/src/main/java/net/minestom/server/acquirable/Acquirable.java +++ b/src/main/java/net/minestom/server/acquirable/Acquirable.java @@ -43,7 +43,7 @@ public interface Acquirable { } default @NotNull Acquired 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 { AsyncUtils.runAsync(() -> sync(consumer)); } - default @NotNull Optional optional() { + default @NotNull Optional local() { final Thread currentThread = Thread.currentThread(); final TickThread tickThread = getHandler().getTickThread(); if (Objects.equals(currentThread, tickThread)) {