From cb1c779f372782979d337785f26e40d63968bc62 Mon Sep 17 00:00:00 2001 From: Keir Date: Tue, 27 Oct 2015 22:15:06 +0000 Subject: [PATCH] Close player report if the reported player leaves the game mid-report. --- .../src/mineplex/core/report/ReportPlugin.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/report/ReportPlugin.java b/Plugins/Mineplex.Core/src/mineplex/core/report/ReportPlugin.java index 8ed58381d..c8914b8a4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/report/ReportPlugin.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/report/ReportPlugin.java @@ -5,6 +5,8 @@ import mineplex.core.report.command.ReportCloseCommand; import mineplex.core.report.command.ReportCommand; import mineplex.core.report.command.ReportHandleCommand; +import org.bukkit.event.EventHandler; +import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.plugin.java.JavaPlugin; public class ReportPlugin extends MiniPlugin @@ -28,4 +30,10 @@ public class ReportPlugin extends MiniPlugin addCommand(new ReportCloseCommand(this)); //AddCommand(new ReportDebugCommand(this)); } + + @EventHandler + public void onPlayerQuit(PlayerQuitEvent e) + { + ReportManager.getInstance().onPlayerQuit(e.getPlayer()); + } }