Skip to content

Commit 5fe4fce

Browse files
committed
schedule run event
1 parent a103cbc commit 5fe4fce

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

plugin/src/main/java/me/hsgamer/topper/spigot/plugin/template/SpigotTopTemplate.java

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,21 @@ public void start() {
9898
@Override
9999
public void enable() {
100100
super.enable();
101-
getEntryConsumeManager().addConsumer((context) -> Bukkit.getPluginManager().callEvent(new GenericEntryUpdateEvent(
102-
context.group,
103-
context.holder,
104-
context.uuid,
105-
context.oldValue,
106-
context.value,
107-
true
108-
)));
101+
getEntryConsumeManager().addConsumer(
102+
(context) ->
103+
AsyncScheduler.get(plugin).run(
104+
() ->
105+
Bukkit.getPluginManager().callEvent(new GenericEntryUpdateEvent(
106+
context.group,
107+
context.holder,
108+
context.uuid,
109+
context.oldValue,
110+
context.value,
111+
true
112+
)
113+
)
114+
)
115+
);
109116
}
110117

111118
public void addQueryForwardContext(Plugin plugin, String name, BiFunction<@Nullable UUID, @NotNull String, @NotNull QueryResult> query) {

0 commit comments

Comments
 (0)