mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
[ci-skip] Don't cancel TPSBar task if it wasn't started
This commit is contained in:
@@ -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();
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
|
||||
Reference in New Issue
Block a user