diff --git a/build.gradle b/build.gradle index c1a9048..6db7b14 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { } group = 'it.ohalee.minecraftgpt' -version = '1.2.6' +version = '1.2.7' sourceCompatibility = 1.17 targetCompatibility = 1.17 diff --git a/src/main/java/it/ohalee/minecraftgpt/handler/ChatHandler.java b/src/main/java/it/ohalee/minecraftgpt/handler/ChatHandler.java index 27cd85b..d0c6673 100644 --- a/src/main/java/it/ohalee/minecraftgpt/handler/ChatHandler.java +++ b/src/main/java/it/ohalee/minecraftgpt/handler/ChatHandler.java @@ -5,6 +5,7 @@ import it.ohalee.minecraftgpt.OpenAI; import it.ohalee.minecraftgpt.Type; import it.ohalee.minecraftgpt.util.Messages; import lombok.RequiredArgsConstructor; +import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; @@ -59,8 +60,13 @@ public class ChatHandler implements Listener { } private void sendMessage(String message, Collection players) { + Bukkit.getOnlinePlayers().stream() + .filter(player -> !players.contains(player) && player.hasPermission("minecraftgpt.receive")) + .forEach(player -> player.sendMessage(message)); + for (Player player : players) player.sendMessage(message); + if (plugin.getConfig().getBoolean("send-messages-to-console", true)) plugin.getServer().getConsoleSender().sendMessage(message); } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index b88216f..18f0056 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: MinecraftGPT main: it.ohalee.minecraftgpt.Main -version: 1.2.6 +version: 1.2.7 author: ohAlee description: A Minecraft plugin that uses ChatGPT api-version: 1.16