mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-27 21:29:47 +01:00
Don't send messages to command blocks async
This commit is contained in:
parent
0acefde805
commit
c57947949c
@ -32,6 +32,7 @@ import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||
|
||||
import net.kyori.text.Component;
|
||||
|
||||
import org.bukkit.command.BlockCommandSender;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -63,6 +64,13 @@ public class BukkitSenderFactory extends SenderFactory<CommandSender> {
|
||||
|
||||
@Override
|
||||
protected void sendMessage(CommandSender sender, String s) {
|
||||
|
||||
// send sync if command block
|
||||
if (sender instanceof BlockCommandSender) {
|
||||
getPlugin().getScheduler().doSync(() -> sender.sendMessage(s));
|
||||
return;
|
||||
}
|
||||
|
||||
sender.sendMessage(s);
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,8 @@
|
||||
|
||||
package me.lucko.luckperms.common.commands.sender;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||
@ -40,6 +42,8 @@ import java.util.UUID;
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public abstract class SenderFactory<T> {
|
||||
|
||||
@Getter(AccessLevel.PROTECTED)
|
||||
private final LuckPermsPlugin plugin;
|
||||
|
||||
protected abstract String getName(T t);
|
||||
|
Loading…
Reference in New Issue
Block a user