mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-02 16:59:42 +01:00
Using correct way to register listener
This commit is contained in:
parent
8a4b23649d
commit
81992a5676
@ -18,15 +18,11 @@ public class SpongeTaskSystem extends ServerTaskSystem {
|
||||
@Override
|
||||
public void enable() {
|
||||
super.enable();
|
||||
try {
|
||||
PingCountTimerSponge pingCountTimer = new PingCountTimerSponge();
|
||||
Sponge.getEventManager().registerListeners(plugin, pingCountTimer);
|
||||
long startDelay = TimeAmount.SECOND.ticks() * (long) Settings.PING_SERVER_ENABLE_DELAY.getNumber();
|
||||
RunnableFactory.createNew("PingCountTimer", pingCountTimer)
|
||||
.runTaskTimer(startDelay, PingCountTimerSponge.PING_INTERVAL);
|
||||
} catch (ExceptionInInitializerError | NoClassDefFoundError ignore) {
|
||||
// Running CraftBukkit
|
||||
}
|
||||
PingCountTimerSponge pingCountTimer = new PingCountTimerSponge();
|
||||
((PlanSponge) plugin).registerListener(pingCountTimer);
|
||||
long startDelay = TimeAmount.SECOND.ticks() * (long) Settings.PING_SERVER_ENABLE_DELAY.getNumber();
|
||||
RunnableFactory.createNew("PingCountTimer", pingCountTimer)
|
||||
.runTaskTimer(startDelay, PingCountTimerSponge.PING_INTERVAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user