[ci-skip] Don't cancel TPSBar task if it wasn't started

This commit is contained in:
jmp
2021-01-09 17:56:11 -08:00
parent c32e46e82c
commit 4a9c0163d9

View File

@@ -84,7 +84,7 @@ index 0000000000000000000000000000000000000000..508575963816ba4f21371bf9e3703337
+}
diff --git a/src/main/java/net/pl3x/purpur/task/TPSBarTask.java b/src/main/java/net/pl3x/purpur/task/TPSBarTask.java
new file mode 100644
index 0000000000000000000000000000000000000000..362c586aeecc8a2b1a4a736f01a9fb9f833b14e9
index 0000000000000000000000000000000000000000..170f01516aab72e5b192695a73602ff656ef4ca5
--- /dev/null
+++ b/src/main/java/net/pl3x/purpur/task/TPSBarTask.java
@@ -0,0 +1,106 @@
@@ -183,14 +183,14 @@ index 0000000000000000000000000000000000000000..362c586aeecc8a2b1a4a736f01a9fb9f
+ }
+
+ public static void start() {
+ if (instance != null) {
+ instance.cancel();
+ }
+ stop();
+ instance = new TPSBarTask();
+ instance.runTaskTimerAsynchronously(new MinecraftInternalPlugin(), 20L, 20L);
+ }
+
+ public static void stop() {
+ instance.cancel();
+ if (instance != null) {
+ instance.cancel();
+ }
+ }
+}