mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-28 21:48:43 +01:00
Send game announcement only to listed worlds
This commit is contained in:
parent
328e28c254
commit
3896e14ef4
@ -30,6 +30,8 @@ import org.bukkit.scheduler.BukkitRunnable;
|
||||
*/
|
||||
public class AnnouncerTask extends BukkitRunnable {
|
||||
|
||||
DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
|
||||
private List<Announcer> announcers;
|
||||
int index;
|
||||
|
||||
@ -40,9 +42,13 @@ public class AnnouncerTask extends BukkitRunnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Announcer announcer = announcers.get(index);
|
||||
List<String> worlds = announcer.getWorlds();
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
if (!(DungeonsXL.getInstance().getDPlayers().getByPlayer(player) instanceof DInstancePlayer)) {
|
||||
announcers.get(index).send(player);
|
||||
if (!(plugin.getDPlayers().getByPlayer(player) instanceof DInstancePlayer)) {
|
||||
if (worlds == null || worlds.contains(player.getWorld().getName())) {
|
||||
announcer.send(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user