From 4a9c0163d9d5048f14c74d24a0d5e73fdaebb1f6 Mon Sep 17 00:00:00 2001 From: jmp Date: Sat, 9 Jan 2021 17:56:11 -0800 Subject: [PATCH] [ci-skip] Don't cancel TPSBar task if it wasn't started --- patches/server/0160-Implement-TPSBar.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/patches/server/0160-Implement-TPSBar.patch b/patches/server/0160-Implement-TPSBar.patch index a1467d529..a59d34d6a 100644 --- a/patches/server/0160-Implement-TPSBar.patch +++ b/patches/server/0160-Implement-TPSBar.patch @@ -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(); ++ } + } +}