Each player now gets the same reminder #12

Merged
ZeroHD merged 1 commits from refs/pull/12/head into main 2021-07-12 21:36:03 +00:00
1 changed files with 5 additions and 1 deletions

View File

@ -1,11 +1,13 @@
package xyz.etztech.qol; package xyz.etztech.qol;
import net.md_5.bungee.api.chat.BaseComponent;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.plugin.RegisteredServiceProvider; import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.dynmap.DynmapAPI; import org.dynmap.DynmapAPI;
import org.dynmap.markers.Marker; import org.dynmap.markers.Marker;
import org.dynmap.markers.MarkerAPI; import org.dynmap.markers.MarkerAPI;
@ -144,9 +146,11 @@ public class QoL extends JavaPlugin {
Bukkit.getScheduler().scheduleSyncRepeatingTask(QoL.getInstance(), new Runnable() { Bukkit.getScheduler().scheduleSyncRepeatingTask(QoL.getInstance(), new Runnable() {
@Override @Override
public void run() { public void run() {
BaseComponent [] msg = reminder.nextReminder();
for (Player player : Bukkit.getOnlinePlayers()) { for (Player player : Bukkit.getOnlinePlayers()) {
player.spigot().sendMessage(reminder.nextReminder()); player.spigot().sendMessage(msg);
} }
Bukkit.getConsoleSender().spigot().sendMessage(msg);
} }
}, 0, EtzTechUtil.minutesToTicks(reminder.getFrequency())); }, 0, EtzTechUtil.minutesToTicks(reminder.getFrequency()));
} }