From 56d9b406a4a5c16c931d710520842e6d3eb39eb4 Mon Sep 17 00:00:00 2001 From: HappyPikachu Date: Mon, 28 Aug 2017 18:57:28 -0400 Subject: [PATCH] Stop timers upon quit, untested, fixes #114. Bump version number --- pom.xml | 2 +- src/main/java/me/blackvein/quests/Quester.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 250e78382..bef596223 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ me.blackvein.quests quests - 3.0.4 + 3.0.5 quests https://github.com/FlyingPikachu/Quests/ jar diff --git a/src/main/java/me/blackvein/quests/Quester.java b/src/main/java/me/blackvein/quests/Quester.java index c2e51807a..bd3531dc0 100644 --- a/src/main/java/me/blackvein/quests/Quester.java +++ b/src/main/java/me/blackvein/quests/Quester.java @@ -2534,6 +2534,14 @@ public class Quester { if (questData.containsKey(quest)) { questData.remove(quest); } + if (!timers.isEmpty()) { + for (Map.Entry entry : timers.entrySet()) { + if (entry.getValue().getName().equals(quest.getName())) { + plugin.getServer().getScheduler().cancelTask(entry.getKey()); + timers.remove(entry.getKey()); + } + } + } } catch (Exception ex) { ex.printStackTrace(); }