Move announcer task initialization to main class

This commit is contained in:
Daniel Saukel 2016-05-14 15:27:18 +02:00
parent a227d8628d
commit b7bc91fd68
4 changed files with 19 additions and 4 deletions

View File

@ -69,7 +69,7 @@ Instead of referencing the internals of the implementation directly, DungeonsXL
The shaded version of DXL (standard version) contains this library, while the original version needs it as an external plugin. The shaded version of DXL (standard version) contains this library, while the original version needs it as an external plugin.
Have a look at the [installation instructions](../../wiki/getting-started#installation) for detailed information. Have a look at the [installation instructions](../../wiki/getting-started#installation) for detailed information.
DungeonsXL currently uses BRCommons 0.6.2. DungeonsXL currently uses BRCommons 0.6.3.
### Java ### Java
7 and higher 7 and higher

View File

@ -67,7 +67,7 @@
<dependency> <dependency>
<groupId>io.github.dre2n</groupId> <groupId>io.github.dre2n</groupId>
<artifactId>commons</artifactId> <artifactId>commons</artifactId>
<version>0.6.2</version> <version>0.6.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.github.dre2n</groupId> <groupId>io.github.dre2n</groupId>

View File

@ -42,6 +42,7 @@ import io.github.dre2n.dungeonsxl.requirement.RequirementTypes;
import io.github.dre2n.dungeonsxl.reward.DLootInventory; import io.github.dre2n.dungeonsxl.reward.DLootInventory;
import io.github.dre2n.dungeonsxl.reward.RewardTypes; import io.github.dre2n.dungeonsxl.reward.RewardTypes;
import io.github.dre2n.dungeonsxl.sign.DSignTypes; import io.github.dre2n.dungeonsxl.sign.DSignTypes;
import io.github.dre2n.dungeonsxl.task.AnnouncerTask;
import io.github.dre2n.dungeonsxl.task.LazyUpdateTask; import io.github.dre2n.dungeonsxl.task.LazyUpdateTask;
import io.github.dre2n.dungeonsxl.task.SecureModeTask; import io.github.dre2n.dungeonsxl.task.SecureModeTask;
import io.github.dre2n.dungeonsxl.task.UpdateTask; import io.github.dre2n.dungeonsxl.task.UpdateTask;
@ -85,6 +86,7 @@ public class DungeonsXL extends BRPlugin {
private DPlayers dPlayers; private DPlayers dPlayers;
private Announcers announcers; private Announcers announcers;
private BukkitTask announcerTask;
private BukkitTask worldUnloadTask; private BukkitTask worldUnloadTask;
private BukkitTask lazyUpdateTask; private BukkitTask lazyUpdateTask;
private BukkitTask updateTask; private BukkitTask updateTask;
@ -155,6 +157,7 @@ public class DungeonsXL extends BRPlugin {
loadAll(); loadAll();
// Tasks // Tasks
startAnnouncerTsak(200L);
startWorldUnloadTask(1200L); startWorldUnloadTask(1200L);
startLazyUpdateTask(20L); startLazyUpdateTask(20L);
startUpdateTask(20L); startUpdateTask(20L);
@ -501,6 +504,20 @@ public class DungeonsXL extends BRPlugin {
return worldUnloadTask; return worldUnloadTask;
} }
/**
* start a new AnnouncerTask
*/
public void startAnnouncerTask(long period) {
announcerTask = new AnnouncerTask(announcers).runTaskTimer(this, 0L, period);
}
/**
* @return the AnnouncerTask
*/
public BukkitTask getAnnouncerTask() {
return announcerTask;
}
/** /**
* start a new WorldUnloadTask * start a new WorldUnloadTask
*/ */

View File

@ -53,8 +53,6 @@ public class Announcers {
announcers.add(new Announcer(name, description, worlds, identifier, multiFloor, maxGroupsPerGame, maxPlayersPerGroup)); announcers.add(new Announcer(name, description, worlds, identifier, multiFloor, maxGroupsPerGame, maxPlayersPerGroup));
} }
} }
new AnnouncerTask(this).runTaskTimer(DungeonsXL.getInstance(), 0, 200);
} }
/** /**