mirror of
https://github.com/garbagemule/MobArena.git
synced 2025-02-09 17:11:35 +01:00
Make start-delay stop auto-start.
This commit is contained in:
parent
2e366f4bee
commit
9fb579b2ff
@ -61,15 +61,24 @@ public class StartDelayTimer extends CountdownTimer implements TimerCallback {
|
||||
|
||||
@Override
|
||||
public synchronized void start() {
|
||||
// Start auto-start-timer if arena has no start-delay
|
||||
// Start auto-start-timer if arena has no start-delay (both idempotent)
|
||||
if (super.getDuration() > 0) {
|
||||
super.start();
|
||||
} else {
|
||||
// Idempotent
|
||||
autoStartTimer.start();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void stop() {
|
||||
// Stop auto-start-timer if arena has no start-delay (both idempotent)
|
||||
if (super.getDuration() > 0) {
|
||||
super.stop();
|
||||
} else {
|
||||
autoStartTimer.stop();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
internalCallback.onStart();
|
||||
|
Loading…
Reference in New Issue
Block a user