Safely call VentureChatEvent

This commit is contained in:
cnaude 2019-12-28 18:54:55 -07:00
parent e24ee5d94f
commit b43d7a53d2
3 changed files with 8 additions and 3 deletions

6
.gitignore vendored
View File

@ -3,4 +3,8 @@
/dependency-reduced-pom.xml
/.idea/
/*.iml
/*.iml
.classpath
.project
.settings

View File

@ -225,7 +225,7 @@
<dependency>
<groupId>com.cnaude.venturechat</groupId>
<artifactId>VentureChat</artifactId>
<version>2.17.0</version>
<version>2.17.1</version>
</dependency>
<!-- Jobs -->

View File

@ -66,6 +66,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
import me.botsko.prism.actionlibs.QueryParameters;
import me.botsko.prism.events.BlockStateChange;
import org.bukkit.Achievement;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Location;
@ -1359,7 +1360,7 @@ public final class PurpleBot {
}
if (plugin.ventureChatEnabled) {
plugin.logDebug("Calling VentureChatEvent: " + event.getMessage());
plugin.getServer().getPluginManager().callEvent(new VentureChatEvent(event, this, channelName));
plugin.getServer().getScheduler().runTask(plugin, () -> plugin.getServer().getPluginManager().callEvent(new VentureChatEvent(event, this, channelName)));
}
if (isMessageEnabled(channelName, TemplateName.GAME_CHAT)) {
asyncIRCMessage(channelName, plugin.tokenizer