From f9aa5910f2bef3584ca2d85ccc72bcf9f3c0bf5c Mon Sep 17 00:00:00 2001 From: Wizjany Date: Mon, 30 May 2011 23:58:32 -0400 Subject: [PATCH] Fixed blank lines being sent on disable --- src/main/java/com/sk89q/worldedit/LocalSession.java | 9 +++++++++ .../java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java | 7 +++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/LocalSession.java b/src/main/java/com/sk89q/worldedit/LocalSession.java index 297c31fa8..7316dbac9 100644 --- a/src/main/java/com/sk89q/worldedit/LocalSession.java +++ b/src/main/java/com/sk89q/worldedit/LocalSession.java @@ -591,6 +591,15 @@ public class LocalSession { } } + /** + * Gets the status of CUI support. + * + * @return + */ + public boolean hasCUISupport() { + return hasCUISupport; + } + /** * Sets the status of CUI support. * diff --git a/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index 0a4a4c426..9d1c4bb75 100644 --- a/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -110,10 +110,13 @@ public class WorldEditPlugin extends JavaPlugin { * Called on plugin disable. */ public void onDisable() { - controller.clearSessions(); for (Player player : getServer().getOnlinePlayers()) { - wrapPlayer(player).dispatchCUIHandshake(); + LocalPlayer lPlayer = wrapPlayer(player); + if (controller.getSession(lPlayer).hasCUISupport()) { + lPlayer.dispatchCUIHandshake(); + } } + controller.clearSessions(); config.unload(); }