Skip to content

Commit 093136c

Browse files
Fix a design flaw
1 parent 68d8180 commit 093136c

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

src/main/java/me/flame/menus/items/MenuItem.java

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public final class MenuItem implements Cloneable, ConfigurationSerializable {
5050
CompletableFuture<ItemResponse> clickAction;
5151

5252
@Getter @Setter
53-
boolean async;
53+
boolean async = false;
5454

5555
@NotNull
5656
ItemStack itemStack;
@@ -94,28 +94,7 @@ public ItemResponse getClickActionNow(ItemResponse ifAbsent) {
9494
return clickAction.getNow(ifAbsent);
9595
}
9696

97-
/**
98-
* Set the click action but always guaranteed to run asynchronously
99-
* @apiNote for anyone who is new to asynchronous programming, it does not make your code faster, but prevents blocking the main thread and thus prevent slowing down the thread that runs your server.
100-
* @param clickAction the clickAction
101-
*/
102-
public void setClickActionAsync(@NotNull CompletableFuture<ItemResponse> clickAction) {
103-
this.async = true;
104-
this.clickAction = clickAction;
105-
}
106-
107-
/**
108-
* Set the click action but always guaranteed to run asynchronously
109-
* @apiNote for anyone who is new to asynchronous programming, it does not make your code faster, but prevents blocking the main thread and thus prevent slowing down the thread that runs your server.
110-
* @param clickAction the clickAction
111-
*/
112-
public void setClickActionAsync(@NotNull ItemResponse clickAction) {
113-
this.async = true;
114-
this.clickAction = CompletableFuture.completedFuture(clickAction);
115-
}
116-
11797
public void setClickAction(@NotNull ItemResponse clickAction) {
118-
this.async = false;
11998
this.clickAction = CompletableFuture.completedFuture(clickAction);
12099
}
121100

0 commit comments

Comments
 (0)