Each player now gets the same reminder

+ Reminders are logged to console now
+ Fixes #11
pull/12/head
Joey Hines 2021-07-11 16:29:51 -06:00
parent 3ae415d7d0
commit 7b39f4590a
No known key found for this signature in database
GPG Key ID: 80F567B5C968F91B
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()));
} }