From 3c54c249a1f04fd6826a932548ee9dc1e6dc70ba Mon Sep 17 00:00:00 2001 From: ZeroHD Date: Mon, 12 Jul 2021 21:36:03 +0000 Subject: [PATCH] Each player now gets the same reminder (#12) Each player now gets the same reminder + Reminders are logged to console now + Fixes #11 Co-authored-by: Joey Hines Reviewed-on: https://git.canopymc.net/Canopy/QoL/pulls/12 Reviewed-by: Etzelia Co-Authored-By: ZeroHD Co-Committed-By: ZeroHD --- src/main/java/xyz/etztech/qol/QoL.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/xyz/etztech/qol/QoL.java b/src/main/java/xyz/etztech/qol/QoL.java index 66044e4..1dc5317 100644 --- a/src/main/java/xyz/etztech/qol/QoL.java +++ b/src/main/java/xyz/etztech/qol/QoL.java @@ -1,11 +1,13 @@ package xyz.etztech.qol; +import net.md_5.bungee.api.chat.BaseComponent; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Player; import org.bukkit.plugin.RegisteredServiceProvider; import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.scheduler.BukkitRunnable; import org.dynmap.DynmapAPI; import org.dynmap.markers.Marker; import org.dynmap.markers.MarkerAPI; @@ -144,9 +146,11 @@ public class QoL extends JavaPlugin { Bukkit.getScheduler().scheduleSyncRepeatingTask(QoL.getInstance(), new Runnable() { @Override public void run() { + BaseComponent [] msg = reminder.nextReminder(); for (Player player : Bukkit.getOnlinePlayers()) { - player.spigot().sendMessage(reminder.nextReminder()); + player.spigot().sendMessage(msg); } + Bukkit.getConsoleSender().spigot().sendMessage(msg); } }, 0, EtzTechUtil.minutesToTicks(reminder.getFrequency())); }