From 9b720867962d6e89b48ae3c26c958d19326d7bef Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 6 Nov 2013 06:32:37 +1300 Subject: [PATCH] Quick update before release. Fixes not returning if event cancelled --- src/me/libraryaddict/disguise/DisguiseListener.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/me/libraryaddict/disguise/DisguiseListener.java b/src/me/libraryaddict/disguise/DisguiseListener.java index c47b4369..c1906c23 100644 --- a/src/me/libraryaddict/disguise/DisguiseListener.java +++ b/src/me/libraryaddict/disguise/DisguiseListener.java @@ -60,6 +60,8 @@ public class DisguiseListener implements Listener { @EventHandler(priority = EventPriority.MONITOR) public void onVechileLeave(VehicleExitEvent event) { + if (event.isCancelled()) + return; final Disguise disguise = DisguiseAPI.getDisguise(event.getExited()); if (disguise != null && event.getExited() instanceof Player) { Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { @@ -73,6 +75,8 @@ public class DisguiseListener implements Listener { @EventHandler(priority = EventPriority.MONITOR) public void onVechileEnter(VehicleEnterEvent event) { + if (event.isCancelled()) + return; Disguise disguise = DisguiseAPI.getDisguise(event.getEntered()); if (disguise != null && event.getEntered() instanceof Player) { disguiseAPI.removeVisibleDisguise((Player) event.getEntered());