Each player now gets the same reminder
+ Reminders are logged to console now + Fixes #11pull/12/head
parent
3ae415d7d0
commit
7b39f4590a
|
@ -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()));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue