From d8db66001bf340c5b7f1df8dc2bd2bde7e1689e6 Mon Sep 17 00:00:00 2001 From: Emmanuel Lampe Date: Thu, 15 Feb 2024 01:50:30 +0100 Subject: [PATCH] fix: mark event as async if dispatched async (#7) * fix: mark event as async if dispatched async * bump 0.2.2 --------- Co-authored-by: Netherwhal --- build.gradle | 2 +- .../net/simplyvanilla/simplyvotifier/model/VotifierEvent.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 7b930d9..b5d599e 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ plugins { } group 'net.simplyvanilla' -version '0.2.1' +version '0.2.2' java { toolchain.languageVersion.set(JavaLanguageVersion.of(17)) diff --git a/src/main/java/net/simplyvanilla/simplyvotifier/model/VotifierEvent.java b/src/main/java/net/simplyvanilla/simplyvotifier/model/VotifierEvent.java index 2984ff9..69f8cd3 100644 --- a/src/main/java/net/simplyvanilla/simplyvotifier/model/VotifierEvent.java +++ b/src/main/java/net/simplyvanilla/simplyvotifier/model/VotifierEvent.java @@ -1,6 +1,7 @@ package net.simplyvanilla.simplyvotifier.model; import lombok.Getter; +import org.bukkit.Bukkit; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; @@ -29,6 +30,7 @@ public class VotifierEvent extends Event { * @param vote vote record */ public VotifierEvent(final Vote vote) { + super(!Bukkit.isPrimaryThread()); this.vote = vote; }