mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
fix: annotate ExpireManager with @Inject
This commit is contained in:
parent
b8b3098022
commit
ebbbb6c670
@ -140,8 +140,7 @@ public class DebugExec extends SubCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case "start-expire" -> {
|
case "start-expire" -> {
|
||||||
ExpireManager expireManager = PlotSquared.platform().expireManager() == null ? new ExpireManager(this.eventDispatcher) : PlotSquared.platform().expireManager();
|
if (PlotSquared.platform().expireManager().runAutomatedTask()) {
|
||||||
if (expireManager.runAutomatedTask()) {
|
|
||||||
player.sendMessage(TranslatableCaption.of("debugexec.expiry_started"));
|
player.sendMessage(TranslatableCaption.of("debugexec.expiry_started"));
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(TranslatableCaption.of("debugexec.expiry_already_started"));
|
player.sendMessage(TranslatableCaption.of("debugexec.expiry_already_started"));
|
||||||
@ -149,7 +148,7 @@ public class DebugExec extends SubCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case "stop-expire" -> {
|
case "stop-expire" -> {
|
||||||
if (PlotSquared.platform().expireManager() == null || !PlotSquared.platform().expireManager().cancelTask()) {
|
if (!PlotSquared.platform().expireManager().cancelTask()) {
|
||||||
player.sendMessage(TranslatableCaption.of("debugexec.task_halted"));
|
player.sendMessage(TranslatableCaption.of("debugexec.task_halted"));
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(TranslatableCaption.of("debugexec.task_cancelled"));
|
player.sendMessage(TranslatableCaption.of("debugexec.task_cancelled"));
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.plot.expiration;
|
package com.plotsquared.core.plot.expiration;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import com.plotsquared.core.PlotPlatform;
|
import com.plotsquared.core.PlotPlatform;
|
||||||
import com.plotsquared.core.PlotSquared;
|
import com.plotsquared.core.PlotSquared;
|
||||||
import com.plotsquared.core.configuration.caption.Caption;
|
import com.plotsquared.core.configuration.caption.Caption;
|
||||||
@ -76,6 +77,7 @@ public class ExpireManager {
|
|||||||
*/
|
*/
|
||||||
private int running;
|
private int running;
|
||||||
|
|
||||||
|
@Inject
|
||||||
public ExpireManager(final @NonNull EventDispatcher eventDispatcher) {
|
public ExpireManager(final @NonNull EventDispatcher eventDispatcher) {
|
||||||
this.tasks = new ArrayDeque<>();
|
this.tasks = new ArrayDeque<>();
|
||||||
this.dates_cache = new ConcurrentHashMap<>();
|
this.dates_cache = new ConcurrentHashMap<>();
|
||||||
|
Loading…
Reference in New Issue
Block a user