mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-25 03:55:22 +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 {
|
public class AnnouncerTask extends BukkitRunnable {
|
||||||
|
|
||||||
|
DungeonsXL plugin = DungeonsXL.getInstance();
|
||||||
|
|
||||||
private List<Announcer> announcers;
|
private List<Announcer> announcers;
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
@ -40,9 +42,13 @@ public class AnnouncerTask extends BukkitRunnable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
Announcer announcer = announcers.get(index);
|
||||||
|
List<String> worlds = announcer.getWorlds();
|
||||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||||
if (!(DungeonsXL.getInstance().getDPlayers().getByPlayer(player) instanceof DInstancePlayer)) {
|
if (!(plugin.getDPlayers().getByPlayer(player) instanceof DInstancePlayer)) {
|
||||||
announcers.get(index).send(player);
|
if (worlds == null || worlds.contains(player.getWorld().getName())) {
|
||||||
|
announcer.send(player);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user