mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-11-01 08:39:31 +01:00
Get player outside async context in BukkitChatForwarder
This commit is contained in:
parent
05f4bb47e9
commit
ad01ee5748
@ -23,6 +23,7 @@ import com.discordsrv.api.event.events.message.receive.game.GameChatMessageRecei
|
||||
import com.discordsrv.bukkit.BukkitDiscordSRV;
|
||||
import com.discordsrv.bukkit.component.PaperComponentHandle;
|
||||
import com.discordsrv.common.channel.GlobalChannel;
|
||||
import com.discordsrv.common.player.IPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.Listener;
|
||||
@ -47,10 +48,11 @@ public class BukkitChatForwarder implements IBukkitChatForwarder {
|
||||
|
||||
@Override
|
||||
public void publishEvent(Event event, Player player, MinecraftComponent component, boolean cancelled) {
|
||||
IPlayer srvPlayer = discordSRV.playerProvider().player(player);
|
||||
discordSRV.scheduler().run(() -> discordSRV.eventBus().publish(
|
||||
new GameChatMessageReceiveEvent(
|
||||
event,
|
||||
discordSRV.playerProvider().player(player),
|
||||
srvPlayer,
|
||||
component,
|
||||
new GlobalChannel(discordSRV),
|
||||
cancelled
|
||||
|
Loading…
Reference in New Issue
Block a user